activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From artnaseef <>
Subject Re: TransportListerner onCommand
Date Thu, 08 May 2014 03:40:25 GMT
That method, onCommand(), is called for every transport "command"; commands
are the unit of the ActiveMQ openwire protocol (not sure what happens with
non-openwire).  So, it is called with tremendous detail that is very highly
activemq-internal-specific.  And it is called with high frequency on busy

With a short look through the ActiveMQ code, it's possible to see that
onCommand() is actually used in ActiveMQ's TransportConnection - the key
class in ActiveMQ's termination of the connection from clients.  That's
where all handling of the protocol occurs for a connection.

The idea of injecting commands to the transportListener makes me nervous -
what would be the reason to inject commands at that level rather than using
the client API designed to carefully encapsulate those details?  One thing
to consider there is that changes to ActiveMQ internals have a high
likelihood of breaking any such code.  Another consideration is that
mistakes in injected commands can lead to challenging problems to diagnose.

My recommendation for a TransportListener is to leave onCommand() alone and
only use the onException(), transportInterrupted(), and transportResumed()

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

View raw message