diff --git a/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java b/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java index 23c37f111b..df3bfc9802 100644 --- a/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java +++ b/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java @@ -101,15 +101,14 @@ public class MessageIdList extends Assert implements MessageListener { public void onMessage(Message message) { String id = null; try { - if (countDownLatch != null) { - countDownLatch.countDown(); - } - id = message.getJMSMessageID(); synchronized (semaphore) { messageIds.add(id); semaphore.notifyAll(); } + if (countDownLatch != null) { + countDownLatch.countDown(); + } if (LOG.isDebugEnabled()) { LOG.debug("Received message: " + message); }