Microservices can have either one type of outcome or different types of outcomes. For example:
To distinguish between outcomes, we return the OutputType
. The OutputType
is unique across a project and it allows us to identify the microservice that generated the event and the outcome type.
So for the examples, we could have the following OutputTypes
:
AddNumbers
MakePayment.success
and MakePayment.failure
When there is more than one possible OutputType
, usually only one of these will occur for a single invocation of that microservice.