Skip to content

Conversation

dmdashenkov
Copy link
Contributor

Previously, the CommandBus checked each command by attempting to route it with the default routing strategy — by the first field.

If a client wants to send a command and it not aware of the receiver, this approach can go wrong. For example, if the first field of a command message happens to be a repeated, the validation fails.

At the same time, command's target can override routing (e.g. a Repository) or not require one at all (e.g. AbstractCommandHandler descendants). It is not possible, however, to pass this information to the CommandBus level.

In this PR we remove this validation step.

After this change, if a command routing fails, we will still get an error and a system event. However, not the users will have more flexibility when defining command messages.

@dmdashenkov dmdashenkov self-assigned this Mar 5, 2020
@codecov
Copy link

codecov bot commented Mar 5, 2020

Codecov Report

Merging #1245 into master will increase coverage by 0.02%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #1245      +/-   ##
============================================
+ Coverage     91.14%   91.16%   +0.02%     
- Complexity     4807     4809       +2     
============================================
  Files           631      631              
  Lines         15080    15069      -11     
  Branches        848      846       -2     
============================================
- Hits          13744    13738       -6     
+ Misses         1071     1068       -3     
+ Partials        265      263       -2     

@dmdashenkov dmdashenkov requested a review from armiol March 5, 2020 15:04
@dmdashenkov
Copy link
Contributor Author

@armiol, PTAL.

Copy link
Contributor

@armiol armiol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmdashenkov LGTM, but please make sure you don't submit the same version as @dmitrykuzmin in #1246.

@dmdashenkov dmdashenkov merged commit 703433a into master Mar 5, 2020
@dmdashenkov dmdashenkov deleted the command-bus-validation branch March 5, 2020 15:52
@armiol armiol mentioned this pull request Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants