骆驼AMQP autoAck无法解析端点

时间:2018-09-10 21:43:47

标签: azure apache-camel amqp azureservicebus

我正在尝试从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}]

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

1 个答案:

答案 0 :(得分:0)

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

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

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