Spring Integration : How to guarantee the transaction two more jdbc-outbound-gateway?

前端 未结 1 1755
有刺的猬
有刺的猬 2020-12-11 12:28

I have the following pattern \"my

I have two kinds of databases. One is a int

相关标签:
1条回答
  • 2020-12-11 12:48

    Add a QueueChannel somewhere upstream (i.e. before the pub sub channel for tx2) and use a <transactional/> poller to start the transaction.

    Alternatively, insert a transactional gateway...

    <int:service-activator ... ref="txGw" />
    
    <int:gateway ... service-interface="TX" />
    
    public interface TX {
        @Transactional
        Message<?> exchange(Message<?> m);
    }
    

    You'll need <tx:annotation-driven /> to enable transactions in the second case.

    0 讨论(0)
提交回复
热议问题