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

  1. Definire contract eventi (EventCreated, EventUpdated, EventCancelled, UserProfileUpdated, NotificationRequested + DLQ).
  2. PoC: producer/consumer su Redis Streams (già presente nello stack).
  3. Aggiornare servizi:
    • event-service emette eventi lifecycle.
    • social-service e notification-service consumano.
  4. Logging e retry: consumer con backoff e DLQ stream.
  5. Metriche: esporre lag per stream e consumer group.
  6. Roadmap successiva: valutare Kafka se il volume cresce.

Acceptance Criteria

  • Eventi pubblicati su bus per almeno EventCreated e EventCancelled.
  • 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.