# Working with more than one mqtt broker?

**URL:** <https://discourse.nodered.org/t/working-with-more-than-one-mqtt-broker/20577>\
**Category:** General\
**Created:** [19 January 2020 15:10 UTC](https://discourse.nodered.org/t/working-with-more-than-one-mqtt-broker/20577 "2020-01-19T15:10:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![klauskinski](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@klauskinski](https://discourse.nodered.org/u/klauskinski)\
**Post date:** [19 January 2020 15:10 UTC](https://discourse.nodered.org/t/working-with-more-than-one-mqtt-broker/20577/1 "2020-01-19T15:10:32Z")

</div>

Hi,

I'm using the default built-in mqtt nodes. It works great with a single mqtt broker.

However, I have different buildings and each has its own local MQTT broker. Some of the messages should replicate between different mqtt brokers. So, I generated a flow which connects to one mqtt broker as a subscriber and to another broker as a publisher. The idea was simple enough.

Well, it seems the mqtt nodes can only use one broker at a time. So, when I setup the publisher node with another broker, all mqtt nodes start to use this broker (even the one that used a correct broker as a subscriber before)...

Am I missing something? Can we call it a bug? Is there a way to setup multiple mqtt brokers?

Thanks,  
Klaus

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [19 January 2020 15:15 UTC](https://discourse.nodered.org/t/working-with-more-than-one-mqtt-broker/20577/2 "2020-01-19T15:15:40Z")

</div>

The broker field in the Mqtt nodes is a select box. The bottom entry in that list is 'add new'. Select that option then click the pencil button. That will add a new broker-configuration node.

---

<div class="post-metadata">

**Author:** ![klauskinski](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@klauskinski](https://discourse.nodered.org/u/klauskinski)\
**Post date:** [19 January 2020 15:20 UTC](https://discourse.nodered.org/t/working-with-more-than-one-mqtt-broker/20577/3 "2020-01-19T15:20:21Z")

</div>

Thanks again, knolleary....

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 January 2020 16:18 UTC](https://discourse.nodered.org/t/working-with-more-than-one-mqtt-broker/20577/4 "2020-01-19T16:18:46Z")

</div>

You can automatically bridge mqtt servers (mosquitto at least) so that specified topics are automatically propagated to other servers. It is trivial to setup.  
[http://www.steves-internet-guide.com/mosquitto-bridge-configuration/](http://www.steves-internet-guide.com/mosquitto-bridge-configuration/)

---

<div class="post-metadata">

**Author:** ![klauskinski](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@klauskinski](https://discourse.nodered.org/u/klauskinski)\
**Post date:** [19 January 2020 16:49 UTC](https://discourse.nodered.org/t/working-with-more-than-one-mqtt-broker/20577/5 "2020-01-19T16:49:14Z")

</div>

Agreed, Colin, however with Node Red I can manipulate messages while passing through...

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 January 2020 16:55 UTC](https://discourse.nodered.org/t/working-with-more-than-one-mqtt-broker/20577/6 "2020-01-19T16:55:27Z")

</div>

> [@klauskinski](#):
>
> with Node Red I can manipulate messages while passing through.

Ah well, that wasn't in the system specification you defined earlier 🙂

---

<div class="post-metadata">

**Author:** ![klauskinski](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@klauskinski](https://discourse.nodered.org/u/klauskinski)\
**Post date:** [19 January 2020 17:22 UTC](https://discourse.nodered.org/t/working-with-more-than-one-mqtt-broker/20577/7 "2020-01-19T17:22:28Z")

</div>

Indeed, my fault 😇 😇 😇 🤪 🤪 🤪
