Menu

Server-Sent Events in Spring Boot: Redis Pub/Sub and slow clients
📰

Server-Sent Events in Spring Boot: Redis Pub/Sub and slow clients

DEV Community: java·Mike Vu·17 days ago
#BiJ6dorw
#devtojava#devto#dev#send#connections
Long article (1619 words) — no AI summary yet.
Reading 0:00
15s threshold

Personal OS is a time-management app used on several devices at once: edit the schedule on a laptop and the phone should see it almost immediately. The backend is Spring Boot (Java 21), and the "real-time" part uses Server-Sent Events (SSE) with Spring MVC's SseEmitter , plus Redis Pub/Sub when running several instances.

SSE is quick to set up, but running it reliably takes attention to a few things the docs rarely mention. This post covers the design, and the first thing that breaks as connections grow. It isn't the database, and it isn't the connection pool.

Why SSE rather than WebSockets

The app only needs one direction: the server telling the client "something changed". Clients send data up through ordinary REST calls.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.