I have been attempting to configure spring integration to use JMS as its "backing" messaging system and so far I have the sending working correctly. It sends the message in a JTA transaction, and all works well. On the receiving end is where things break down. I have not been able to receive a message within a JTA transaction, I can get it to work if I disable all of the JTA-ness (changing the ConnectionFactory and changing configuration).
I guess my line of thinking is that the MessageListener would subscribe as transactional to the session, put that on the DirectChannel, still in the transaction, I could do my processing and then everything would work. But I can't figure out how to get the underlying message listener to subscribe in a transactional way.
my configuration
Thanks,Code:<message-bus/> <annotation-driven/> <jee:jndi-lookup jndi-name="jms/XAConnectionFactory" id="connectionFactory" resource-ref="true"/> <jee:jndi-lookup jndi-name="jms/queues/queue id="queue" resource-ref="true"/> <direct-channel id="toQueue" /> <direct-channel id="fromQueue" source="fromQueueSource"/> <jms-target id="toQueueTarget" jms-template="toQueueJMSTemplate" /> <jms-source id="fromQueueSource" jms-template="fromQueueJMSTemplate"/> <target-endpoint input-channel="toQueue" target="toQueueTarget" /> <source-endpoint source="fromQueueSource" channel="fromQueue"> <schedule period="50"/> </source-endpoint> <beans:bean id="toQueueJMSTemplate" class="org.springframework.jms.core.JmsTemplate"> <beans:property name="connectionFactory" ref="connectionFactory"/> <beans:property name="deliveryPersistent" value="true"/> <beans:property name="sessionTransacted" value="true"/> <beans:property name="defaultDestination" ref="queue"/> <beans:property name="messageConverter" ref="simpleMessageConverter"/> </beans:bean> <beans:bean id="fromQueueJMSTemplate" class="org.springframework.jms.core.JmsTemplate"> <beans:property name="connectionFactory" ref="connectionFactory"/> <beans:property name="deliveryPersistent" value="true"/> <beans:property name="sessionTransacted" value="true"/> <beans:property name="defaultDestination" ref="queue"/> <beans:property name="messageConverter" ref="simpleMessageConverter"/> </beans:bean> <beans:bean id="simpleMessageConverter" class="org.springframework.jms.support.converter.SimpleMessageConverter"/>
Chris


Reply With Quote