ARTEMIS-6004 Add clientFailoverAdvertisingEnabled configuration to not send failover server list info to AMQP clients - #6614
Conversation
847191b to
0900aed
Compare
| TopologyMemberImpl member = clusterConnection.getTopology().getMember(server.getNodeID().toString()); | ||
| if (member != null) { | ||
| return member.toBackupURI(); | ||
| TransportConfiguration backupConnector = member.getBackup(); |
There was a problem hiding this comment.
Adding this here seems off if you intend as you've said above for this to be a more generic option applicable to other protocols besides AMQP. Having to copy this code block around for any other implementation that needs it is sub optimal and likely error prone. Seems as though this code should live elsewhere so that it can be called here or in other protocols implementations to check if the connector is to be advertised.
There was a problem hiding this comment.
Currently this fix is specific for AMQP. I could see making this naming AMQP specific if that make it more obvious for now. No matter what there won't be a single spot for all protocols unless an abstraction is specifically made for this but I don't think this is something all protocols support so I wouldn't think that makes sense but let me know if that would stop this getting merged. Core might be only other protocol that I know of that might use this but I could be wrong.
…t send failover server list info to AMQP clients
0900aed to
c5021dd
Compare
Description
Add a
clientFailoverAdvertisingEnabledconnector property to control whether a backup connector is advertised to clients as part of the AMQP failover topology.Currently, Artemis can advertise the backup connector from the broker's internal cluster topology to AMQP clients. This can cause clients using different internal and external DNS names or ports to receive an unreachable failover endpoint.
For example, an external Qpid JMS client may initially connect using:
but receive the internal backup connector from the broker topology:
The client can then attempt to use the advertised endpoint instead of the endpoint configured by the client.
This is the scenario described in ARTEMIS-6004.
Changes
clientFailoverAdvertisingEnabledconnector property.trueto preserve existing behavior.false, the backup connector is not included in the AMQP failover information advertised to clients.Testing
The change was tested with a Java Qpid JMS client using an Artemis HA live/backup configuration where the broker's internal cluster topology uses different hostnames/ports from those exposed to external clients.
With:
the broker no longer advertises the internal backup connector to the AMQP client.
As a result, external clients no longer need to configure:
to prevent Qpid JMS from replacing their configured failover endpoints with the broker-provided topology.
This provides a broker-side solution for clients that cannot be configured with
failover.amqpOpenServerListAction=IGNORE.