feat(infra): add Kafka + Schema Registry + Vault behind distributed profile#83
Conversation
…rofile Phase 1 PR #1 of the modulith-with-strict-service-boundaries rollout (ADR-010). Adds the three infrastructure services the architecture contract depends on: - Kafka (confluentinc/cp-kafka:7.7.0, KRaft mode, single broker) — cross-module event transport per ADR-013. Two listeners: PLAINTEXT on :9092 for other containers, PLAINTEXT_HOST on :29092 for processes on the host. Fixed cluster ID so KRaft metadata survives recreate. - Schema Registry (confluentinc/cp-schema-registry:7.7.0) — Avro schema evolution per ADR-019, BACKWARD-only compatibility default. - Vault (hashicorp/vault:1.18, dev mode) — secrets management surface per ADR-022. In-memory only — matches "dev convenience, prod is a separate cluster" stance in the ADR. All three live behind the Compose `distributed` profile so a default `docker compose up` stays light. Opt in with `--profile distributed`. The profile will be removed once the first module's outbox publishes to Kafka (Phase 1 PR #2 — WolverineFx.Kafka transport wiring). No application code change; no `src/` / `tests/` impact. CONTRIBUTING.md gets a short "Local dev stack" section pointing at the new services and their host ports.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds an opt-in distributed Compose profile that starts Kafka, Schema Registry, and Vault, and documents how to run the local dev stack and the distributed profile in CONTRIBUTING.md. ChangesDistributed Infrastructure Services
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docker-compose.yml`:
- Around line 98-99: Remove the unnecessary host port mapping "9092:9092" from
docker-compose.yml so only the intended host-exposed listener "29092:29092"
remains; edit the service's ports section to delete the entry matching
"9092:9092" (leaving "29092:29092") to avoid binding host port 9092 and
accidental mis-bootstrap or startup conflicts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 29dbd3d5-0c84-4c4b-a473-a1511afe4900
📒 Files selected for processing (2)
CONTRIBUTING.mddocker-compose.yml
CodeRabbit flagged that both `9092:9092` and `29092:29092` were mapped to the host even though the inline comment said `9092` was "not used from host". Two real problems: - Avoidable port-9092 collisions on dev machines (Mosquitto, jellyfin, many tools claim that port). - Mis-bootstrap risk: a process connecting to `localhost:9092` would receive `kafka:9092` as the advertised listener, which only resolves inside the Compose network. Failure mode is confusing. Keep only the `29092:29092` mapping. Inside the Compose network containers continue to reach Kafka at `kafka:9092` via the in-network listener, which is intentionally not published.
Summary
Phase 1 PR #1 of the modulith-with-strict-service-boundaries rollout (ADR-010). Adds the three infrastructure services the new architecture contract depends on, behind the Compose
distributedprofile so the default dev stack stays light.confluentinc/cp-kafka:7.7.029092(host),9092(in-network)confluentinc/cp-schema-registry:7.7.08081hashicorp/vault:1.188200Usage:
The
distributedprofile will be removed once Phase 1 PR #2 wiresWolverineFx.Kafkainto the app — at that point the services become as mandatory as Postgres.Decisions
axis-dev-root-token) — in-memory, restart wipes secrets. Acceptable for dev; production uses a separately-provisioned Vault cluster (per ADR-022).docker compose down && updoesn't blow away topics.BACKWARD-only compatibility — breaking schema changes require explicit override at publish time, matching the strict-evolution stance in ADR-019.What this PR does NOT do
WolverineFx.Kafkainto the application — that's Phase 1 PR chore: enforce test categories and git workflow rules #2.Axis.Shared.Infrastructure(PR feat: add WorkflowBuilder Minimal API endpoints #3), add OpenTelemetry (PR docs: split CLAUDE.md into focused reference files #4), or split per-module DBs (PR docs: update agent instructions #5).Requirements & rules followed
src/,tests/, orfrontend/change.docker compose confignot run locally (Docker CLI not installed on my Windows shell); CI doesn't currently validate compose either. Worst case: dev runsdocker compose --profile distributed upand sees the error./scripts/check-doc-drift.shN/A.CONTRIBUTING.mdupdated with a short "Local dev stack" section pointing at the new servicesTODO/FIXME/ placeholder / stubSummary by CodeRabbit
Documentation
Chores