Skip to content

Phase 6 — Messaging & Event Contracts

🏷️ Domain Focus

Primary: 🏪 eCommerce - Order and inventory messaging
Multi-Domain Foundation: 💬 Chat, 🏭 IoT, 📱 Social, 🧠 ML/AI
Architecture Reference: Multiple domain architectures for event contracts
Protocol Focus: 📨 Kafka Events and async messaging

Epic Integration: Multi-Domain Foundation (22 Story Points - Event-Driven Architecture)

Epic Objective: Establish multi-domain architecture foundation for Chat, IoT, Social Pulse, and ML/AI domains
Success Criteria: Event-driven architecture with Kafka messaging, domain-specific service templates, event contracts following naming conventions, cross-domain communication patterns, data governance framework

Objectives

  • Establish event contracts and wire publish/consume for core flows.
  • Learning Focus: Async messaging patterns, event-driven architecture, Kafka fundamentals.

Deliverables

  • Event envelope schema and core eCommerce events
  • Order→Inventory messaging flow with idempotency
  • Multi-domain service templates and communication patterns

Tasks (acceptance)

1) Event Contracts & Messaging Protocol Lab - [ ] Envelope fields (id, type, version, ts, traceId) - [ ] Events (OrderCreated, InventoryAdjusted); CHANGELOG updated - [ ] Practice event versioning and backward compatibility - [ ] Implement event schema validation - [ ] 🏪 eCommerce Events: event-contracts/ecommerce/order/ and event-contracts/ecommerce/inventory/ - [ ] 💬 Chat Events Setup: event-contracts/chat/message/ (message.sent.v1.json) - [ ] 🏭 IoT Events Setup: event-contracts/iot/telemetry/ (telemetry.raw.v1.json) - [ ] 🧠 ML/AI Events Setup: event-contracts/ml/fraud/ (order.scored.v1.json)

2) Publish/consume implementation - [ ] OrderCreated published; Inventory consumes & adjusts stock - [ ] Retries/backoff per ADR-006; DLQ path tested - [ ] Implement exactly-once processing with idempotency keys - [ ] Add consumer group management and rebalancing handling - [ ] 🏪 eCommerce Services: order-service → inventory-service messaging

3) Messaging Lab Extensions - [ ] Test different partition strategies (round-robin vs key-based) - [ ] Implement poison message handling - [ ] Add monitoring for lag and throughput metrics 4) Docs - [ ] Create sequence diagrams for message flows - [ ] Document event contract governance process

Dependencies - Phase 5

Learning & References - Reference Topics (Protocols & Concurrency) Next Phase: Phase 7