Integration Events

An Integration Event is a message that informs components outside of the source Bounded Context that something of significance has happened. An Integration Event does NOT lead to any state changes in the source Bounded Context.

Are different from targeted consumer perspective. Integration event consumers are outside the source Bounded Context.

From content and handling perspective, they are no different than the domain events

integration-events

Asynchronous communication is preferred:

  • To achieve HIGHER levels of decoupling
  • Future extensibility i.e., add new consumers
  • Enables one-to-many

Domain/Integration event similarities

  • Both events defined as part of the model for the BC
  • Semantically same

Example

In this illustration:

  • Personal loan microservice produces events Application Receieved
  • The Domain event is consumed by the producing microservice
  • The Integration event Application Received is consumed by Complian microservice
  • The Integration event Loan Account Established is consumed by Notification service example-domain-integration-event

Domain vs Integration Events

Domain Integration
Within a BC or Microservice Between BC
State changes in BC NO state change in source BC
Direct function calls Must be a Network protocol
Synchronous calls Asynchronous preferred
Modeled as part of BC model Consumer uses Tactical pattern