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

Reply via email to