activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Wooldridge <>
Subject Bridge (NetworkConnector) Listener?
Date Tue, 07 Dec 2010 04:07:18 GMT
I have a dynamic network of brokers (created programmatically).  And I
have a need for the "hub" broker to know about the comings and goings
of the "spoke" brokers' connections.

For example, take this topology:

Broker A <------------> Broker B

Broker A is the "hub", and initiates a bridge to Broker B (the "spoke")
via a call to BrokerService.addNetworkConnector().  This connection
may block or succeed (depending on the network and whether Broker B
is running), and it may come and go -- again depending on the network
or whether Broker B is restarted.

Through my debugger, I can see that the returned NetworkConnector
is in fact a DiscoveryNetworkConnector, and I can see that that
connector contains a private collection of Bridges, which themselves
contain Transports.

>From the JavaDoc, I can see that there is a NetworkBridgeListener
which seems to be what I want -- well, almost.  It contains a callbacks
for onStart(), onStop(), and bridgeFailed() ... but none for bridgeResumed()
in the case of an underlying FailoverTransport.  Will onStart() be called
after bridgeFailed() when connectivity is restored?

The bigger issue is that there in fact seems no way to get ahold of the
bridge (or bridges) inside of the DiscoveryNetworkConnector itself.
there is no way to actually set a listener.

Is it possible to monitor the comings and goings of a bridge?  If so, how?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message