I have implemented a message splitter that receives a message from one queue and sends it onto two other queues. There are different MessageConverters required for each send, so I am using two different JmsTemplates and the convertAndSend methods.
The splitter is just a POJO like the rest of my MDPs, except that instead of relying on the MessageListener.defaultResponseDestination property to put response values it uses JmsTemplate directly as described above.
Is using the JmsTemplate a valid way to do this? Would this bundle the two sends in the same transaction as the receive? (I have set sessionTransacted=true) This section the the Spring reference (Chapter 19) makes it sound like I would need a SessionAwareMessageListener for this.
"Each message listener invocation will then operate within an active JMS transaction, with message reception rolled back in case of listener execution failure. Sending a response message (via SessionAwareMessageListener) will be part of the same local transaction, but any other resource operations (such as database access) will operate independently."
Does this mean that I need to implement SessionAwareMessageListener and use the Session directly, invoking my MessageConverters as I need them?
Any clarity you could provide would be appreciated
Thanks for your time