Transaction Support for poller in Spring Integration with max-messages-per-poll

让人想犯罪 __ 提交于 2019-12-11 09:52:57

问题


I am new to Spring Integration and had a question regarding using pollers and transaction support for the messages in conjunction with the max-messages-per-poll value.

When using the poller with the following configuration

<int:poller fixed-delay="1000" max-messages-per-poll="10">
    <int:transactional transaction-manager="SomeDatabaseTransactionManager"/>
</int:poller>

The documentation mentions that the polling task will produce 10 messages per poll (or till null is received).

Will each message be run in its own transaction boundary i.e. if one message fails to get to the end of the transaction boundary will rollback happen for the failed message only or will all 10 messages, that were part of the poll will be rolled back?

Thanks RC

Apologies in advance for the rookie question.


回答1:


I answered a similar question on the Spring Forums a few weeks ago...

The bottom line is that each message is processed within a single transaction. The max-messages-per-poll simply means that the poller thread (after processing the current message in its own transaction) immediately tries to process a new message, rather than waiting for the next poll, until mmpp has been reached.



来源:https://stackoverflow.com/questions/19106100/transaction-support-for-poller-in-spring-integration-with-max-messages-per-poll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!