Table of Contents

Interface IIntegrationEvent

Namespace
Excalibur.Dispatch
Assembly
Excalibur.Dispatch.Abstractions.dll

Marks an event as one that leaves this service: it crosses a bounded-context or system boundary and is consumed by code you do not deploy.

public interface IIntegrationEvent : IDispatchEvent, IDispatchMessage
Extension Methods

Remarks

Applying this interface is a design decision, not a routing detail, and the decision is made before the first property is added. Answer this: does the consumer need to be TOLD that something happened, or does it need the DATA? The two answers produce different events and impose different obligations, and only one of them is reversible cheaply.

  • Event notification Carry identity and nothing more: the key of the thing that changed, and enough to say what changed about it. A consumer that needs detail calls back to this service to read it. The event stays small, you keep control of what is exposed, and no consumer can come to depend on a field you never meant as a contract. You pay for that with a callback per consumer, and with consumers that cannot proceed while this service is unavailable.
  • Event-carried state transfer Carry the data the consumer needs so that it never calls back. The consumer keeps working when this service is down, and in exchange you take on three obligations. Every field you put on the event is a published contract you can no longer change freely. The copy the consumer holds is stale from the moment you send it, so it must not be treated as authoritative for a decision that requires current state. And events can arrive out of order, so the consumer needs to reject an update older than one it has already applied; give it a version or a timestamp on the event, or it has no way to tell.

Two further patterns are usually named alongside those two and are not alternatives to them. Event sourcing makes events the system of record for an aggregate, and CQRS serves reads from a model built separately from the write model; both are internal to one service, and neither is expressed by this interface. An event that is the source of truth for an aggregate is a domain event (IDomainEvent) and stays inside the boundary: publishing one directly turns your storage format into a public contract, and every later change to the aggregate becomes a breaking change for somebody else.

The shape you get by not choosing is a notification that grew one field at a time until it was carrying state, with none of the state-transfer obligations met. Choose at declaration time.

See Also