Spring Integration 中对轮询器的事务支持与 max-messages-per-poll [英] Transaction Support for poller in Spring Integration with max-messages-per-poll

查看:16
本文介绍了Spring Integration 中对轮询器的事务支持与 max-messages-per-poll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Spring Integration 的新手,有一个关于将轮询器和事务支持与 max-messages-per-poll 值结合使用的问题.

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>

文档提到轮询任务每次轮询会产生 10 条消息(或直到收到 null).

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

每条消息是否会在其自己的事务边界中运行,即如果一条消息未能到达事务边界的末尾,将仅对失败的消息进行回滚,或者作为轮询的一部分的所有 10 条消息都将被回滚回来了?

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?

谢谢遥控

为菜鸟问题提前道歉.

推荐答案

我在 Spring 论坛 几周前...

最重要的是,每条消息都在单个事务中处理.max-messages-per-poll 只是意味着轮询线程(在自己的事务中处理当前消息后)立即尝试处理新消息,而不是等待下一次轮询,直到 mmpp已达到.

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.

这篇关于Spring Integration 中对轮询器的事务支持与 max-messages-per-poll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆