Reactive Backpressure for Embedded Message Bus Congestion
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In embedded control clusters, message delivery systems face challenges with backpressure due to consumers being unable to keep up with the rate of message production, leading to consumption lag and congestion, especially in systems with limited resources where external buffering is not feasible.
Innovation Solution
A reactive backpressure mechanism is implemented in the message bus system, where the messaging server throttles message publishers and manages subscription status based on unacknowledged messages, unsubscribing clients from topics when demand falls below a threshold and re-subscribing when demand rises, to prevent congestion and ensure consumers can process messages without unnecessary polling.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If the publisher sends messages at a high rate to the subscriber, then the message delivery speed is improved, but the subscriber becomes overwhelmed and unable to process messages, causing backpressure and consumption lag
Solution Approach 1:
The system implements a feedback mechanism where the subscriber monitors its message processing capacity and sends demand signals back to the publisher. When the subscriber can keep up with messages, it signals high demand; when overwhelmed, it signals low demand. The publisher adjusts its sending rate based on this feedback, dynamically balancing delivery speed with processing reliability.
Solution Approach 2:
The message sending rate is made dynamic rather than static. The publisher continuously adjusts its publication rate based on real-time subscriber demand signals. This dynamic adjustment allows the system to adapt to changing processing capacities, maintaining high delivery speed when possible while preventing overload that would compromise reliability.
2Productivity
If the publisher sends more messages than the subscriber can process, then the message throughput is improved, but congestion and backpressure occur in the system
Solution Approach 1:
The demand signal mechanism provides continuous feedback about system congestion levels. When the subscriber accumulates unprocessed messages, it reduces its demand signal, which automatically throttles the publisher's throughput. This feedback loop prevents congestion by adjusting throughput to match actual processing capacity, eliminating backpressure while maintaining maximum sustainable productivity.
Solution Approach 2:
The system changes the parameter of message publication rate based on subscriber demand. Rather than maintaining a fixed high throughput, the publisher dynamically adjusts its publication rate parameter in response to demand signals. This parameter change allows the system to achieve high throughput when the subscriber can handle it, while preventing congestion by reducing throughput when the subscriber is overwhelmed.
3Reliability
If the system implements buffering to handle message rate differences, then the message delivery reliability is improved, but external buffering is not feasible in embedded control clusters with limited resources
Solution Approach 1:
The patent extracts the buffering function from external system resources and relocates it to the subscriber's internal processing capacity. Instead of using external buffers to absorb message rate differences, the system uses the subscriber's own processing rhythm as the buffer mechanism. This extraction eliminates the need for additional external buffering resources while maintaining delivery reliability.
Solution Approach 2:
The subscriber serves its own buffering needs by monitoring its internal processing capacity and communicating demand to the publisher. Rather than relying on external buffering infrastructure, the system uses the subscriber's self-awareness of its processing state to regulate incoming message flow. This self-service approach maintains reliability without adding external resource complexity.
Data Source
AI summary
According to certain embodiments, a message bus system comprises a first client and a second client. The first client is configured to publish messages associated with a message topic to a message bus, and the second client is configured to receive the messages associated with the message topic from the message bus. The message bus system is configured to unsubscribe the second client from the message topic based at least in part on determining that a demand of the second client for the messages associated with the message topic has fallen below a threshold.


