You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2020/03/05 16:23:00 UTC
[activemq] branch activemq-5.15.x updated: [AMQ-7301] Improve
logging when initialize Stomp NIO SSL connection
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch activemq-5.15.x
in repository https://gitbox.apache.org/repos/asf/activemq.git
The following commit(s) were added to refs/heads/activemq-5.15.x by this push:
new 71e6ea2 [AMQ-7301] Improve logging when initialize Stomp NIO SSL connection
71e6ea2 is described below
commit 71e6ea21caf2c5c9c0791ff2d6920eafc3adbfd8
Author: jbonofre <jb...@apache.org>
AuthorDate: Thu Mar 5 07:54:28 2020 +0100
[AMQ-7301] Improve logging when initialize Stomp NIO SSL connection
(cherry picked from commit b60efeaad82c63d4b00eb83285b6701ae3e7a73e)
---
.../src/main/java/org/apache/activemq/broker/TransportConnector.java | 5 ++++-
.../org/apache/activemq/transport/stomp/StompNIOSSLTransport.java | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java
index 813be50..a8f9359 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java
@@ -242,8 +242,11 @@ public class TransportConnector implements Connector, BrokerServiceAware {
if (brokerService != null && brokerService.isStopping()) {
LOG.info("Could not accept connection during shutdown {} : {}", (remoteHost == null ? "" : "from " + remoteHost), error.getLocalizedMessage());
} else {
- LOG.warn("Could not accept connection {} : {}", (remoteHost == null ? "" : "from " + remoteHost), error.getLocalizedMessage());
+ LOG.debug("Could not accept connection from {}: {}", remoteHost, error.getMessage());
LOG.debug("Reason: " + error.getMessage(), error);
+ if (error != null && error.getMessage() != null && remoteHost != null) {
+ LOG.warn("Could not accept connection from {}: {}", remoteHost, error.toString());
+ }
}
}
});
diff --git a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java
index 5e899ae..beefa8f 100644
--- a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java
+++ b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java
@@ -26,6 +26,7 @@ import java.security.cert.X509Certificate;
import javax.net.SocketFactory;
import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLHandshakeException;
import org.apache.activemq.transport.nio.NIOSSLTransport;
import org.apache.activemq.wireformat.WireFormat;
@@ -64,7 +65,7 @@ public class StompNIOSSLTransport extends NIOSSLTransport {
serviceRead();
}
} catch (IOException e) {
- LOGGER.warn("Could not initialize connection from {}", socket.getInetAddress().getHostAddress(), e);
+ LOGGER.warn("Could not initialize connection from {}: {} ({})", socket.getInetAddress().getHostAddress(), e.getMessage(), e.getCause().getMessage());
}
}