mirror of https://github.com/apache/activemq.git
[no jira] add identity option to consumer bean to aid logging/debugging
This commit is contained in:
parent
8e00c6c2bc
commit
770a73e9ba
|
@ -30,6 +30,7 @@ public class ConsumerBean extends Assert implements MessageListener {
|
|||
private static final Logger LOG = LoggerFactory.getLogger(ConsumerBean.class);
|
||||
private final List<Message> messages = new ArrayList<Message>();
|
||||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue