activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbuxbaum <>
Subject guarding against dropped listener
Date Tue, 09 Apr 2013 17:08:02 GMT
Hi all,

I developed a simple jms application to publish to a queue, and establish
listeners on that queue.  I persisted these listenere in a pool.  When I did
this a couple of years back, I included a "ping" in the MessageListener when
I pulled it from the pool, to test its viability.  This ping created a
producer on the listening queue, and sent a simple message, relying on an
exception to check if it was still connected.  I recall that I did this
because I found that, under some circumstances the listener would silently
be disconnected from ActiveMQ, and I would never find out, as onMessage()
would not be called.  I do not recall the circumstances that prompted me to
code it this way.

My question is this: Do I need to check for an established connection on the
listener occasionally?  And if so, why?  Under what circumstances will the
listener silently fail?  Is there a way I can check the listener's viability
without sending a ping message to the queue?  Please read my mind from the
past to let me know why I did what I did!

I cannot afford to have the application chug along unnoticed without
receiving messages, and yet do not want to incur the overhead of superfluous

Note that this model was one where the producer and consumer both reside in
the same application.



View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message