Clarify the command request rejection callback API#151
Merged
dmitrykuzmin merged 8 commits intomasterfrom Sep 1, 2020
Merged
Conversation
Contributor
Author
|
@armiol PTAL. I couldn't come up with an obviously better term than The build will pass once core-java#1295 is merged. |
armiol
approved these changes
Sep 1, 2020
Contributor
armiol
left a comment
There was a problem hiding this comment.
@dmitrykuzmin LGTM with a single comment to address.
integration-tests/test-app/src/main/proto/spine/web/test/given/commands.proto
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #151 +/- ##
============================================
- Coverage 62.16% 61.79% -0.37%
Complexity 178 178
============================================
Files 87 88 +1
Lines 2175 2188 +13
Branches 38 40 +2
============================================
Hits 1352 1352
- Misses 814 827 +13
Partials 9 9 |
Contributor
Author
|
The missing coverage are either lines fully covered by the integration tests, or the integration tests themselves. So I'm merging the PR. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR resolves #6.
With the current imlementation, it seems that the
onRejectioncallback for a command request will be run once the command leads to a business rejection. But in reality that's not the case.The callback will be invoked if and only if the passed command cannot bypass the command bus filters due to a business rejection (created and thrown by a filter). It is a valid use-case in our system for e.g. security.
This PR thus renames the callback to
onImmediateRejectionand adjusts the corresponding doc.The "ordinary" (thrown by handler methods) rejections can be tracked using the
observe(...)method ofCommandRequest.Library version advances to
1.5.25.