Skip to content

Publisher Contract

The publisher contract defines the responsibilities and required behavior of a publisher component.

A publisher is responsible for delivering events to an external system.


An implementation of the publisher contract MUST:

  • accept an event for publishing
  • attempt to deliver the event to the target system
  • report the outcome of the publish attempt

The publisher MUST expose a publish operation that:

  • accepts an event
  • attempts to deliver the event to the target system
  • returns a result indicating success or failure

The publish operation MUST be treated as a single attempt.


For each publish attempt, the publisher MUST report:

  • success when the event is accepted by the target system
  • failure when the event cannot be delivered

The publisher MUST NOT perform retries internally unless explicitly documented.


  • A successful publish attempt MUST correspond to an acknowledgement from the target system
  • The definition of acknowledgement MAY vary depending on the system (e.g., broker acknowledgement, HTTP success response)

The publisher MUST clearly define what constitutes success.


The publisher MUST:

  • deliver the payload as provided by the event
  • include headers when supported by the target system

The publisher MUST NOT modify the payload.

The publisher MAY:

  • enrich or modify headers prior to publishing

If the target system supports partitioning:

  • the publisher SHOULD use partition_key when provided

If not supported:

  • the publisher MAY ignore the partition_key

The publisher does NOT guarantee ordering.

Ordering guarantees, if any, are defined by:

  • the relay
  • the target system

The publisher does NOT guarantee idempotent delivery.

If the target system supports idempotency:

  • the publisher MAY use event_id or equivalent mechanisms

On failure, the publisher SHOULD provide error information that:

  • helps diagnose the failure
  • can be recorded in last_error

Error formats are implementation-specific.


The publisher MUST be safe to use under concurrent invocation.


If the publisher supports stronger guarantees (e.g., transactional publishing):

  • such guarantees MUST be explicitly documented
  • required conditions and limitations MUST be defined

The publisher MUST NOT imply stronger guarantees unless explicitly configured.