Open oreillymj opened 2 years ago
Hi @oreillymj - I see your point with this.
There is a lack of clarity between .serverHost(serverHosts[0])
, client.getConfig()
and an explicit call to .transportConfig().serverHost(nextHost).applyTransportConfig()
that can definitely cause some confusion.
I'll have to give it some thought on how the API should better handle this.
Expected behavior
I would expect a client variable to reflect the host/port currently connected to after a reconnect.
Actual behavior
However, after a reconnect, where the host and port change, the client information still retains the original connection information.
To Reproduce
Create a client variable with scope outside of the creating function. Add functionality to switch between multiple hosts (broker A & B) in an onDisconnected event handler. Connect to Broker A, then force a failover to Broker B. Display the client information which shows Broker A connection info.
client.getState() still maintains the original connection information.
Steps
Reproducer code
Details