State-Aware Microservice Message Handling via Timer-Based Routing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Stateful services in microservice architectures face challenges due to race conditions caused by the stateless nature of service instances, which can lead to inconsistencies in message processing.

Innovation Solution

A state-aware microservice system is implemented, utilizing a message broker and electronic processor to manage messages by determining consistency with the current system state, processing messages when consistent, and transferring them to a queue when inconsistent, with timers managing the time-to-live and re-routing messages to ensure proper handling.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If stateless service instances are used in microservice architecture, then service scalability and independence are improved, but message processing consistency deteriorates due to race conditions

Engineering Contradiction:
Improveservice scalabilityVSAvoidmessage processing consistency
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent introduces a message broker as an intermediary component between service instances and message queues. The message broker mediates message routing and timing, allowing stateless service instances to process messages independently while ensuring proper message delivery timing and preventing race conditions through controlled message flow management.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent implements preliminary timing actions by setting time-to-live (TTL) values and delay parameters on messages before they are processed. This preliminary timing configuration ensures that messages are processed in the correct sequence and that stateful services maintain consistency across multiple phases without requiring the service instances themselves to be stateful.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If stateful services are implemented in microservice architecture, then message processing consistency is improved, but service independence and scalability deteriorate

Engineering Contradiction:
Improvemessage processing consistencyVSAvoidservice independence
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent segments the service architecture into stateless service instances and a separate message broker infrastructure. This segmentation allows service instances to remain simple, independent, and scalable while the message broker handles the complexity of maintaining message processing consistency and timing across multiple service phases.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The message broker acts as an intermediary that manages the complexity of stateful message processing. It handles timing, sequencing, and coordination of messages across service instances, allowing the service instances themselves to remain stateless and independent while still achieving reliable message processing through the broker's mediation.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Speed

If messages are processed immediately in stateless services, then processing speed is improved, but race conditions occur leading to inconsistent state handling

Engineering Contradiction:
Improvemessage processing speedVSAvoidstate handling consistency
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The patent implements periodic action through timed message delivery and TTL-based message expiration. Messages are processed at specific time intervals rather than immediately, allowing the system to maintain fast processing speeds while ensuring that stateful operations complete their phases in the correct sequence, preventing race conditions through time-based coordination.

Inventive Principle:
Principle #19Periodic action

Data Source

PatentUS11163619B2Timer-based message handling for executing stateful services in a stateless environment
Publication Date: 2021.11.02 MOTOROLA SOLUTIONS INC
  • US11163619B2 patent drawing
  • US11163619B2 patent drawing

AI summary

A state-aware microservice system for managing messages and providing a service. The state-aware microservice system includes a plurality of instances of the service, a message broker, a memory, and an electronic processor. The processor is configured to receive, via an instance of the plurality, a message for the service and determine whether a processing of the message is consistent with a current state of the system. When the processing of the message is consistent, the processor process the message via one of the plurality of instances. When the processing of the message is not consistent, the processor transmits the message to a first queue of the message broker, determines, from a timer of the message, a time-to-live of the message, and transfers the message to a second queue of one of the plurality of instances in response to the time-to-live expiring.