It is simply a transaction propagation issue from consumer to producer. You can fix it easily by doing the below additional configurations.
If you are using DefaultMessageListenerContainer
, It is strongly recommended to either set sessionTransacted to true or specify an external transactionManager.
If you did not configured a message listener container but using message-driven-channel-adapter
instead, you need to set its acknowledge
property to transacted
.
To configure your outbound adapter to participate in transaction, you need to configure JmsTemplate
as follows and set its sessionTransacted
property to true
:
<bean id="outboundJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="outboundCF" />
<property name="defaultDestination" ref="outboundDestination" />
<property name="sessionTransacted" value="true" />
</bean>
<int-jms:outbound-channel-adapter channel="jmsOutChannel" jms-template="outboundJmsTemplate" />
Hope it will solve your problem.