FireVortex
FireVortex

Reputation: 343

JMS queue Request/Response vs. REST

The supposed scenario is that JMS queue is asynchronous with the possibility of a response queue and REST is synchronous. Does the asynchronous response behave like a REST response or is the JMS response just an acknowledgment that the message has been processed? Is it a configuration thing?

Upvotes: 0

Views: 583

Answers (1)

Justin Bertram
Justin Bertram

Reputation: 34998

In a message-based request-response use-case an application sends a request message to a queue. At this point the application is free to do whatever it wants, and this is one of the benefits of using asynchronous messaging rather than synchronous REST. For example, the application could...

  • block waiting for a response (this would be functionally equivalent to the synchronous REST behavior)
  • set up a javax.jms.MessageListener to process the response asynchronously as soon as it is ready
  • perform some other task(s) and then check later if the response is available, ad infinitum

In the mean-time another application will consume the request message, process it, and send a response message with the processing results. Ultimately the contents of the response message is based on your use-case. In any event, this won't be a "configuration thing" unless you've designed your response application to provide configurable responses.

Upvotes: 1

Related Questions