From 770a73e9ba3b0c8e53332438de1747f4af4b7a86 Mon Sep 17 00:00:00 2001 From: gtully Date: Wed, 29 Mar 2017 22:19:15 +0100 Subject: [PATCH] [no jira] add identity option to consumer bean to aid logging/debugging --- .../test/java/org/apache/activemq/spring/ConsumerBean.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/spring/ConsumerBean.java b/activemq-unit-tests/src/test/java/org/apache/activemq/spring/ConsumerBean.java index 40904f575e..0d941f57d2 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/spring/ConsumerBean.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/spring/ConsumerBean.java @@ -30,6 +30,7 @@ public class ConsumerBean extends Assert implements MessageListener { private static final Logger LOG = LoggerFactory.getLogger(ConsumerBean.class); private final List messages = new ArrayList(); private boolean verbose; + private String id = null; /** * Constructor. @@ -37,6 +38,10 @@ public class ConsumerBean extends Assert implements MessageListener { public ConsumerBean() { } + public ConsumerBean(String id) { + this.id = id; + } + /** * @return all the messages on the list so far, clearing the buffer */ @@ -59,7 +64,7 @@ public class ConsumerBean extends Assert implements MessageListener { synchronized (messages) { messages.add(message); if (verbose) { - LOG.info("Received: " + message); + LOG.info("" + id + "Received: " + message); } messages.notifyAll(); }