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/04 16:58:27 UTC

[activemq] branch activemq-5.15.x updated: [AMQ-7347] Don't log error in case of topic subscription failure. It's useless as the JMX exception is thrown and pollute the log.

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 45ddc66  [AMQ-7347] Don't log error in case of topic subscription failure. It's useless as the JMX exception is thrown and pollute the log.
45ddc66 is described below

commit 45ddc6630515971769eafa6c19778581aaa75f99
Author: jbonofre <jb...@apache.org>
AuthorDate: Wed Mar 4 07:22:10 2020 +0100

    [AMQ-7347] Don't log error in case of topic subscription failure. It's useless as the JMX exception is thrown and pollute the log.
    
    (cherry picked from commit 3c302dce33500cd8e36f626af333ce208ebc44a0)
---
 .../main/java/org/apache/activemq/broker/region/TopicRegion.java    | 2 +-
 .../java/org/apache/activemq/transport/stomp/ProtocolConverter.java | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
index 1ea3e62..e145c02 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
@@ -369,7 +369,7 @@ public class TopicRegion extends AbstractRegion {
             answer.init();
             return answer;
         } catch (Exception e) {
-            LOG.error("Failed to create TopicSubscription ", e);
+            LOG.debug("Failed to create TopicSubscription ", e);
             JMSException jmsEx = new JMSException("Couldn't create TopicSubscription");
             jmsEx.setLinkedException(e);
             throw jmsEx;
diff --git a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
index 7753f7a..7f12951 100644
--- a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
+++ b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
@@ -257,7 +257,11 @@ public class ProtocolConverter {
         if (command == null) {
             LOG.warn("Exception occurred while processing a command: {}", exception.toString());
         } else {
-            LOG.warn("Exception occurred processing: {} -> {}", safeGetAction(command), exception.toString());
+            if (exception instanceof JMSException) {
+                LOG.warn("Exception occurred for client {} ({}) processing: {} -> {} ({})", connectionInfo.getClientId(), connectionInfo.getClientIp(), safeGetAction(command), exception.toString(), ((JMSException) exception).getLinkedException().toString());
+            } else {
+                LOG.warn("Exception occurred for client {} ({}) processing: {} -> {}", connectionInfo.getClientId(), connectionInfo.getClientIp(), safeGetAction(command), exception.toString());
+            }
         }
 
         if (LOG.isDebugEnabled()) {