mqtt.exchange - 1 or multiple exchanges per server/cluster?

94 views
Skip to first unread message

Petr N

unread,
Apr 27, 2022, 9:02:58 AM4/27/22
to rabbitmq-users
Hi,
I am wondering if it is possible to have on 1 server/cluster multiple MQTT exchanges specified in the rabbitmq-env.conf file?
I am trying different formats, but get no success
mqtt.exchange         = [TEST,amq.topic]
mqtt.exchange         = TEST,amq.topic
---
mqtt.exchange         = amq.topic
mqtt.exchange1         = TEST
---
If I specify either
mqtt.exchange         = amq.topic
or
mqtt.exchange        = TEST
everything works fine.

And another question related:
What makes me wonder about this is the fact, that e.g. with Java MQTT paho client I can not find any option where to specify a routing key (I just publish to an exchange, which as per above I can have only 1). So it seems to me, that if I can have only 1 Exchange and a Queue bound to it. Then basically for the MQMT protocol, all message will flow only through this 1 Exchange and Queue without any other routing possible.

Do I understand the concept correctly, or am I missing something?

Thank you very much.

Petr N

unread,
Apr 27, 2022, 10:45:38 AM4/27/22
to rabbitmq-users
After some digging I found out how it works, maybe for future reference:

Using 1 Exchange for MQTT protocol
when sending a message with paho client the first parameter is the routing key like this: iMqttClient.publish(routingKey, msg);
As usually, multiple queues may be bound to the exchange.

Dne středa 27. dubna 2022 v 15:02:58 UTC+2 uživatel Petr N napsal:
Reply all
Reply to author
Forward
0 new messages