简体   繁体   English

与批处理一起使用时,工作完成后可以使用 spring 集成轮询消息吗?

[英]can spring integration poll message after job is done when use with batch?

For now the polling trigger can only be time based, but what I need is in batch when a job is finished, integration starts next polling.现在轮询触发器只能是基于时间的,但我需要的是在作业完成后批量处理,集成开始下一次轮询。 Is this possible?这可能吗?

See Conditional Pollers for Message Sources .请参阅消息源的条件轮询器

Or, use a PollSkipAdvice .或者,使用PollSkipAdvice

AOP advice classes can be applied to pollers, in an advice-chain, such as a transaction advice to start a transaction. AOP 建议类可以应用于建议链中的轮询器,例如启动事务的事务建议。 Starting with version 4.1, a PollSkipAdvice is provided.从 4.1 版开始,提供了 PollSkipAdvice。 Pollers use triggers to determine the time of the next poll.轮询器使用触发器来确定下一次轮询的时间。 The PollSkipAdvice can be used to suppress (skip) a poll, perhaps because there is some downstream condition that would prevent the message being processed. PollSkipAdvice 可用于抑制(跳过)轮询,这可能是因为存在某些下游条件会阻止消息被处理。 To use this advice, you have to provide it with an implementation of a PollSkipStrategy.要使用此建议,您必须为其提供 PollSkipStrategy 的实现。 Starting with version 4.2.5, a SimplePollSkipStrategy is provided.从版本 4.2.5 开始,提供了 SimplePollSkipStrategy。 To use it, you can add an instance as a bean to the application context, inject it into a PollSkipAdvice, and add that to the poller's advice chain.要使用它,您可以将一个实例作为 bean 添加到应用程序上下文中,将其注入 PollSkipAdvice,并将其添加到轮询器的建议链中。 To skip polling, call skipPolls().要跳过轮询,请调用 skipPolls()。 To resume polling, call reset().要恢复轮询,请调用 reset()。 Version 4.2 added more flexibility in this area. 4.2 版在这方面增加了更多的灵活性。 See Conditional Pollers for Message Sources.请参阅消息源的条件轮询器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM