core-java
core-java copied to clipboard
`recentInput()` for `ProcessManager`s and `Aggregate`s
Currently it is impossible to understand, which recent commands were handled by an Aggregate
or ProcessManager
instance. Same applies to the events, to which these entities reacted. However, this is a very helpful thing to record such interactions — not only this is another helpful thing in terms of business logic — this is also a mechanism for providing idempotence.
In scope of this request, a recentInput() : Iterable<Message>
should be implemented. It would return recent handled commands and "reacted" events in the reverse order of handling — the most recent commands/events would go first. Also, the rejected commands should be returned as well.
The limits, to which this history is kept, are still to be defined.
Also, it would be helpful to load the events, corresponding to the each input item. However, this should also be properly defined in details, that still allow high-performant execution.