Skip to main content

Event-Driven Local Stack

Use this when your team needs to exercise producer/consumer behavior locally with predictable startup order.

Baseline config

{
"services": {
"kafka": {
"cmd": ["kafka-server-start.sh", "./infra/kafka/server.properties"],
"port": 9092,
"ready": {"type": "tcp"}
},
"producer": {
"cmd": ["go", "run", "./cmd/producer"],
"dependsOn": ["kafka"]
},
"consumer": {
"cmd": ["go", "run", "./cmd/consumer"],
"dependsOn": ["kafka"]
}
}
}

Why it works

  • broker readiness gates both producer and consumer
  • producer and consumer are independent of each other at startup
  • runtime failures stay visible through one session log stream

Operational tips

  • keep producer and consumer in the same wave unless one truly blocks the other
  • use get_logs with service filtering for each role during incident analysis
  • keep seed/fixture publishers as kind: "oneshot" when they should exit after success

When to pick another pattern

  • if you need cluster scheduling or production-grade broker operations, this is outside FlowLayer scope
  • if infra startup is external, use Infra Bootstrap Gate

For scenario examples, see Kafka Producer Consumer.