From 45321c65bd5e95bf92b1c29c072334f11ed4ca00 Mon Sep 17 00:00:00 2001 From: Ingo Weiss Date: Tue, 6 Jun 2017 16:46:58 +0100 Subject: [PATCH] [ARTEMIS-1209] JMS OpenWire client cannot read notifications from activemq.notifications topic Issue: https://issues.apache.org/jira/browse/ARTEMIS-1209 --- .../openwire/OpenWireMessageConverter.java | 5 ++++- .../openwire/SimpleOpenWireTest.java | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireMessageConverter.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireMessageConverter.java index dd7879c9b0..508bac95cd 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireMessageConverter.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireMessageConverter.java @@ -94,6 +94,8 @@ public class OpenWireMessageConverter implements MessageConverter receivedMessages = new ArrayList<>(); + subscriber.setMessageListener(receivedMessages::add); + topicConnection.start(); + + while (receivedMessages.size() == 0) { + Thread.sleep(1000); + } + + for (Message message : receivedMessages) { + assertNotNull(message); + assertNotNull(message.getStringProperty("_AMQ_NotifType")); + } + } + } + private void checkQueueEmpty(String qName) { PostOffice po = server.getPostOffice(); LocalQueueBinding binding = (LocalQueueBinding) po.getBinding(SimpleString.toSimpleString(qName));