You are seeing the expected behavior. This is because the URL you provide to the Core client is only used for the initial connection by default. Once the initial connection is made the broker informs the client about the cluster topology (if one exists), and when reconnecting or failing over the client uses this topology. This is so that nodes in the cluster can come and go and the client always has up-to-date information about where to connect in case of a failure. The information in the cluster topology is based on the configuration of the cluster-connection (i.e. in the <connector-ref>). Since your cluster connections use port 6000 that is what is sent to the client. You can ignore the topology if you like by setting useTopologyForLoadBalancing=false in your connection URL at which point it will simply use what is statically configured in the URL.
I can't think of any particular benefits to having the cluster-connections use a different port from normal connections. Is there a reason why you've configured them this way? Justin On Fri, Apr 4, 2025 at 10:33 AM <maximilian.rie...@systema.com> wrote: > Hello Community, > > I'm testing a clustered setup with two ActiveMQ Artemis brokers configured > for high availability. Each broker has two acceptors: one for client > connections on port 6666 and one for cluster connections on port 6000. > > In my test application, I connect using a failover URL: > (tcp://hostA:6666,tcp://hostB:6666)?failoverAttempts=-1 > Then I retrieve and print the remote address the client is connected to > using the following: > > ClientSessionFactory sessionFactory = connection.getSessionFactory(); > RemotingConnection remotingConnection = sessionFactory.getConnection(); > Connection transportConnection = > remotingConnection.getTransportConnection(); > String remoteAddress = transportConnection.getRemoteAddress(); > > Initially, the printed remote address correctly shows the client port, > e.g., hostB/192.123.123.123:6666. > > However, after shutting down the broker the client is connected to (to > simulate a failover), the client reconnects to the other broker — but now > the remote address points to the cluster port (e.g., hostA/ > 192.123.123.124:6000) instead of the expected client port. > > Is this expected behavior? Should the remote address after failover point > to the cluster port instead of the client port? > > I added a short test case on my github: > https://github.com/MaximilianRieder/ArtemisRemoteAddressTest > > Kind regards > Maximilian > ------------------------------ > > *Maximilian Rieder* > Software Engineer > > Phone: +49 941 / 7 83 92 84 > maximilian.rie...@systema.com > > www.systema.com > > [image: LinkedIn] <https://www.linkedin.com/company/systema-gmbh/>[image: > Facebook] <https://de-de.facebook.com/SYSTEMA.automation/>[image: XING] > <https://www.xing.com/pages/systemagmbh> > > SYSTEMA > Systementwicklung Dipl.-Inf. Manfred Austen GmbH > > Manfred-von-Ardenne-Ring 6 | 01099 Dresden > HRB 11256 Amtsgericht Dresden | USt.-ID DE 159 607 786 > Geschäftsführer: Manfred Austen, CEO und Dr. Ulf Martin, COO > > P Please check whether a printout of this e-mail is really necessary. >