There are various implementations for using JMS as a request/response service. I would like to know the ideal implementation. Below are these various implementations.
1) Permanent request queue, Dynamic response queue
All request messages are published into a single request queue specifying the reply queue. The service consumes the request message and publishes a message back onto a dynamic reply queue.
- No need for a correlation id.
- Multiple consumers of their corresponding response queues
2) Permanent request queue, Permanent response queue
All request message are published into a single request queue, specifying a unique id in the jms properties. Unique id is stored locally. Service consumes request message and publishes message back onto response queue. A single response consumer will consume the message and act appropriately based on the unique id.
- Correlation id required.
- Single consumer of the response queue
3) Permanent request queue, Permanent response topic
All request messages are published into a single request queue, specifying a unique id in the jms properties. The service consumes the request message and publishes a message with the same unique id in the jms properties back onto the topic. Consumers of the response will set a message selector to select for only the message the contains the unique id.
- Correlation id required.
- Multiple consumers of the response topic
Does anyone know other implementations? And which of these implementations is the ideal solution for using JMS as a request/response service?