Event Bundling in Microservice Architectures
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In event-driven architectures, the processing of line item events results in high system load due to redundant headers in event messages, leading to inefficiency and increased overhead, which can be costly and resource-intensive.
Innovation Solution
Implementing a method to bundle line item events based on event type and document identifier, where events are collected within a predefined timeframe and bundled into a single message, reducing redundant headers and metadata, and only sending the latest header state and aggregated information.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If line item events are processed individually in event-driven architecture, then event processing completeness is maintained, but system load increases and overhead increases due to redundant headers
Solution Approach 1:
Multiple line item events are merged into a single bundled event message that contains multiple individual events. The bundling mechanism combines events with similar characteristics (same document identifier, event type, and timestamp within a threshold) into one message, reducing the total number of messages sent while maintaining all individual event information through structured event lists within the bundle.
2Reliability
If line item events are sent as individual messages, then event delivery reliability is maintained, but network overhead and processing overhead increase due to redundant headers
Solution Approach 1:
Multiple individual event messages are merged into a single bundled message that contains multiple events. The bundle structure includes a header that is shared across all events in the bundle, eliminating redundant header transmissions. The event list within the bundle maintains individual event integrity through structured fields, ensuring reliable delivery while significantly reducing network overhead.
Solution Approach 2:
The bundled event message structure serves multiple functions simultaneously: it acts as a container for multiple events, provides a shared header for all events, maintains event ordering and integrity, and enables efficient processing by consumers. This multi-functionality reduces the need for separate message structures for each event.
3Productivity
If events are bundled into a single message, then system overhead is reduced, but event processing complexity increases due to bundling logic requirements
Solution Approach 1:
The bundling logic is segmented into distinct, manageable components: event filtering criteria (document identifier, event type, timestamp thresholds), event grouping mechanisms, and message construction routines. This segmentation allows each component to be optimized independently and makes the overall system more maintainable despite the added complexity of bundling operations.
Data Source
AI summary
The present disclosure involves systems, software, and computer implemented methods for bundling line item based events in an event-driven architecture. One example method includes receiving, at a message outbox of a first microservice, a new line-item based event. A determination is made as to whether a compatible open event bundle can be located. In response to locating the compatible open event bundle, the compatible open event bundle is updated to include the new line-item based event. In response to determining that the compatible open event bundle cannot be located, the compatible open event bundle is created as a new open event bundle and the new open event bundle is updated to include the new line-item based event. The compatible open event bundle is closed in response to a closing condition. A bundled event message is generated and sent to a second microservice.


