[rabbitmq-discuss] When using rabbitmq-jms javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card

Josh Carlson josh.carlson at kaazing.com
Tue Sep 17 20:21:39 BST 2013


I posted this same question on the VMWare forum: 
https://communities.vmware.com/thread/457362. I am not sure what the best 
community to use for questions. So I'm copying and pasting that question 
here. 

When using rabbitmq-jms for vFabric RabbitMQ 
javax.jms.Message.getJMSDestination does not return the actual destination 
when it is received from a consumer listening on a Topic with a wild card. 
I have tested with both 1.0.3 and 1.0.5 clients with RabbitMQ 3.1.5.

 

I was wondering if the community was aware of this problem and if there are 
any workarounds? If not what is the proper channel to file a bug report. An 
example code snippet is below. The test fails because the 
TextMessageMatcher expects the destination passed in on construction 
(second parameter) to equal the desination on the message received (aquired 
from getJMSDestination).

 

        Mockery context = new Mockery();

        final MessageListener messageListener = 
context.mock(MessageListener.class);

 

        final Latch latch = new LatchImpl();

        final String prefix = "test" + System.currentTimeMillis();

 

 

 

        context.checking(new Expectations() {

            {

                oneOf(messageListener).onMessage(with(new 
TextMessageMatcher("MSG1", prefix + ".1234")));

                will(new CustomAction("release latch") {

                    @Override

                    public Object invoke(Invocation invocation) throws 
Throwable {

                        latch.unlatch();

                        return null;

                    }

                });

            }

        });

 

        final Connection connection = createConnection(null, null);

        Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);

        connection.start();

 

        Topic wildcardTopic = (Topic) getInitialContext().lookup(prefix + 
"." + "#");

        Topic destination = (Topic) getInitialContext().lookup(prefix + 
".1234");

 

        final MessageConsumer consumer = 
session.createConsumer(wildcardTopic);

        consumer.setMessageListener(messageListener);

 

        MessageProducer producer = session.createProducer(null);

        producer.send(destination, session.createTextMessage("MSG1"));

 

        latch.await(5000);

 

 

        connection.close();

 

 

        Thread.sleep(5);

 

 

        context.assertIsSatisfied();

   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130917/f5ef5de9/attachment.htm>


More information about the rabbitmq-discuss mailing list