骆驼 AMQP autoAck 无法解析端点

Camel AMQP autoAck failed to resolve an endpoint

我试图在读取 azure 服务总线队列时将 autoAck 设置为 false,我正在使用 amqp 连接它。下面是代码。

from("amqp:queue:testqueue?autoAck=false&concurrentConsumers=1")

但我收到一条错误消息:

Failed to create route route1: Route(route1)[[From[amqp:queue:testqueue?autoAck=false&concu... because of Failed to resolve endpoint: amqp://queue:testqueue?autoAck=false&concurrentConsumers=1 due to: Failed to resolve endpoint: amqp://queue:testqueue?autoAck=false&concurrentConsumers=1 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{autoAck=false}]

我正在尝试处理来自服务总线队列的消息,但不希望在处理未完成之前删除它们。

我终于找到了答案,为了仅当消费者接受消息并确认消息已成功处理时才从队列中删除消息,您需要在路由中添加"acknowledgementModeName"

from("amqp:queue:testqueue?acknowledgementModeName=CLIENT_ACKNOWLEDGE&concurrentConsumers=1")

如需更多说明,请访问此页面http://camel.apache.org/jms.html