Subscribe to MQTT messages from an AMQP client on RabbitMQ? - rabbitmq

I run a RabbitMQ node with the MQTT/WebMQTT plugins enabled.
All MQTT plugin settings use the default configuration.
Various MQTT clients are sending messages to MQTT channels.
The MQTT channel names follow the format of devices/{device_id_here}/{special_name_here}
I wish to subscribe to all MQTT messages that would match devices/#/logs in MQTT. How can I accomplish this using an AMQP client on the same broker as the MQTT users?
I am using Bunny as my (Ruby) AMQP client.

You can not use the # wildcard in the middle of a MQTT topic subscription as it is capable of matching multiple levels.
The correct wildcard is + as this only matches a single level in the topic hierarchy. E.g.
device/+/logs

Related

Connect multiple rabbitMQ to each other

I have been searching, and I couldn't find if it is possible to connect two rabbitmq instances together. I am thinking of this as an alternative to RabbitMQ Clustering feature.
My goal is that for each message that a broker receives, it routes to another broker. Does the exchange or queues in rabbitMQ allow to have this architecture?
Producer -> Broker <-> Broker -> Consumer
You can use exchange federation to publish to both the original broker and another (downstream) broker.

Is it possible to establish communication between multiple AMQP brokers

Is it possible to publish/consume messages to ActiveMQ using RabbitMQ libraries and vice versa? Both are AMQP brokers, So I want to check if this is possible or not.
I am asking this question as I have a usecase to migrate our current broker and I dont want my customer to do any changes while consuming messages. This can be any AMQP broker to any other AMQP broker communication
ActiveMQ (both the 5.x and Artemis brokers) support AMQP 1.0. Therefore, any client which communicates over the AMQP 1.0 protocol can interact with the broker regardless of what other brokers that client may be working with.

Publish/Subscribe MQTT message over RabbitMQ using pika (python client)

I have existing RabittMQ server set-up and we enabled MQTT plug-in to publish/subscribe mqtt messages.
We have pika client to process the existing queue messages . Right now , we want to use the same pika on_message() handler to process the mqtt message.
I am able to publish and subscribe mqtt message over eclipse paho client . We want to use the existing RabittMQ client(pika).
MQTT plug-in by default publish to amq.topic exchange . I want to publish the same message to my own exchange. Please let me know , how to get this.
The RabbitMQ team monitors this mailing list and only sometimes answers questions on StackOverflow.
If you want a consumer using the Pika library to receive MQTT messages that consumer must subscribe to the appropriate queue to which the MQTT messages are being published. Comprehensive documentation of how MQTT and AMQP can interoperate is available here.
You then say "I want to publish the same message to my own exchange". If you wish to use your own exchange instead of amq.topic, please see the "Custom Exchanges" section of this document. You must specify the name of the exchange in the rabbitmq.config file and create the exchange prior to publishing any messages. Note that this custom exchange must be a topic exchange.
The RabbitMQ documentation is a good resource and I suggest searching there when you have questions.

Spring+RabbitMQ make queues non durable

I am using RabbitMQ as a Stomp broker for Spring Websocket application. The client uses SockJS library to connect to the websocket interface.
Every queue created on the RabbitMQ by the Spring is durable while topics are non durable. Is there any way to make the queues non durable as well?
I do not think I can configure on the application side. I played a bit with RabbitMQ configuration but could not set it up either.
Example destination on RabbitMQ used for SUBSCRIBE and SEND:
services-user-_385b304f-7a8f-4cf4-a0f1-d6ceed6b8c92
It will be possible to specify properties for endpoints as of RabbitMQ 3.6.0 according to comment in RabbitMQ issues - https://github.com/rabbitmq/rabbitmq-stomp/issues/24#issuecomment-137896165:
as of 3.6.0, it will be possible to explicitly define properties for endpoints such as /topic/ and /queue using subscription headers: durable, auto-delete, and exclusive, respectively.
As a workaround you can try to create queues by your own using AMQP protocol and then refer to that queues from STOMP protocol.

MQTT in Producer /consumer context

we are using ActiveMQ for message Queuing with openwire transport.In this context there will be one producer and one consumer with a message listener registered. We heard about MQTT protocol and its support in activeMQ. But i saw examples only for Publisher/subscriber semantics , where subscriber need to call receive method explicitly to get the published message. Can I use mqtt with Producer/Consumer envirnment. Please give a sample..
The MQTT protocol is based a publish / subscribe based model, it has no queuing semantics built into the protocol. If you need Queue's then you need to stick to openwire clients or use a STOMP based client which supports both Topics and Queues.