Question about jms client - 2 bindings created

147 views
Skip to first unread message

belepou belepouk

unread,
Dec 17, 2018, 11:04:29 AM12/17/18
to rabbitmq-users
Hello,

I have a little question about the RabbitMQ Jms client.

When i create a topic and listen to it, it create a queue with 2 bindings to the exchange.
Is there a reason for that ?

what i do is : 
        // cf
        RMQConnectionFactory connectionFactory = new RMQConnectionFactory();
        connectionFactory.setUsername("xxx");
        connectionFactory.setPassword("xxx");
        connectionFactory.setVirtualHost("/");
        connectionFactory.setHost("xxx");
        connectionFactory.setPort(5672);
        // connection
        RMQConnection topicConnection = (RMQConnection) connectionFactory.createTopicConnection();
        topicConnection.start();
        // session
        TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        // Topic
        RMQDestination topic_new = (RMQDestination) session.createTopic("testTopic");
        // Sub
        RMQMessageConsumer sub = (RMQMessageConsumer) session.createSubscriber(topic_new, null, false);
        // listener
        sub.setMessageListener(message -> System.out.println("recv '" + message + "'"));


Thanks in advance,
Regards,

Arnaud Cogoluègnes

unread,
Dec 18, 2018, 4:10:41 AM12/18/18
to rabbitm...@googlegroups.com
I'm not the original author of this code, but I think only the binding
with the name of the topic is necessary, not the one with the name of
the exclusive queue. It's likely to be a bug so, I'll raise an issue.
Thanks for reporting that.
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
> To post to this group, send email to rabbitm...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Arnaud Cogoluègnes

unread,
Dec 18, 2018, 5:02:28 AM12/18/18
to rabbitm...@googlegroups.com
Follow-up issue [1] and PR [2]. A patch release should follow soon.

[1] https://github.com/rabbitmq/rabbitmq-jms-client/issues/72
[2] https://github.com/rabbitmq/rabbitmq-jms-client/pull/73

belepou belepouk

unread,
Dec 18, 2018, 6:33:16 AM12/18/18
to rabbitmq-users
Thanks for the quick reply, and the fix, 
i wanted to remove it, but wasn't sure that it was really not necessary
Reply all
Reply to author
Forward
0 new messages