问题
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