This commit is contained in:
Clebert Suconic 2017-08-15 13:06:34 -04:00
commit f2f4708eba
1 changed files with 4 additions and 4 deletions

View File

@ -69,7 +69,7 @@ public class ConsumerThread extends Thread {
running = true; running = true;
QueueBrowser consumer = null; QueueBrowser consumer = null;
String threadName = Thread.currentThread().getName(); String threadName = Thread.currentThread().getName();
System.out.println(threadName + " wait until " + messageCount + " messages are consumed"); System.out.println(threadName + " trying to browse " + messageCount + " messages");
try { try {
if (filter != null) { if (filter != null) {
consumer = session.createBrowser((Queue) destination, filter); consumer = session.createBrowser((Queue) destination, filter);
@ -81,7 +81,7 @@ public class ConsumerThread extends Thread {
while (enumBrowse.hasMoreElements()) { while (enumBrowse.hasMoreElements()) {
Message msg = enumBrowse.nextElement(); Message msg = enumBrowse.nextElement();
if (msg != null) { if (msg != null) {
System.out.println(threadName + " Received " + (msg instanceof TextMessage ? ((TextMessage) msg).getText() : msg.getJMSMessageID())); System.out.println(threadName + " browsing " + (msg instanceof TextMessage ? ((TextMessage) msg).getText() : msg.getJMSMessageID()));
if (verbose) { if (verbose) {
System.out.println("..." + msg); System.out.println("..." + msg);
@ -115,7 +115,7 @@ public class ConsumerThread extends Thread {
finished.countDown(); finished.countDown();
} }
if (consumer != null) { if (consumer != null) {
System.out.println(threadName + " Consumed: " + this.getReceived() + " messages"); System.out.println(threadName + " browsed: " + this.getReceived() + " messages");
try { try {
consumer.close(); consumer.close();
} catch (JMSException e) { } catch (JMSException e) {
@ -124,7 +124,7 @@ public class ConsumerThread extends Thread {
} }
} }
System.out.println(threadName + " Consumer thread finished"); System.out.println(threadName + " Browser thread finished");
} }
public void consume() { public void consume() {