LavinMQ version 2.2.0 is here!
Announcement

LavinMQ version 2.2.0 is here!


Written by: Sofie Abrahamsson


Things have been evolving fast lately, and why stop at 2.0? Now is the time to add another highly requested feature: support for MQTT. We know what LavinMQ was capable of before, and imagine where this leads us!

The release of 2.2 comes with features that we’ve been working hard on, and we’re proud to announce that this version of LavinMQ now includes:

  • MQTT support
  • Automatic consumer offset tracking for stream queues
  • Message deduplication enhancement
  • Filtering for streams

MQTT Support

MQTT, Message Queuing Telemetry Transport, is a lightweight and efficient open standard protocol optimized for resource-limited devices and unreliable networks. Although MQTT and AMQP share many similarities, they differ in their underlying principles and some use cases.

Compared to AMQP 0.9.1, the MQTT protocol has a very simple routing mechanism. Messages are published on a topic and broadcast to all the consumers registered with the topic. No exchanges or queues are involved. From the onset, the MQTT protocol was designed to perform well in unreliable networks, such as the satellite links often used in the oil and gas industry. Traditional messaging protocols like the AMQP were too heavy for these systems’ limited bandwidth and power. Adding the MQTT support in LavinMQ means you can now use the broker in scenarios outside the usual AMQP matrix.

Simple guide about MQTT on LavinMQ

Consumer Offset Tracking

It is now possible to let LavinMQ track offsets for consumers when consuming from a stream, meaning that consumers can resume from the last processed message without manual tracking. This minimizes the risk of data loss and ensures that messages are processed exactly once.

Enabled in two different ways:

  • By setting x-stream-offset = null
  • Or by setting x-stream-automatic-offset-tracking = true

In both cases, you also need to set a consumer tag.

When setting x-stream-offset = null,the consumer will start reading the stream from the beginning at first connection. At a later reconnect, the consumer will resume automatically from where it left off. Combining the automatic tracking with all possible x-stream-offset values is possible by providing both a valid x-stream-offset and setting x-stream-automatic-offset-tracking = true. In this case, the consumer will start reading the stream from the provided x-stream-offset at the first connection. At a later reconnect, the consumer will resume automatically from where it left off.

You can disable server side tracking at any point by reconnecting your consumer and providing a valid value for x-stream-offset (and not providing x-stream-automatic-offset-tracking).

Read more about server side offset tracking.

Stream filtering

Stream filtering in LavinMQ allows consumers to receive only the necessary messages. Instead of all consumers getting every event from a stream, messages are filtered on the server side. For example, the recommendation engine can receive only search queries, while analytics can get all events. Consumers specify their filters using x-stream-filter, reducing unnecessary data transmission and improving efficiency.

Read more about stream filtering.

Message deduplication

Message deduplication prevents duplicate messages from being enqueued, reducing unnecessary processing and storage. It can be enabled at both the exchange level, where duplicates are not forwarded to queues, and the queue level, where duplicates are not stored. To activate deduplication, set the x-message-deduplication argument. This feature ensures messages are delivered only once while maintaining correct routing behavior.

Read more about message deduplication.

Help and feedback

We welcome your feedback and will happily answer any questions you may have about MQTT or usage of LavinMQ. To connect with the community directly, join our Slack channel. You can also find LavinMQ on GitHub