Problem
Spring Modulith doesn't support the aggregation of events within temporal windows. We currently need to implement manual polling or introduce external streaming platforms (Kafka) even for simple use cases like computing metrics, tracking user journeys, or deduplicating events.
For me, the key use cases will be :
- Analytics & Real-time Metrics: Calculate orders/minute, detect trending products, identify anomalies
- Complex Pattern Detection: Track user actions in the application
- Intelligent Deduplication: Handle duplicate events within time windows
Proposed Solution
Introduce a declarative windowing system for event aggregation, aligned with event-driven philosophy:
@WindowedEventListener(??) // => specify duration and maybe an aggregator function
void onListen(List<MyEvent> events) {
// Aggregate events from the last X-minute window
}
In my opinion it would be best to start only with tumbling windows. Because it is the simplest to implement (non-overlapping, fixed-size intervals) and it covers most use cases. (After the validation of tumbling windows, the sliding windows and session windows may be added)
But, does this feature align with Spring Modulith's scope and vision? I would be happy to contribute a first prototype to demonstrate the concept if there's interest.
Thanks for the great work on the project.
Problem
Spring Modulith doesn't support the aggregation of events within temporal windows. We currently need to implement manual polling or introduce external streaming platforms (Kafka) even for simple use cases like computing metrics, tracking user journeys, or deduplicating events.
For me, the key use cases will be :
Proposed Solution
Introduce a declarative windowing system for event aggregation, aligned with event-driven philosophy:
In my opinion it would be best to start only with tumbling windows. Because it is the simplest to implement (non-overlapping, fixed-size intervals) and it covers most use cases. (After the validation of tumbling windows, the sliding windows and session windows may be added)
But, does this feature align with Spring Modulith's scope and vision? I would be happy to contribute a first prototype to demonstrate the concept if there's interest.
Thanks for the great work on the project.