-
-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Description
When working with distributed command/event handlers in an Event Sourcing setup, Ecotone automatically forwards all message metadata into the event stream. While this is correct behaviour in terms of message propagation, it creates a performance issue in real-world systems:
Many metadata headers coming from distributed handlers are irrelevant for event-sourced aggregates.
These headers get persisted in every event, often growing event size significantly.
As a result, event replay becomes slower, especially for large aggregates, even though these metadata values are not consumed by event sourcing handlers.
In high-throughput systems this overhead accumulates quickly.
Example
Introduce a configuration option at the aggregate level (or global ES configuration) to explicitly define which metadata headers should be stored.
Example (conceptual)
#[EventSourcingAggregate(
allowedMetadata: ['providerId', 'merchantId']
)]
final class PaymentAggregate { ... }