Publisher Flow Control for Message Queue Overflow

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In message queue systems, publishers can overwhelm shared queues by enqueuing messages faster than consumers can consume them, leading to memory overflow and starvation of other publishers, while also risking message loss due to system failures without effective recovery mechanisms.

Innovation Solution

Implementing Publisher Flow Control to restrict publishers based on specific conditions related to their usage, such as outstanding messages and recovery times, and using Bounded Guaranteed Delivery to spill messages to permanent storage, ensuring that only necessary messages are re-enqueued during recovery, thereby preventing queue overflow and ensuring message integrity.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If publishers continuously enqueue messages without flow control, then message production speed is maximized, but queue memory overflows and other publishers are starved

Engineering Contradiction:
Improvemessage production speedVSAvoidqueue overflow prevention
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent implements publisher flow control by monitoring the number of outstanding messages (enqueued but not consumed) for each publisher. When a publisher's outstanding message count exceeds a predefined threshold, the system sends feedback to slow down or block that publisher from enqueuing more messages. This feedback mechanism prevents queue memory overflow while allowing high-speed message production when the queue has capacity.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The flow control mechanism dynamically adjusts publisher behavior based on real-time queue conditions. The system transitions publishers between different states (e.g., allowed to enqueue, throttled, or blocked) based on their outstanding message counts and the current queue state. This dynamic control enables the system to adapt to varying load conditions and prevent overflow without permanently limiting productivity.

Inventive Principle:
Principle #15Dynamics

2Productivity

If publishers continuously enqueue messages without flow control, then message production speed is maximized, but other publishers are starved of queue space

Engineering Contradiction:
Improvemessage production speedVSAvoidpublisher fairness
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The system tracks outstanding messages per publisher and provides individualized feedback control. Each publisher receives flow control decisions based on their specific message accumulation state, ensuring fair allocation of queue space. Publishers that are slowing down or blocked have their progress tracked, and they can resume when queue space becomes available, maintaining fairness among all publishers.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent applies differentiated flow control policies to different publishers based on their individual outstanding message counts. Rather than applying uniform restrictions to all publishers, the system tailors control decisions to each publisher's specific state, allowing those with fewer outstanding messages to continue producing at high speed while restricting only those approaching the threshold.

Inventive Principle:
Principle #3Local quality

3Reliability

If all messages are spilled to permanent storage for guaranteed delivery, then message reliability is maximized, but recovery time increases due to large number of messages to re-enqueue

Engineering Contradiction:
Improveguaranteed message deliveryVSAvoidrecovery time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

Instead of spilling all messages to permanent storage, the system implements a selective spill policy based on a configurable threshold (e.g., 10,000 messages). Only messages exceeding this threshold are spilled, while smaller message sets remain in volatile memory for faster access. This partial action approach maintains guaranteed delivery for critical messages while avoiding the time cost of re-enqueuing every single message during recovery.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The system changes the parameter of message storage location based on quantity and importance. Messages are kept in volatile memory when below the spill threshold for speed, and only moved to permanent storage when exceeding the threshold for reliability. During recovery, the system re-enqueues only spilled messages rather than all messages, significantly reducing recovery time while maintaining delivery guarantees for the spilled portion.

Inventive Principle:
Principle #35Parameter changes

4Reliability

If flow control restricts publisher activity, then queue overflow is prevented, but message throughput decreases

Engineering Contradiction:
Improvequeue overflow preventionVSAvoidmessage throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The flow control mechanism is dynamic rather than static. Publishers can transition between high-throughput operation and restricted states based on real-time conditions. When the queue has capacity and outstanding message counts are low, publishers operate at full throughput. When thresholds are approached, flow control activates to prevent overflow. The system continuously monitors and adjusts, allowing maximum throughput when safe and restricting only when necessary.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system applies flow control partially rather than universally. Only publishers exceeding the outstanding message threshold are restricted, while others continue at full throughput. The threshold itself can be configured to balance between overflow prevention and throughput maximization. This partial restriction minimizes the impact on overall system productivity while maintaining reliability for affected publishers.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS7818386B2Repeatable message streams for message queues in distributed systems
Publication Date: 2010.10.19 ORACLE INT CORP
  • US7818386B2 patent drawing
  • US7818386B2 patent drawing
  • US7818386B2 patent drawing

AI summary

Techniques for propagating messages in a distributed system are provided. A set of messages enqueued in a source queue are sent to one or more destination queues. An acknowledgement is received from each of the one or more destination queues, where the acknowledgement indicates which messages of the set of messages have been consumed at the particular destination queue. Based on the acknowledgements, one or more messages of the set messages are ceased to be maintained in the source queue.