I am interested in MQTT for it's simplicity and use case in applications like the internet of things, but I'm struggling to find any tutorials on how to have local brokers bridges to other local brokers and remote brokers. Is there a tutorial or blog post or more detailed documentation? - Will this scale to tens of thousands of local brokers bridging to a remote broker over an unreliably connection?
For example, imagine there are 3 machines:
- Raspberry Pi in charge of alarm with some motion sensors
- Linux box in charge of recording from CCTV cameras and home automation
- Central server online with a web interface.
Some example cases are:
- The Pi and Linux box message the central server that alarm is armed or motion was detected on the cameras
- The central server messages the Linux box to stop recording or the Pi to arm the alarm remotely
- The Pi messages the Linux box that alarm was armed, for the Linux box to set the thermostat to a lower settings (this needs to work even if the central server is unreachable).
How would you achieve this kind of bi-directional communication without any message loss? - Would MQTT be a good fit for this kind of application?
Right now we are using AMQP with RabbitMQ which works but seems a bit heavy. The RabbitMQ server takes up significant CPU just idling and requires Erlang to be installed which is quite a beast. What I do like about the current setup is once you set up federation between the brokers, you can subscribe to arbitrary topics and RabbitMQ handles the bridging automatically for you and ensures messages are passed to all relevant brokers that are subscribed to receive those messages (using a topic). Is something similar possible with MQTT?
Thank you in advance :)