causedBy(envelope: IntegrationEventEnvelope): { correlationId: string; causationId: string; }
Derives the causal metadata a consumed envelope contributes to the event its handling publishes next — the whole of the chain-root rule, extracted so no handler copies it by hand.
envelope: IntegrationEventEnvelope
The envelope being handled
Metadata shaped to spread straight into
publishIntegrationEvent: the consumed envelope's
correlationId (falling back to its own id — the chain-root rule) and
its id as the direct cause