In my Spring
web service there are some asynchronous processes. Client request with some parameters I create a Job
object from those parameters and put into a ActiveMQ
queue using JMS
. So a listener will take those jobs from the queue and process them. Now I need to provide clients a way to track the status of their jobs ( pending, started, finished
). What is the best way to implement this?
I thought I can use JMSTemplate.browse()
with a BrowserCallBack
but still could not find a way to implement it.
Looks like you need to have a DB to track the job status.
The client just ask the statistics and you select
it from DB.
You can use another JMS queue
to send the status of job to perstist in onto DB using appropriate listener.
And with that you will have a good loosely-coupling
: your first listener won't have a direct connection to the DB service.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.