-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make UncommittedHistory
remember only successfully applied events
#1439
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1439 +/- ##
============================================
+ Coverage 91.41% 91.45% +0.03%
+ Complexity 4946 4944 -2
============================================
Files 622 622
Lines 15216 15196 -20
Branches 891 891
============================================
- Hits 13910 13897 -13
+ Misses 1001 994 -7
Partials 305 305 |
62eacbd
to
1efbae3
Compare
UncommittedHistory
contain only successfully applied events
UncommittedHistory
contain only successfully applied eventsAggregate
put only successfully applied events to UncommittedHistory
Aggregate
put only successfully applied events to UncommittedHistory
UncommittedHistory
remember only successfully applied events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yevhenii-nadtochii mostly LGTM. Please see my comments.
Also, please file an issue telling we might need a mechanism that would determine, whether the command dispatching is a "transactional" operation (meaning "all or nothing"). And describing the current state of things.
This PR addresses #1313.
The issue appears when multiple messages are dispatched from
Inbox
. Under the hood, those messages are processed as a batch, which triggersAggregate
to be cached for their processing. Going this way,Aggregate
puts applied events intoUncommittedHistory
to send them to a storage lately.Now, events emitted by a single command are put into the history only if they all were applied successfully. This behavior matches to the one of non-cached
Aggregate
.Additionally, initialization of
Delivery
was dropped out ofServerEnvironment.reset()
.Delivery
is lazily initialized the same way in its getterServerEnvironment.delivery()
.The library version is bumped to
2.0.0-SNAPSHOT.92
.