12

The EMQ (Erlang MQTT Broker) is a "distributed, massively scalable, highly extensible MQTT message broker" with a reported "1.3 million concurrent MQTT connections" - so it potentially allows a large number of clients to publish and subscribe to it. It seems likely that some clients may be disconnected at any given time.

As this question What happens if Mosquitto runs out of memory to store QoS 1/2 messages? asks about Mosquitto:

In MQTT, messages with QoS 1 or 2 must be delivered at least once (QoS 2 messages must be delivered exactly once). If the client is not connected, the broker must store the message until the client is ready to receive it.

So how does EMQ persist QoS 1/2 messages until delivery, i.e. a reboot of the broker or with respect to memory limits?

Ghanima
  • 2,539
  • 1
  • 19
  • 46

1 Answers1

6

So how does EMQ persist QoS 1/2 messages until delivery, i.e. a reboot of the broker or with respect to memory limits?

The answer seems to be: it doesn't. This issue on their bug tracker says:

I am facing the issue to store persistent client sessions after broker restart. Does this feature currently not present in the broker or I missing some configuration?

The broker will not persist sessions.

Also, after digging through a couple more issues, I found this report:

Initially I have set the max clients to 1000K in emqttd.config. Our machine has 8 GB memory with 4 core, I am able to connect 120K concurrent connection easily but when it exceeds 8 GB memory emqttd terminates itself. What I thought is set a max client per machine would be far better.

Essentially, as of v2.0.5:

  • Messages do not seem to be persisted to a file.
  • Once the broker runs out of memory, it will simply crash.

Not exactly ideal, but that seems to be the current behaviour, so if persisting messages is critical to your use-case, use a different broker.

Aurora0001
  • 18,520
  • 13
  • 55
  • 169