A broker-less MQTT messaging bus for distributed real-time applications.
$ make
$ make run
Open console 1:
emqtt_bus:subscribe("t").
Open console 2:
emqtt_bus:publish("t", "p").
Query peers on any console:
emqtt_bus:peers().
Each MQTT bus is physically isolated in a domain, which is identified by the domain ID.
Create an MQTT bus in domain 1:
emqtt_bus:open(1).
emqtt_bus:subscribe(1, "t").
emqtt_bus:publish(1, "t", "p").
Create an MQTT bus in domain 2:
emqtt_bus:open(2).
emqtt_bus:subscribe(2, "t").
emqtt_bus:publish(2, "t", "p").
A router routes messages between different MQTT buses.
emqtt_bus_router:start_link(1, 2).
A bridge routes messages between an MQTT bus and an MQTT broker.
emqtt_bus_bridge:start_link(1, [{host, "broker.emqx.io"}]).
emqtt_bus:publish(1, "t", "d").
Use mqttx to connect to broker.emqx.io
and subscribe to the "t" topic, you will receive messages published from the MQTT bus 1.