Building the Topic Exchange tutorial with STOMP

753 views
Skip to first unread message

michael...@gmx.net

unread,
Aug 6, 2016, 7:42:16 AM8/6/16
to rabbitmq-users
I would like to study RabbitMQ STOMP plugin usage with topic exchanges, based on the tutorial code (EmitLogTopic.java and ReceiveLogsTopic.java) on the page https://www.rabbitmq.com/tutorials/tutorial-five-java.html with STOMP, so that one of the Java programs would interact with a STOMP based counterpart. Is there already a unit test or some other example code for topic exchanges with the RabbitMQ STOMP plugin, so that I can see how the destination header for the STOMP frames (SUBSCRIBE and SEND) must look like for topic exchanges?

Based in the EmitLogTopic I concluded that this would be destination value in a SEND frame to the topic_logs exchange with routing keys "kern.critical":

SEND
destination:/exchange/topic_logs/kern.critical
...

and for subscribing:

SUBSCRIBE
destination:/exchange/topic_logs/#

or

destination:/exchange/topic_logs/kern.*

or

destination:/exchange/topic_logs/*.critical

or (multiple)

destination:/exchange/topic_logs/kern.* *.critical

Greetings,
Michael Justin


Michael Klishin

unread,
Aug 6, 2016, 1:13:38 PM8/6/16
to rabbitm...@googlegroups.com
STOMP uses a topic exchange internally, amq.topic by default. Would that be
enough for your case or is your question really about using arbitrary exchanges?

Because the latter is where the abstractions STOMP is built on do not always
mix well with those of AMQP 0-9-1, see http://www.rabbitmq.com/tutorials/amqp-concepts.html.

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

michael...@gmx.net

unread,
Aug 8, 2016, 1:35:02 PM8/8/16
to rabbitmq-users
Thank you for the link!

I will read about the AMQP 0-9-1 concepts (I also have a copy of RabbitMQ in Action), and try the Java example to get some better understanding of exchange types.

My plan was to follow the description in the "Exchange Destinations" section of https://www.rabbitmq.com/stomp.html:

Any exchange/queue or exchange/routing-key combination can be accessed using destinations prefixed with /exchange.
For SUBSCRIBE frames, a destination of the form /exchange/<name>[/<pattern>] can be used. This destination:
  • creates an exclusive, auto-delete queue on <name> exchange;
  • if <pattern> is supplied, binds the queue to <name> exchange using <pattern>; and
  • registers a subscription against the queue, for the current STOMP session.
 From a STOMP or AMQP client I would then send a message to the <name> exchange and specify a routing key.


Am Samstag, 6. August 2016 19:13:38 UTC+2 schrieb Michael Klishin:
STOMP uses a topic exchange internally, amq.topic by default. Would that be
enough for your case or is your question really about using arbitrary exchanges?

Because the latter is where the abstractions STOMP is built on do not always
mix well with those of AMQP 0-9-1, see http://www.rabbitmq.com/tutorials/amqp-concepts.html.
On Sat, Aug 6, 2016 at 4:42 AM, <michael...@gmx.net> wrote:
I would like to study RabbitMQ STOMP plugin usage with topic exchanges, based on the tutorial code (EmitLogTopic.java and ReceiveLogsTopic.java) on the page https://www.rabbitmq.com/tutorials/tutorial-five-java.html with STOMP, so that one of the Java programs would interact with a STOMP based counterpart. Is there already a unit test or some other example code for topic exchanges with the RabbitMQ STOMP plugin, so that I can see how the destination header for the STOMP frames (SUBSCRIBE and SEND) must look like for topic exchanges?

Based in the EmitLogTopic I concluded that this would be destination value in a SEND frame to the topic_logs exchange with routing keys "kern.critical":

SEND
destination:/exchange/topic_logs/kern.critical
...

and for subscribing:

SUBSCRIBE
destination:/exchange/topic_logs/#

or

destination:/exchange/topic_logs/kern.*

or

destination:/exchange/topic_logs/*.critical

or (multiple)

destination:/exchange/topic_logs/kern.* *.critical

Greetings,
Michael Justin


--
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.
Reply all
Reply to author
Forward
0 new messages