TBMQ 1.3.0 release: WebSocket client, advanced MQTT 5 features, and more

We’re delighted to introduce TBMQ version 1.3.0! This update improves MQTT over WebSocket functionality by introducing a new WebSocket client. It also broadens the scope of supported MQTT 5 features. Here’s an overview of the features and updates included in this release.

WebSocket Client

We have added the new WebSocket client – a browser-accessible tool that greatly simplifies the debugging and testing of MQTT clients across various scenarios. Utilizing the MQTT over WebSocket feature, this tool offers a user-friendly interface for a range of functionalities. Key features include:

  • Multiple connections: Effortlessly manage several MQTT client connections at once.
  • Advanced connection settings and authentication: Customize your connection parameters with a range of sophisticated options, catering to diverse requirements. Select from multiple authentication options to ensure a user-friendly and secure connection experience.
  • Subscription management: Quickly add or change what topics you’re subscribed to allowing you to specify advanced MQTT options.
  • Messages and logging: Keep track of message flows and connection status logs for effective debugging and analysis.
  • Message publishing: Conveniently publish messages with the ability to customize various MQTT-related settings for tailored communication.

MQTT 5: Flow Control

This update contains the Flow Control feature, a crucial enhancement for managing the rate of message flow in MQTT communications. This feature is particularly important in scenarios where clients or brokers have limited processing capabilities or bandwidth.

How It Works: Flow Control in MQTT 5 is achieved through a key parameter: Receive Maximum. It dictates the maximum number of QoS 1 and QoS 2 messages that the client or broker is willing to process concurrently. Receive Maximum is exchanged within the CONNECT and CONNACK packets. Its default value is 65,535 based on the MQTT specification.

Why It’s Needed: Flow Control is an essential mechanism for several reasons:

  • Preventing overload: Without Flow Control, there’s a risk of overwhelming a client or broker with more messages than it can process. This can lead to system lags, or in worst-case scenarios, cause crashes or unresponsiveness, particularly in smaller, less powerful devices.
  • Ensuring reliable communication: By controlling the flow of messages, MQTT ensures that data transmission remains stable and reliable.
  • Optimizing resource use: Flow Control allows for the efficient use of system resources. It ensures that devices are not bogged down by unnecessary processing tasks, which is particularly important in systems with limited computational power.

Use Case: It can be any scenario (e.g. a smart home system or a traffic management system) where devices are constrained by processing power and cannot handle transmitting or receiving large amounts of data efficiently.

MQTT 5: Request-Response pattern

The MQTT 5 Request-Response pattern introduces a structured approach to communication, enabling devices to send requests and receive responses in a reliable and efficient manner.

How It Works: In the Request-Response pattern, a client sends a request message to a specific topic, typically indicating the action it wants to perform. This request includes essential parameters such as the Response Topic and Correlation Data. The recipient, which may be another client or application, processes the request and issues a corresponding response message directed to the specified Response Topic. This response provides the result or acknowledgment of the request. Utilizing Correlation Data, the original requester can precisely match the received response to its corresponding request, ensuring seamless bidirectional communication.

Why It’s Needed: The Request-Response pattern addresses the need for synchronous communication in IoT systems, where devices often require immediate feedback or confirmation for their actions. By establishing a structured request-response flow, MQTT 5 ensures a reliable and timely exchange of information between devices and applications.

Use Case: Consider a home automation scenario where a user wants to remotely control their smart lights. The user sends a request message to the TBMQ, specifying the action to turn on the lights. The broker transmits the request to the receiver which executes the action and sends the response message back to the user, confirming that the lights have been successfully turned on. This bidirectional communication allows for seamless interaction between the user and the smart home system, enhancing the overall user experience.

Other notable enhancements

In addition to the features highlighted earlier, this release includes several points that strengthen the system’s reliability and efficiency.

Significant enhancements have been made in backpressure management specifically for non-persistent subscribers. This improvement allows the system to handle data flow surges for these subscribers more efficiently by implementing rate limits. As a result, it ensures the system’s stability, maintaining consistent performance even under conditions of high demand.

The enhancement of the disconnect client command with Reason Codes marks a notable improvement, offering clearer insights into disconnection causes (e.g. “Session taken over”, “Administrative action”) and facilitating more targeted troubleshooting and analysis.

This version brings improvements in memory usage and overall performance. An important resolution of a direct memory leak issue leads to an optimized operational environment. This results in reduced latency and higher throughput, significantly boosting the system’s performance and robustness.