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 static final Logger LOG = LoggerFactory.getLogger(ConsumerBean.class);
|
||||||
private final List<Message> messages = new ArrayList<Message>();
|
private final List<Message> messages = new ArrayList<Message>();
|
||||||
private boolean verbose;
|
private boolean verbose;
|
||||||
|
private String id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -37,6 +38,10 @@ public class ConsumerBean extends Assert implements MessageListener {
|
||||||
public ConsumerBean() {
|
public ConsumerBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConsumerBean(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return all the messages on the list so far, clearing the buffer
|
* @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) {
|
synchronized (messages) {
|
||||||
messages.add(message);
|
messages.add(message);
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
LOG.info("Received: " + message);
|
LOG.info("" + id + "Received: " + message);
|
||||||
}
|
}
|
||||||
messages.notifyAll();
|
messages.notifyAll();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue