-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Bart Prokop opened SPR-13133 and commented
There are three possible use-cases for JmsListener annotated method processing:
- request-reply scenario. The request have a JMSReplyTo set. Supported.
- processing messages and sending result back to predefined queue. Supported with SendTo annotation.
- processing message but the destination where to send response is determined during request processing. In most trivial case it can be forwarding incoming message to various destination, based on incoming message evaluation. There is no elegant solution to do this.
Please note that elegant solution would allow for implementing very rich/advance functionality inside listeners including dispatching multiple replies, dynamic destinations.
Some workaround for point 3 exists like returning void and use JMSTemplate or hacking request JMSReplyTo - but they are not elegant solution and not intended to use patterns.
The solution would require to inspect returning object that could be placeholder for both Message and Destination. There was some discussion around it that excluded using Message properties for this as JMS non compliant solution (see the ref URL). Alternatively a Map<Message, Destination> could be passed as parameter (or returned from listener method).
Reference URL: #817