admin管理员组文章数量:1303068
Is it possible to attach a TransactionSynchronizationFactory to an outbound JMS Outbound Adapter?
We are trying to send a message to a JMS queue and want to update a database once the JMS send is successful. The idea is that we will start a transaction when a message comes in on our queue and then once we send the outbound message, we "commit" both the read and the write to JMS and update a database. The TransactionSynchronizationProcessor
seem like the correct interface for this, but we are unable to figure out how to attach it to the outbound adapters transaction.
handle(Jms.outboundAdapter(connectionFactory)
.destination("outputqueue")
.configureJmsTemplate(jmsTemplateSpec -> jmsTemplateSpec.id("jmsTemplateOutbound")
.sessionTransacted(true)
))
Is it possible to attach a TransactionSynchronizationFactory to an outbound JMS Outbound Adapter?
We are trying to send a message to a JMS queue and want to update a database once the JMS send is successful. The idea is that we will start a transaction when a message comes in on our queue and then once we send the outbound message, we "commit" both the read and the write to JMS and update a database. The TransactionSynchronizationProcessor
seem like the correct interface for this, but we are unable to figure out how to attach it to the outbound adapters transaction.
handle(Jms.outboundAdapter(connectionFactory)
.destination("outputqueue")
.configureJmsTemplate(jmsTemplateSpec -> jmsTemplateSpec.id("jmsTemplateOutbound")
.sessionTransacted(true)
))
Share
Improve this question
asked Feb 4 at 21:26
VPN236VPN236
273 bronze badges
1 Answer
Reset to default 0start a transaction when a message comes in on our queue
So, you start transaction far before this Jms.outboundAdapter()
, but you somehow think that TransactionSynchronizationProcessor
would make sense only on this Jms.outboundAdapter()
, which is not correct because transaction management is not here.
Consider to use this processor exactly at the place where you start transactions.
See DefaultTransactionSynchronizationFactory
and TransactionSynchronizationManager.registerSynchronization(synchronization)
API.
本文标签: Identifying when a spring integration JMS Outbound Adapter write commit is successfulStack Overflow
版权声明:本文标题:Identifying when a spring integration JMS Outbound Adapter write commit is successful? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741745070a2395486.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论