Skip to content

Support Event Windowing for Temporal Aggregation #1555

@Killian-fal

Description

@Killian-fal

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 :

  1. Analytics & Real-time Metrics: Calculate orders/minute, detect trending products, identify anomalies
  2. Complex Pattern Detection: Track user actions in the application
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions