java - REST Service waiting on a Response of asynchronous processes -


have rest service developed using spring boot

the api uses jms publish topic & topic has multiple subscribers.

now, have process "x", consolidates response of these topics , pushes response queue.

now, have api (rest service) wait queue (posted "x") - synchronous processing.

would jmsreplyto support such case? http://activemq.apache.org/how-should-i-implement-request-response-with-jms.html

edit :

to simplify

in example (provided in above link) - server polls queue & waits on it's response.

our rest service polls queue & has wait on different queue.

in other words - how web service wait & read queue - which, has not posted to

what have done fix problem - not sure, that's right way do

  1. null out default header jmsreplyto
  2. added our custom header "replyto"

even if pass jmsreplyto queue - have observed response returning caller (rest api) right after queue has processed message.

as null out jmsreplyto - not returning response. then, how response come rest api - reason, have created custom header - replyto

each queue kept on passing header replyto further queues, message passed further processing.

if of queues, there no further processing (which depends on conditions on data, client , ...) - made queue post replyto - original jms queue, rest api waiting on.

this has been working consistently, performance issues - considering, message being passed multiple queues.

however, considering api's main task make sure data passed systems (integration point) - doing it's job.

we revisit again see how can change design better throughput.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -