zoobzio December 8, 2025 Edit this page

herald

Bridges capitan to external message systems like Kafka, NATS, and RabbitMQ.

The Problem

Capitan coordinates events within a process. Distributed systems need events to flow across service boundaries—consuming from external topics, processing locally, and publishing results back.

The Pipeline

h := herald.New(kafkaClient)

// Inbound: external topic → capitan signal
h.Subscribe("tasks.created", TaskCreated)

// Outbound: capitan signal → external topic
h.Publish(TaskCompleted, "tasks.completed")

h.Start(ctx)
External Topic              Capitan                External Topic
      │                        │                        ▲
      │    ┌───────────┐       │                        │
      └───▶│  herald   │───▶ signal ───▶ listeners ─────┘
           │  bridge   │◀─── signal ◀─── Emit()
           └───────────┘

What Capitan Provides

herald needsCapitan provides
Event routingSignal as topic binding target
Inbound emissionEmit(ctx, signal, fields...)
Outbound captureHook(signal, callback) for publishing
Payload dataEvent.Fields() for serialization
Trace propagationEvent.Context() carries trace headers

Learn More