Event Queuing System for Out-of-Order Message Reordering
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Social networking platforms face issues with event messages arriving in arbitrary order due to different routing paths, leading to misrepresentation of messaging content and negatively affecting user experience when simply processed in the order received.
Innovation Solution
An event queuing system is implemented to receive and reorder event messages based on priority rules, such as timestamp, sequence number, and message type, ensuring they are displayed in the intended order, using an API and database systems to store and update messages accurately.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If event messages are processed in the order received, then processing simplicity is improved, but message ordering accuracy deteriorates
Solution Approach 1:
The system assigns sequence numbers to event messages in advance before they are received, based on the chronological order of events. This preliminary ordering allows messages to be sorted accurately when received out of order, resolving the contradiction between simple processing and accurate ordering.
Solution Approach 2:
An event queue data structure is introduced as an intermediary between message reception and message processing. The queue maintains messages in chronological order using sequence numbers, allowing the system to process messages in the correct order without complex real-time sorting logic.
2Manufacturing precision
If event messages are reordered based on sequence numbers, then message ordering accuracy is improved, but processing complexity increases
Solution Approach 1:
Event messages carry their own sequence numbers as metadata, making them self-identifiable in terms of chronological order. The processing system simply needs to sort messages by these pre-assigned sequence numbers without requiring complex external ordering logic.
Solution Approach 2:
The system changes the parameter used for ordering from reception time to sequence number assignment time. This parameter change simplifies the ordering process because sequence numbers are assigned in strict chronological order at the source, making the sorting operation straightforward.
3Reliability
If the system waits for all event messages to arrive before processing, then message completeness is improved, but response time deteriorates
Solution Approach 1:
The system performs preliminary filtering and processing of event messages that have arrived, using their sequence numbers to determine if they can be processed independently. Messages with complete dependency chains are processed immediately, while others are held in the queue, balancing completeness and response time.
Solution Approach 2:
Instead of waiting for all messages, the system processes partial sets of messages that are ready for processing. This partial action approach allows the system to respond to available data while maintaining correctness for the subset of messages that can be safely processed.
Data Source
AI summary
Methods, systems, and computer readable medium are provided for receiving an event message in a plurality of event messages, the event message comprising a sequence number and associated data, identifying the event message as an out-of-order event message based on the sequence number, assigning a priority level to the out-of-order event message based on a plurality of priority rules, and placing the out-of-order event message in a primary queue of messages based on the priority level assigned to the event message.


