activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <>
Subject Re: Persistence Behavior
Date Tue, 15 Sep 2009 21:59:27 GMT
On Tue, Sep 15, 2009 at 12:03 PM, dbczak <> wrote:
> Hi,
> I have two consumers running, and one producer (all written in java).  The
> producer is sending a message to each consumer with the basic failover
> transport.  In the producer, I have the persistent setting set to true.

I'm not sure what you mean that the persistent setting is true in the
producer. Are you referring to the MessageProducer.setDeliveryMode()
method? I must assume that this is what you mean and that you've set
the delivery mode to DeliveryMode.PERSISTENT.

> My problem is that if one of the consumer crashes, when the producer goes to
> send a message to that consumer, it will infinitely wait for the transport
> to reconnect, and it will not continue processing. It just prints the
> following log every second:
> [main] DEBUG - Waiting for transport to reconnect.
> I thought when I set persistent to true, if the producer tries to send a
> message but fails, it should store that message and continue on. Then when
> the crashed consumer comes back up, all stored messages would be sent.  Am I
> not understanding how this should work?  How do I stop producer from waiting
> for the reconnect?

Again, I must assume that you are referring to the
MessageProducer.setDeliveryMode() above, and you've set it to
DeliveryMode.PERSISTENT. The behavior that you have described above is
incorrect for persistent delivery mode. The delivery mode has nothing
to do with message storage on the side of the producer; it has
everything to do with the way the message is handled by the JMS
provider. By setting the delivery mode to persistent. this tells the
JMS provider to store the message so it's not lost in the event that
the JMS provider crashes. This assures that consumers will still
receive the message when the broker comes up again. This behavior is
defined by the JMS spec.

perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"

ActiveMQ in Action:

View raw message