RabbitMQ - Exchage Type x-jms-topic - Problem Creating Binding - Plugin rabbitmq-jms-topic-exchange

698 views
Skip to first unread message

Artur Drummond

unread,
Sep 14, 2016, 11:26:57 AM9/14/16
to rabbitmq-users
As requested, this is the Thread to report the problem I'm facing with the plugin rabbitmq-jms-topic-exchange

  1. There are the steps to reproduce the problem:

  2. Downloaded RabbitMQ version 3.6.5

  3. Unzip it into a folder

  4. Delete the old plugin version from "rabbitmq_server-3.6.5/plugins/rabbitmq_jms_topic_exchange-3.6.5.ez"

  5. Put the new plugin "rabbitmq_jms_topic_exchange.ez" (attached) into the folder "rabbitmq_server-3.6.5/plugins/"

  6. Start the RabbitMQ server:
    rabbitmq_server-3.6.5/sbin/  ./rabbitmq-server -detached 
    Warning: PID file not written; -detached was passed

  7. Enable the rabbitmq_management plugin:

    /rabbitmq_server-3.6.5/sbin ./rabbitmq-plugins enable rabbitmq_management

    The following plugins have been enabled:

      mochiweb

      webmachine

      rabbitmq_web_dispatch

      amqp_client

      rabbitmq_management_agent

      rabbitmq_management

  8. Enable the rabbitmq_jms_topic_exchange plugin

    /rabbitmq_server-3.6.5/sbin ./rabbitmq-plugins enable rabbitmq_jms_topic_exchange

    The following plugins have been enabled:

      rabbitmq_jms_topic_exchange

  9. Download rabbitmqadmin from http://localhost:15672/cli/rabbitmqadmin

  10. Place it into /usr/local/bin

  11. Make it executable (sudo chmod +x rabbitmqadmin)

  12. Use rabbitmqadmin to create the new Exchange type topic:

    rabbitmqadmin declare exchange name=sap.topic type=topic

    exchange declared

  13. Use rabbitmqadmin to create the new Exchange type x-jms-topic

    rabbitmqadmin declare exchange name=jms.sap.topic type=x-jms-topic

    exchange declared

  14. List the Exchanges created (not necessary... just to show you that the creation of the Exchange worked)

    rabbitmqadmin list exchanges

    +--------------------+-------------+

    |        name        |    type     |

    +--------------------+-------------+

    |                    | direct      |

    | amq.direct         | direct      |

    | amq.fanout         | fanout      |

    | amq.headers        | headers     |

    | amq.match          | headers     |

    | amq.rabbitmq.log   | topic       |

    | amq.rabbitmq.trace | topic       |

    | amq.topic          | topic       |

    | jms.sap.topic      | x-jms-topic |

    | sap.topic          | topic       |

    +--------------------+-------------+

  15. Create the bind from the jms.sap.topic Exchange to sap.topic Exchange with the binding -key binding.sap.topic:

    rabbitmqadmin declare binding source="jms.sap.topic" destination_type="exchange" destination="sap.topic" routing_key="binding.sap.topic"

    Traceback (most recent call last):

      File "/usr/local/bin/rabbitmqadmin", line 1007, in <module>

        main()

      File "/usr/local/bin/rabbitmqadmin", line 413, in main

        method()

      File "/usr/local/bin/rabbitmqadmin", line 621, in invoke_declare

        self.post(uri, json.dumps(upload))

      File "/usr/local/bin/rabbitmqadmin", line 442, in post

        return self.http("POST", "%s/api%s" % (self.options.path_prefix, path), body)

      File "/usr/local/bin/rabbitmqadmin", line 504, in http

        % (resp.status, resp.reason, path, resp.read()))

    Exception: Received 500 Internal Server Error for path /api/bindings/%2F/e/jms.sap.topic/e/sap.topic

    {"error":"Internal Server Error","reason":"{error,\n    {exit,\n        {{{error,\n              {function_clause,\n                  [{erl_scan,string,\n                       [error,1,[]],\n                       [{file,\"erl_scan.erl\"},{line,152}]},\n                   {rabbit_jms_topic_exchange,decode_term,1,\n                       [{file,\"src/rabbit_jms_topic_exchange.erl\"},\n                        {line,218}]},\n                   {rabbit_jms_topic_exchange,generate_binding_fun,1,\n                       [{file,\"src/rabbit_jms_topic_exchange.erl\"},\n                        {line,202}]},\n                   {rabbit_jms_topic_exchange,add_binding,3,\n                       [{file,\"src/rabbit_jms_topic_exchange.erl\"},\n                        {line,137}]},\n                   {rabbit_binding,x_callback,4,\n                       [{file,\"src/rabbit_binding.erl\"},{line,568}]},\n                   {rabbit_binding,add,3,\n                       [{file,\"src/rabbit_binding.erl\"},{line,192}]},\n                   {mnesia_tm,apply_fun,3,[{file,\"mnesia_tm.erl\"},{line,833}]},\n                   {mnesia_tm,execute_transaction,5,\n                       [{file,\"mnesia_tm.erl\"},{line,813}]}]}},\n          [{rabbit_misc,execute_mnesia_transaction,1,\n               [{file,\"src/rabbit_misc.erl\"},{line,553}]},\n           {rabbit_misc,execute_mnesia_tx_with_tail,1,\n               [{file,\"src/rabbit_misc.erl\"},{line,575}]},\n           {rabbit_channel,binding_action,9,\n               [{file,\"src/rabbit_channel.erl\"},{line,1619}]},\n           {rabbit_channel,handle_cast,2,\n               [{file,\"src/rabbit_channel.erl\"},{line,457}]},\n           {gen_server2,handle_msg,2,\n               [{file,\"src/gen_server2.erl\"},{line,1032}]},\n           {proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,237}]}]},\n         {gen_server,call,\n             [<0.13704.0>,\n              {call,\n                  {'exchange.bind',0,<<\"sap.topic\">>,<<\"jms.sap.topic\">>,\n                      <<\"binding.sap.topic\">>,false,[]},\n                  none,<0.13678.0>},\n              infinity]}},\n        [{gen_server,call,3,[{file,\"gen_server.erl\"},{line,190}]},\n         {rabbit_mgmt_util,'-amqp_request/5-fun-0-',4,\n             [{file,\"src/rabbit_mgmt_util.erl\"},{line,585}]},\n         {rabbit_mgmt_util,with_channel,5,\n             [{file,\"src/rabbit_mgmt_util.erl\"},{line,604}]},\n         {rabbit_mgmt_wm_bindings,accept_content,2,\n             [{file,\"src/rabbit_mgmt_wm_bindings.erl\"},{line,81}]},\n         {webmachine_resource,resource_call,3,\n             [{file,\"src/webmachine_resource.erl\"},{line,186}]},\n         {webmachine_resource,do,3,\n             [{file,\"src/webmachine_resource.erl\"},{line,142}]},\n         {webmachine_decision_core,resource_call,1,\n             [{file,\"src/webmachine_decision_core.erl\"},{line,48}]},\n         {webmachine_decision_core,accept_helper,1,\n             [{file,\"src/webmachine_decision_core.erl\"},{line,612}]}]}}\n"}


  16. So I've tried to create a Queue and try to Bind the Exchange jms.sap.topic directly to the Queue. First, I'm going to create the Queue:

    rabbitmqadmin declare queue name=sap.queue durable=true

    queue declared

  17. Listing queues (not necessary... just to show you that the creation of queue worked)

    rabbitmqadmin list queues

    +-----------+----------+

    |   name    | messages |

    +-----------+----------+

    | sap.queue | 0        |

    +-----------+----------+

  18. Now I've tried to bind the Exchange jms.sap.topic to this Queue:
    rabbitmqadmin declare binding source="jms.sap.topic" destination_type="queue" destination="sap.queue" routing_key="binding.sap.queue.topic"

    Traceback (most recent call last):

      File "/usr/local/bin/rabbitmqadmin", line 1007, in <module>

        main()

      File "/usr/local/bin/rabbitmqadmin", line 413, in main

        method()

      File "/usr/local/bin/rabbitmqadmin", line 621, in invoke_declare

        self.post(uri, json.dumps(upload))

      File "/usr/local/bin/rabbitmqadmin", line 442, in post

        return self.http("POST", "%s/api%s" % (self.options.path_prefix, path), body)

      File "/usr/local/bin/rabbitmqadmin", line 504, in http

        % (resp.status, resp.reason, path, resp.read()))

    Exception: Received 500 Internal Server Error for path /api/bindings/%2F/e/jms.sap.topic/q/sap.queue

    {"error":"Internal Server Error","reason":"{error,\n    {exit,\n        {{{error,\n              {function_clause,\n                  [{erl_scan,string,\n                       [error,1,[]],\n                       [{file,\"erl_scan.erl\"},{line,152}]},\n                   {rabbit_jms_topic_exchange,decode_term,1,\n                       [{file,\"src/rabbit_jms_topic_exchange.erl\"},\n                        {line,218}]},\n                   {rabbit_jms_topic_exchange,generate_binding_fun,1,\n                       [{file,\"src/rabbit_jms_topic_exchange.erl\"},\n                        {line,202}]},\n                   {rabbit_jms_topic_exchange,add_binding,3,\n                       [{file,\"src/rabbit_jms_topic_exchange.erl\"},\n                        {line,137}]},\n                   {rabbit_binding,x_callback,4,\n                       [{file,\"src/rabbit_binding.erl\"},{line,568}]},\n                   {rabbit_binding,add,3,\n                       [{file,\"src/rabbit_binding.erl\"},{line,192}]},\n                   {mnesia_tm,apply_fun,3,[{file,\"mnesia_tm.erl\"},{line,833}]},\n                   {mnesia_tm,execute_transaction,5,\n                       [{file,\"mnesia_tm.erl\"},{line,813}]}]}},\n          [{rabbit_misc,execute_mnesia_transaction,1,\n               [{file,\"src/rabbit_misc.erl\"},{line,553}]},\n           {rabbit_misc,execute_mnesia_tx_with_tail,1,\n               [{file,\"src/rabbit_misc.erl\"},{line,575}]},\n           {rabbit_channel,binding_action,9,\n               [{file,\"src/rabbit_channel.erl\"},{line,1619}]},\n           {rabbit_channel,handle_cast,2,\n               [{file,\"src/rabbit_channel.erl\"},{line,457}]},\n           {gen_server2,handle_msg,2,\n               [{file,\"src/gen_server2.erl\"},{line,1032}]},\n           {proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,237}]}]},\n         {gen_server,call,\n             [<0.18901.0>,\n              {call,\n                  {'queue.bind',0,<<\"sap.queue\">>,<<\"jms.sap.topic\">>,\n                      <<\"binding.sap.queue.topic\">>,false,[]},\n                  none,<0.18875.0>},\n              infinity]}},\n        [{gen_server,call,3,[{file,\"gen_server.erl\"},{line,190}]},\n         {rabbit_mgmt_util,'-amqp_request/5-fun-0-',4,\n             [{file,\"src/rabbit_mgmt_util.erl\"},{line,585}]},\n         {rabbit_mgmt_util,with_channel,5,\n             [{file,\"src/rabbit_mgmt_util.erl\"},{line,604}]},\n         {rabbit_mgmt_wm_bindings,accept_content,2,\n             [{file,\"src/rabbit_mgmt_wm_bindings.erl\"},{line,81}]},\n         {webmachine_resource,resource_call,3,\n             [{file,\"src/webmachine_resource.erl\"},{line,186}]},\n         {webmachine_resource,do,3,\n             [{file,\"src/webmachine_resource.erl\"},{line,142}]},\n         {webmachine_decision_core,resource_call,1,\n             [{file,\"src/webmachine_decision_core.erl\"},{line,48}]},\n         {webmachine_decision_core,accept_helper,1,\n             [{file,\"src/webmachine_decision_core.erl\"},{line,612}]}]}}\n"}


Could you help me?
Artur Drummond



rabbitmq_jms_topic_exchange.ez

Michael Klishin

unread,
Sep 14, 2016, 5:44:12 PM9/14/16
to rabbitm...@googlegroups.com
The JMS topic exchange is built to be used with the RabbitMQ JMS client. It has certain assumptions,
namely that bindings have an optional argument that specifies what JMS selector is used.

Your `rabbitmqadmin` command does not define any additional arguments, so the exchange fails. Perhaps we
should consider a default of some kind.

What makes you believe you need to pre-declare this exchange using `rabbitmqadmin`? Have you considered
simply using the JMS API offered by the above mentioned client library?

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Alexey Ivanov

unread,
Sep 16, 2016, 7:06:59 AM9/16/16
to rabbitmq-users
Artur, any luck with bindings?

среда, 14 сентября 2016 г., 18:26:57 UTC+3 пользователь Artur Drummond написал:
As requested, this is the Thread to report the problem I'm facing with the plugin rabbitmq-jms-topic-exchange 
MESSAGE SKIPPED TO SAVE SPACE

Michael Klishin

unread,
Sep 16, 2016, 7:49:10 AM9/16/16
to rabbitm...@googlegroups.com
See my response in this very thread that explains *why* binding the way some on this list
attempt it will not work.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexey Ivanov

unread,
Sep 16, 2016, 7:59:39 AM9/16/16
to rabbitmq-users
Michael, thank you for information.
I read your explanation carefully and thought that Artur might tell me about those additional arguments he might have used and it worked. If it has worked:)

Alex

пятница, 16 сентября 2016 г., 14:49:10 UTC+3 пользователь Michael Klishin написал:
See my response in this very thread that explains *why* binding the way some on this list
attempt it will not work.
On Fri, Sep 16, 2016 at 2:06 PM, Alexey Ivanov <www.a...@gmail.com> wrote:
Artur, any luck with bindings?

среда, 14 сентября 2016 г., 18:26:57 UTC+3 пользователь Artur Drummond написал:
As requested, this is the Thread to report the problem I'm facing with the plugin rabbitmq-jms-topic-exchange 
MESSAGE SKIPPED TO SAVE SPACE
 
Could you help me?
Artur Drummond



--
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.

Michael Klishin

unread,
Sep 16, 2016, 8:26:20 AM9/16/16
to rabbitm...@googlegroups.com
Perhaps I'm missing something but what's the point of declaring jms-topic exchanges if you don't understand
how they work/used by the JMS client?

but have you considered simply using JMS' Session#createConsumer, TopicSession#createSubscriber and friends?


To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alexey Ivanov

unread,
Sep 16, 2016, 9:29:37 AM9/16/16
to rabbitmq-users
The point is to receive messages from Java applications and forward them to Python applications which will do some magic and return result.
I'm sorry in advance if I got the idea of jms-topic exchanges wrong - I'm junior developer.

пятница, 16 сентября 2016 г., 15:26:20 UTC+3 пользователь Michael Klishin написал:

Michael Klishin

unread,
Sep 16, 2016, 10:35:02 AM9/16/16
to rabbitm...@googlegroups.com
Alright, so the idea is interoperability with non-JMS exchanges. That's a reasonable
scenario.

Can you produce a small example of what kind of workload/topology you'd like to have?
Then we can suggest something specific and consider possible improvements to the JMS topic exchange.

Also keep in mind that exchange-to-exchange bindings give you a certain amount of flexibility

The problem with JMS exchanges setup partially remains even with e2e, of course.

And no worries, junior developers have one excellent thing going for them: a fresh perspective on things ;)

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alexey Ivanov

unread,
Sep 21, 2016, 10:19:28 AM9/21/16
to rabbitmq-users
Michael, thank you for all the help you've provided.
My boss decided to try ActiveMQ instead to see if it works with JMS support from the start.

пятница, 16 сентября 2016 г., 17:35:02 UTC+3 пользователь Michael Klishin написал:

Artur Drummond

unread,
Sep 21, 2016, 11:05:04 AM9/21/16
to rabbitmq-users
MK, thank you for the support.

We've decided to change the solution and we're not using RabbitMQ for JMS integration.
Reply all
Reply to author
Forward
0 new messages