From 2a953481821fcbfefbdd235a2c5b7f7e7ef8a6b7 Mon Sep 17 00:00:00 2001 From: saivr1t Date: Mon, 14 May 2018 15:11:10 +0300 Subject: [PATCH] AMQ-6959 Avoid creating a Throwable in case of non-trace logging --- .../src/main/java/org/apache/activemq/ActiveMQSession.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java b/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java index 1e82af8cca..af043d027f 100644 --- a/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java +++ b/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java @@ -950,7 +950,9 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta @Override public void afterRollback() throws Exception { - LOG.trace("rollback {}", ack, new Throwable("here")); + if (LOG.isTraceEnabled()) { + LOG.trace("rollback {}", ack, new Throwable("here")); + } // ensure we don't filter this as a duplicate connection.rollbackDuplicate(ActiveMQSession.this, md.getMessage());