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/02 08:24:28 UTC
[activemq] branch activemq-5.15.x updated: [AMQ-7301] Display warn
in case of STOMP stream initialize error
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 3dd9121 [AMQ-7301] Display warn in case of STOMP stream initialize error
3dd9121 is described below
commit 3dd9121a3911a7ae5464e7b9827799d67b18593a
Author: jbonofre <jb...@apache.org>
AuthorDate: Mon Mar 2 08:03:36 2020 +0100
[AMQ-7301] Display warn in case of STOMP stream initialize error
(cherry picked from commit d11fd05af4db5f3af46e09c9d9c62821c5b66967)
---
.../activemq/transport/stomp/StompNIOSSLTransport.java | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
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 09757a4..5e899ae 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
@@ -29,9 +29,13 @@ import javax.net.ssl.SSLEngine;
import org.apache.activemq.transport.nio.NIOSSLTransport;
import org.apache.activemq.wireformat.WireFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class StompNIOSSLTransport extends NIOSSLTransport {
+ private final static Logger LOGGER = LoggerFactory.getLogger(StompNIOSSLTransport.class);
+
StompCodec codec;
private X509Certificate[] cachedPeerCerts;
@@ -52,11 +56,15 @@ public class StompNIOSSLTransport extends NIOSSLTransport {
}
@Override
- protected void initializeStreams() throws IOException {
- codec = new StompCodec(this);
- super.initializeStreams();
- if (inputBuffer.position() != 0 && inputBuffer.hasRemaining()) {
- serviceRead();
+ protected void initializeStreams() {
+ try {
+ codec = new StompCodec(this);
+ super.initializeStreams();
+ if (inputBuffer.position() != 0 && inputBuffer.hasRemaining()) {
+ serviceRead();
+ }
+ } catch (IOException e) {
+ LOGGER.warn("Could not initialize connection from {}", socket.getInetAddress().getHostAddress(), e);
}
}