{
  "id": 2924689,
  "title": "Server-Sent Events Across Multiple Pods: Redis Pub/Sub + Spring WebFlux",
  "url": "https://urgent.news/2026/08/24/server-sent-events-across-multiple-pods-redis-pub-sub-spring-webflux",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-24T02:25:05.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/anand_rathnas_d5b608cc3de/server-sent-events-across-multiple-pods-redis-pubsub-spring-webflux-g0o"
  },
  "original_language": "en",
  "account": "The article discusses implementing Server-Sent Events (SSE) across multiple pods using Redis Pub/Sub and Spring WebFlux. On a single pod, this is straightforward - a Spring WebFlux + Flux of events can handle it in just 30 lines of code. However, when dealing with multiple pods, the process becomes more complex as a write on pod A needs to reach a subscriber on pod B.\n\nThe authors outline the full pattern, starting with the SSE endpoint that emits the current unread count on subscribe and providing live updates whenever the count changes. The endpoint is defined with a GET mapping to \"/stream\" and produces text/event-stream data type. The initial emit on subscribe includes the current count, allowing clients to receive the answer immediately without a separate REST round-trip for first paint.\n\nTo keep the connection alive through any proxy/CDN idle timeout, the authors include heartbeat events every 30 seconds. They also set X-Accel-Buffering to \"no\" to prevent reverse proxies from buffering responses, which would defeat the purpose of the streaming approach.\n\nThe stream lives for 30 minutes before the server hangs up, forcing the client to reconnect with a fresh JWT. This handles mid-stream token expiry without requiring the authors to invent their own re-validation logic. The per-user sink is created lazily through the notificationEventBus.subscribe(userId) call, which returns a Flux of NotificationStreamEvent. New subscribers latch onto the same sink, and the sink is removed when the last subscriber unsubscribes.",
  "summary": "This article was originally published on Jo4 Blog . We replaced our notification-bell polling with Server-Sent Events. On a single pod, this is easy — Spring WebFlux + a Flux of events, done in 30 lines. On multiple pods, it gets interesting fast: a write that happens on pod A needs to reach a subscriber on pod B, and naively, it doesn't. Here's the full pattern: how the SSE endpoint is shaped,…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}