rabbitmq-ha-client
rabbitmq-ha-client copied to clipboard
Use the correct signature for ConnectionFactory.newConnection.
HaConnectionFactory is overriding and calling newConnection(Address[] addrs), which is not the root method in the super class and is causing incorrect behavior.
In the case of the override, it requires that client implementations call newConnection with addrs, and it doesn't support the default value provided by the ConnectionFactory. In the second case (in newTargetConnection), the superclass implementation calls the overridden method in HaConnectionFactory, which is causing multiple shutdown listeners to be created on the first reconnect and multiple connections on the second reconnect.