Events, Commands, and Messages
So far, the definition of an event is similar to the definition of the message pattern.1 However, the two are different. An event is a message, but a message is not necessar‐ ily an event. There are two types of messages:
![]() |
1 Hohpe, G., & Woolf, B. (2003). Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions. Boston: Addison-Wesley.
Event
A message describing a change that has already happened
Command
A message describing an operation that has to be carried out
An event is something that has already happened, whereas a command is an instruc‐ tion to do something. Both events and commands can be communicated asynchro‐ nously as messages. However, a command can be rejected: the command’s target can refuse to execute the command, for example, if the command is invalid or if it contra‐ dicts the system’s business rules. A recipient of an event, on the other hand, cannot cancel the event. The event describes something that has already happened. The only thing that can be done to overturn an event is to issue a compensating action—a command, as it’s carried out in the saga pattern.
Since an event describes something that has already happened, an event’s name should be formulated in the past tense: for example, DeliveryScheduled, Shipment‐ Completed, or DeliveryConfirmed.