简体   繁体   English

一个ActiveMQ队列中的多个使用者

[英]Several consumers from one ActiveMQ queue

Say i have several consumers who connect to the same Queue. 假设我有几个连接到相同队列的使用者。

My business logic is: take a message from the queue, perform some logical operation and if that operation is successful acknowledge this message (working as client-ack). 我的业务逻辑是:从队列中获取一条消息,执行一些逻辑操作,如果该操作成功,则确认该消息(作为客户端确认)。

My question is, what happens if one of these consumers logic fails and it doesnt return acknowledge on that message. 我的问题是,如果这些使用方逻辑之一失败并且不返回该消息的确认,将会发生什么。

Is there a risk that this message will be sent to some other consumer while the message is still being processed by a consumer? 在消费者仍在处理该消息时,是否有将该消息发送给其他消费者的风险?

Is there some kind of time out after which this message is released by a thread back to the queue? 是否有某种超时时间,之后线程将这个消息释放回队列?

Messages are dispatched to Consumers in a round robin manner to Queue consumers. 消息以循环方式发送给使用者,并排队到使用者。 If a Consumer fails and the Message it's processing is not acknowledge at the Broker then once the Broker has detected the failure of the consumers connection it will place the message back on the Queue making it available for processing by another connected Consumer. 如果使用者失败,并且在Broker上未确认其正在处理的消息,则一旦Broker检测到使用者连接失败,它将把消息放回队列,以供其他已连接的使用者处理。

Its also possible to configure a set maximum number of re-deliveries for a Message such that it will be placed in a Dead Letter Queue after a certain point. 还可以为消息配置设置的最大重新发送数目,以使该消息在特定点之后将被放置在死信队列中。

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

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