On Oct 23, 2012, at 7:30 AM, bizcenter wrote:

> 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 dnow the consumer
> received all messages(zero lost). 
> 3. If message is lost, i want to know it immediatelly.
> 
> In production, I want to monitor the activemq, and know which message is
> lost.
> Can anyone give me a favor?
> Thanks very much.
> Forgive my poor english...

Assuming you are using persistent messages, your message should be stored 
inside the brokers persistence adapter until the consumer receives and 
acknowledges the message. So if the broker crashes before it dispatched the 
message to the consumer, the broker will generally redeliver the message to the 
consumer after a restart. This assumes your message has not timed out in 
between. 
If the broker crashes before it got written to the persistence adapter, then 
your producer will receive an exception and should be able to resend that 
message once the broker is available again.
So in general you should not need to loose messages.
The broker should also run quite stable if configured correctly and if a more 
decent version is used. 


You mention a message timeout. If you are concerned about loosing messages due 
to timeout, perhaps you should not use a message timeout in that case? 

I am not aware of any tool that would quickly tell you which message you lost 
due to message timeouts. 
The right debug logging configuration in the broker *may* log whenever a 
message had a timeout in the broker. But I am not sure which class contains 
that logging. The question is do you really want to rely on this? 

Finally you could also consider a master slave broker configuration to make 
your JMS broker highly available.  


Hope this helps as a starting point.

Regards,

Torsten Mielke
tors...@fusesource.com
tmie...@blogspot.com



Reply via email to