Issue: Introdurre Event Bus per decoupling servizi
Summary
Passare da chiamate HTTP sincrone tra microservizi a un modello event-driven usando un broker (PoC su Redis Streams, con possibile evoluzione a Kafka).
Motivation / Risk
- Accoppiamento forte tra event-, social-, notification-service.
- Rischio di failure cascade e latenze elevate su chaining HTTP.
Plan
- Definire contract eventi (
EventCreated,EventUpdated,EventCancelled,UserProfileUpdated,NotificationRequested+ DLQ). - PoC: producer/consumer su Redis Streams (già presente nello stack).
- Aggiornare servizi:
- event-service emette eventi lifecycle.
- social-service e notification-service consumano.
- Logging e retry: consumer con backoff e DLQ stream.
- Metriche: esporre lag per stream e consumer group.
- Roadmap successiva: valutare Kafka se il volume cresce.
Acceptance Criteria
- Eventi pubblicati su bus per almeno
EventCreatedeEventCancelled. - social-service e notification-service reagiscono senza chiamate dirette all’event-service.
- DLQ e log errore presenti; metriche lag disponibili.
- Test end-to-end che simula creazione evento e verifica notifica/aggiornamento social.
Notes / Dependencies
- Richiede coordinamento con team Platform per provisioning e ACL Redis/Kafka.
- Richiede aggiornare gateway se alcuni workflow vengono semplificati lato API.