Camel ShutdownStrategy:飞行消息不减少 [英] Camel ShutdownStrategy: Inflight Messages do not decrease

查看:28
本文介绍了Camel ShutdownStrategy:飞行消息不减少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的骆驼上下文中使用默认关闭策略.该路由从一个 rabbitmq 消费者开始,该消费者从一个超过 10k 条消息的队列中消费.当我停止路由时,消费者继续使用队列中的新消息.因此,飞行中交换计数永远不会减少,并且路由等待关闭,直到默认超时值(300 秒).有没有办法改变这种行为?基本上停止rabbitmq消费者在关机过程中消费新消息.

I am using the default shutdown strategy in my camelcontext. The route starts with a rabbitmq consumer which is consuming from a queue with more than 10k messages. When I stop the route, the consumer keeps on consuming new messages from the queue. Hence the inflight exchange count never decrements and the route waits for shutdown until the default timeout value(300s). Is there any way to change this behaviour? Basically stop the rabbitmq consumer from consuming new messages when shutdown is in progress.

推荐答案

我和你有同样的问题.关键是在关闭时,骆驼更喜欢暂停消费者而不是关闭他们.目前 RabbitMQ 消费者没有实现 suspend() 方法.问题将在2.16.2版本修复

I have the same the problem with you. The point is when shutting down, Camel prefer suspending consumers than shutting down them. Currently RabbitMQ consumer does not implement the suspend() method. The problem will be fix in version 2.16.2

这篇关于Camel ShutdownStrategy:飞行消息不减少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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