1

When using ActiveMQ, some problems troubles me:

1. When broker crashed or stopped, messages from sender will be lost(I set timeout, because the sender have others to do).
2. Consumer receives all messages from broker, but how i know the consumer received all messages(zero lost).
3. If message is lost, i want to know it immediately.

In production, I want to monitor the activemq, and know which message is lost. Can anyone give me a favor?

4

1 回答 1

0

您可以实现一个侦听器,一旦您的生产者/消费者与代理失去联系,该侦听器就会被调用。

http://activemq.apache.org/maven/5.5.0/activemq-core/apidocs/org/apache/activemq/transport/TransportListener.html

如果消费者崩溃使用显式确认:activemq.apache.org/should-i-use-transactions.html

如果代理崩溃,您可以使用持久消息来避免丢失消息:activemq.apache.org/what-is-the-difference-between-persistent-and-non-persistent-delivery.html

于 2012-10-23T06:09:56.453 回答