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.
 Therefore,
there is no way to actually set a listener.

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

Thanks,
Brett

Reply via email to