kafka-pipeline template
Kafka source consuming orders.created, enrichment via Haiku, re-emit to orders.enriched, DLQ on orders.dlq. Declares dailyTokenUSD: 5 to exercise Phase-6 cost enforcement.
Scaffold
declaragent init --template kafka-pipeline --provider anthropic
Ships with a Redpanda docker-compose.yaml for the local dev loop.
Canonical starter: templates/kafka-pipeline/.
Run locally
cd kafka-pipeline
docker compose up -d # Redpanda single-broker
declaragent up -d # bind kafka source + start the pipeline
# produce a test event
echo '{"id":"ord_1","total":75,"items":[{"sku":"BW","name":"Blue Widget","quantity":3}],"shipTo":{"country":"US","city":"Austin","region":"TX"}}' \
| docker compose exec -T redpanda rpk topic produce orders.created
Expected flow:
- Source adapter consumes
orders.created. - Engine runs the
enrichskill. - Engine emits the enriched JSON to
orders.enriched. - On error, the message goes to
orders.dlqwith the failure metadata.
Key points
- DLQ. Every source declares its DLQ topic. See
declaragent dlq list / show / redrive. - Cost budget.
dailyTokenUSD: 5tripsEQUOTAwhen exceeded. The source pauses consumption until the next UTC rollover. - Idempotency. The payload's
$.id(viarouting.idempotencyKey.path) is the idempotency key — re-processing the same order is safe on restart.