This is an automated email from the ASF dual-hosted git repository.

tabish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-jms.git


The following commit(s) were added to refs/heads/main by this push:
     new 14414ba  QPIDJMS-528 Add additional logging to JMS Connection for 
failure
14414ba is described below

commit 14414ba319183d6c0450564b46ef7c89a86357b9
Author: Timothy Bish <tabish...@gmail.com>
AuthorDate: Tue Apr 27 13:24:25 2021 -0400

    QPIDJMS-528 Add additional logging to JMS Connection for failure
    
    Adds additional informational loggers for connection interrupted (when
    failover active) and connection failed (both for reconnect or normal
    connection) to give status of the connection in the logs.
---
 .../src/main/java/org/apache/qpid/jms/JmsConnection.java          | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git 
a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java
index ad75e6b..b15e781 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java
@@ -1250,6 +1250,12 @@ public class JmsConnection implements AutoCloseable, 
Connection, TopicConnection
 
     @Override
     public void onConnectionInterrupted(final URI remoteURI) {
+        try {
+            LOG.info("Connection {} interrupted to server: {}", 
connectionInfo.getId(), URISupport.removeQuery(remoteURI));
+        } catch (URISyntaxException e) {
+            LOG.info("Connection {} interrupted to server: {}:{}", 
connectionInfo.getId(), remoteURI.getHost(), remoteURI.getPort());
+        }
+
         for (JmsSession session : sessions.values()) {
             session.onConnectionInterrupted();
         }
@@ -1369,6 +1375,8 @@ public class JmsConnection implements AutoCloseable, 
Connection, TopicConnection
     public void onConnectionFailure(final ProviderException ex) {
         providerFailed(ex);
 
+        LOG.info("Connection has failed due to error: {}", ex != null ? 
ex.getMessage() : "No error details provided.");
+
         // Signal that connection dropped we need to mark transactions as
         // failed, deliver failure events to asynchronous send completions etc.
         for (JmsSession session : sessions.values()) {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to