// Send the message using the fail over publisher.
connection3.request(createMessage(producerInfo3, destination, deliveryMode));
// The message will be sent to one of the brokers.
FailoverTransport ft = (FailoverTransport)connection3.getTransport().narrow(FailoverTransport.class);
// See which broker we were connected to.
StubConnection connectionA;
StubConnection connectionB;
TransportConnector serverA;
if (connector.getServer().getConnectURI().equals(ft.getConnectedTransportURI())) {
connectionA = connection1;
connectionB = connection2;
serverA = connector;
} else {
connectionA = connection2;