Hello,

I'm trying to use Virtual Topics for the first time (and I'm relatively new
to ActiveMQ). I've tried to follow the instructions on the virtual
destinations page and also looked at VirtualTopicPubSubTest in activemq-core
unit tests and tried to follow it as closely as I could see.  This is the
test I have:

        TopicConnection connection = createTopicConnection();
        connection.setClientID("TestClientID");
        connection.start();

        TopicSession session = connection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
        Topic topic = session.createTopic("VirtualTopic.TestTopic");

        MessageListener listener = new MessageListener() {
            @Override
            public void onMessage(Message msg) {
                try {
                    log.info("Message received: {0}",
msg.getJMSMessageID());
                } catch (JMSException e) {
                    log.error(e, "Error receiving message");
                }
            }

        };

        QueueConnection queueConnection = createQueueConnection();
        QueueSession qSession = queueConnection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);

        Queue queue = new
ActiveMQQueue("Consumer.A.VirtualTopic.TestTopic");
        MessageConsumer consumer = qSession.createConsumer(queue);
        consumer.setMessageListener(listener);

        TopicPublisher publisher = session.createPublisher(topic);
        Message message = session.createMessage();
        publisher.send(message);

This doesn't seem to work though.  The message is never received.  We are
using activemq-core 5.3.0.1-fuse.  Am I missing something as far as the
setup goes?

Note that createTopicConnection() and createQueueConnection() do nothing
special to the connection as far as setup goes, they are straight from an
ActiveMQConnectionFactory which is setup as follows:

<bean class="org.apache.activemq.ActiveMQConnectionFactory">
    <constructor-arg value="vm://localhost"/>
</bean>

(This is just one for unit-test purposes, our actual broker configuration
has more settings).

-- 
View this message in context: 
http://www.nabble.com/Cannot-receive-from-Virtual-Topic%27s-consumer-queue-tp26093937p26093937.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to