You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mclaudio76 <cl...@limontainformatica.it> on 2014/12/30 11:24:00 UTC
[Active MQ 5.10] [Bug?] Messages aren't dequeued when wildcards
are used.
Hi there,
I need your precious help again. Scenario: I want to listen to all Advisory
topics, read messages and, at the moment, I need only to print them.
I wrote this code:
------------------------------------------------------------------
private static String ADVISORY_TOPIC = "ActiveMQ.Advisory.>";
public static void main(String[] args) throws Exception {
ActiveMQConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("tcp://server:port");
ActiveMQConnection connection = (ActiveMQConnection)
connectionFactory.createConnection();
connection.setExceptionListener(new ExceptionListener() {
@Override
public void onException(JMSException jmse) {
System.err.println(jmse);
}
});
connection.start();
Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
ActiveMQTopic advisorTopic = (ActiveMQTopic)
session.createTopic(ADVISORY_TOPIC);
MessageConsumer consumer =
session.createConsumer(advisorTopic);
consumer.setMessageListener(new MessageListener() {
@Override
public void onMessage(Message msg) {
System.out.println(msg);
}
});
}
------------------------------------------------------------------
This code works OK with respect to receiving messages: indeed I receive and
display messages from any advisory topic. The problem is that in ActiveMQ
console I do not see any message to be dequeued.
Any hints ? Is that a bug ?
Thanks in advance for your help.
--
View this message in context: http://activemq.2283324.n4.nabble.com/Active-MQ-5-10-Bug-Messages-aren-t-dequeued-when-wildcards-are-used-tp4689333.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.