core-java icon indicating copy to clipboard operation
core-java copied to clipboard

Eliminate responsibility duplication when handling a rejection

Open vlad-lubenskyi opened this issue 6 years ago • 0 comments

When a command is rejected, two mutually exclusive scenarios are possible. It is not clear, how they differ.

The scenarios are:

  1. CommandErrorHandler catches the rejection, posts it to the RejectionBus and never updates the command status. This seems to be the incorrect scenario.

  2. or CommandBus catches the rejection, posts it to the RejectionBus and does update a command status.

The first scenario happens when a command is dispatched through the EntityMessageEndpoint and the command handler generates a rejection.

The second scenario happens when:

  • a command is dispatched through the EntityMessageEndpoint but a CommandRoute generates a rejection (that is before the command handler is called);
  • a command is dispatched through any custom CommandDispatcher;

vlad-lubenskyi avatar Jun 26 '18 17:06 vlad-lubenskyi