建议链中的spring集成轮询器同步工厂
我的目标是让spring集成轮询器在出现几个异常时退出轮询 我配置了以下出站通道适配器建议链中的spring集成轮询器同步工厂,spring,spring-integration,Spring,Spring Integration,我的目标是让spring集成轮询器在出现几个异常时退出轮询 我配置了以下出站通道适配器 <int:outbound-channel-adapter id="adapter" ref="handler" method="handle" channel="channel" > <int:poller max-messages-per-poll="50" fixed-delay="13" time-unit="SEC
<int:outbound-channel-adapter id="adapter" ref="handler"
method="handle" channel="channel" >
<int:poller max-messages-per-poll="50" fixed-delay="13"
time-unit="SECONDS" task-executor="threadpool">
<int:transactional synchronization-factory="mySyncFactory"
transaction-manager="simpleJdbcTransactionManager"
timeout="30"/>
</int:poller>
</int:outbound-channel-adapter>
现在我想添加另一个建议(cuircuit断路器)。为此,我必须删除int:transactional标记,并添加一个建议链。我可以这样写
<int:outbound-channel-adapter id="adapter" ref="handler"
method="handle" channel="channel" >
<int:poller max-messages-per-poll="50" fixed-delay="13"
time-unit="SECONDS" task-executor="threadpool">
<int:advice-chain>
<tx:advice transaction-manager="simpleJdbcTransactionManager">
<tx:attributes>
<tx:method name="*" timeout="30000" />
</tx:attributes>
</tx:advice>
<int:ref bean="cuircuitBreaker"/>
</int:advice-chain>
</int:poller>
</int:outbound-channel-adapter>
我无法为tx通知声明同步工厂。有没有关于如何实现这一点的提示
更新
我使用的是spring integration 3.0.4版看起来您没有注意到
具有相同的同步工厂
属性,并且完全出于相同的目的
及其说明:
只有当链中存在事务通知时,此属性的设置才会产生影响
超出了Spring集成范围,因此我们无法访问该组件,应该只为父标记提供该解决方案。由于
和
是相互排斥的,因此在建议链
上有同步工厂
看起来很直观,但不在另一个位置。