Hello,

I am working on a Java application using 
"org.apache.activemq:artemis-jms-client:2.11.0" which connects to multiple 
Artemis brokers. An important part of my application is the ability to be able 
to monitor the connections with the Artemis brokers. I am having trouble 
determining some of the information I am looking for.

The first thing I am trying to monitor is how many reconnection attempts have 
been made after a connection has been broken. I have set my reconnection 
attempts to "-1" on an ActiveMQConnectionFactory to try to reconnect 
infinitely. The problem that I am having is that the ActiveMQConnectionFactory 
doesn't appear to expose the number of reconnection attempts that have been 
made. Is there any way for me to be able to determine how many times the 
ActiveMQConnectionFactory attempted a reconnect?

The next thing I am trying to monitor is the number of broken connections with 
a given broker. The javax JMS Connection allows you to configure a 
ExceptionListener, however I find that this listener is only triggered once the 
number of reconnection attempts has been exceeded. Is there a way to see 
immediately when a connection is broken and not after reconnection attempts 
have been made?

One solution I thought of was to set reconnection attempts to "0" and when I 
receive an exception via the ExceptionListener I manually close the connection 
and try to establish a new one. However this doesn't seem like the right way to 
do this, and also seems really inefficient.

Finally, I am trying to determine if a connection has been reestablished. There 
doesn't appear to be a way to determine if a connection has been reestablished 
other than being able to successfully send or receive a message. Is there a way 
to see this without first sending or receiving a message?

I feel like I am not quite using the library in the right way. What I'm looking 
for is to be able to see when a connection is broken, how many reconnection 
attempts have been made, and when I am successfully reconnected. Any 
help/guidance would be greatly appreciated.

Regards,
Tom


This message is marked Public.

This e-mail (including attachments) contains contents owned by Saab Group AB 
and/or its subsidiaries, affiliated companies or customers and covered by the 
laws of Sweden, the US, or Canada (federal, state or provincial). The 
information is intended to be confidential and may be legally privileged. If 
you are not the intended recipient, you are hereby notified that any retention, 
dissemination, distribution, interception or copying of this communication is 
strictly prohibited and may subject you to further legal action. Reply to the 
sender if you received this email by accident, and then delete the email and 
any attachments.

Reply via email to