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 needs | Capitan provides |
|---|---|
| Event routing | Signal as topic binding target |
| Inbound emission | Emit(ctx, signal, fields...) |
| Outbound capture | Hook(signal, callback) for publishing |
| Payload data | Event.Fields() for serialization |
| Trace propagation | Event.Context() carries trace headers |