diff options
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java | 2 | ||||
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/client/MessageListenerTest.java | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java b/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java index 01bb68c23e..dfd228370c 100644 --- a/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java +++ b/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java @@ -280,7 +280,7 @@ public abstract class BasicMessageConsumer<U> extends Closeable implements Messa Object o = _synchronousQueue.poll(); while (o != null) { - messageListener.onMessage((Message) o); + notifyMessage((AbstractJMSMessage) o); o = _synchronousQueue.poll(); } } diff --git a/java/systests/src/main/java/org/apache/qpid/client/MessageListenerTest.java b/java/systests/src/main/java/org/apache/qpid/client/MessageListenerTest.java index e1c0f0ccef..4c1d5ee9c1 100644 --- a/java/systests/src/main/java/org/apache/qpid/client/MessageListenerTest.java +++ b/java/systests/src/main/java/org/apache/qpid/client/MessageListenerTest.java @@ -152,6 +152,16 @@ public class MessageListenerTest extends QpidTestCase implements MessageListener // Should have recieved all async messages assertEquals(MSG_COUNT, receivedCount); + _clientConnection.close(); + + Connection conn = getConnection("guest", "guest"); + Session clientSession = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); + Queue queue = clientSession.createQueue("message-listener-test-queue"); + MessageConsumer cons = clientSession.createConsumer(queue); + conn.start(); + + // check that the messages were actually dequeued + assertTrue(cons.receive(2000) == null); } public void onMessage(Message message) |
