diff --git a/thoth-core/src/main/java/fr/maif/eventsourcing/EventProcessorImpl.java b/thoth-core/src/main/java/fr/maif/eventsourcing/EventProcessorImpl.java index c4ad2067..896400be 100644 --- a/thoth-core/src/main/java/fr/maif/eventsourcing/EventProcessorImpl.java +++ b/thoth-core/src/main/java/fr/maif/eventsourcing/EventProcessorImpl.java @@ -99,7 +99,7 @@ public CompletionStage { - Map>> indexed = allEnvelopes.groupBy(env -> env.entityId); + Map>> indexed = allEnvelopes.groupBy(env -> commandsById.get(env.entityId).get().entityId().get()); return indexed.map(t -> { String entityId = t._1; List> eventEnvelopes = t._2;