Setu-TS
    Preparing search index...

    Function causedBy

    • 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.

      Parameters

      Returns { causationId: string; correlationId: string }

      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

      import { causedBy, publishIntegrationEvent } from '@setu-ts/messaging-plugin';

      await publishIntegrationEvent(runtime, broker, orderCharged, { orderId: '1' }, {
      ...causedBy(envelope),
      });

      0.6.0