【发布时间】:2015-11-05 20:49:13
【问题描述】:
在我们的应用程序中,消费者在应用程序负载时开始连续轮询,因此有时它会影响其中一个的执行时间 通过在方法执行之间轮询方法。
方法(假设 test())在 junit 情况下理想地需要几毫秒才能运行,现在在应用程序中执行需要几秒钟。因此,想跳过轮询 在这个时间点,如果可能的话。
在 spring 集成文档中看到名为 PollSkipAdvice/PollSkipStrategy 的内容,其中说 PollSkipAdvice 可用于抑制(跳过)投票。
您能否建议,如果这对上述情况有任何帮助。如果使用示例进行解释,那就太好了。谢谢。
示例配置:
<int-kafka:inbound-channel-adapter
id="kafkaInboundChannelAdapter" kafka-consumer-context-ref="consumerContext"
auto-startup="false" channel="inputFromKafka">
<int:poller fixed-delay="10" time-unit="MILLISECONDS"
max-messages-per-poll="5" />
</int-kafka:inbound-channel-adapter>
【问题讨论】:
标签: spring-integration apache-kafka kafka-consumer-api