Server Sent Events In a Kubernetes Cluster

2/28/2019

I have a requirement to implement Server Sent Events capability in a micro service. The application in question runs in a Kubernetes cluster of two pods. However, I don't believe Server Sent Events in a clustered environment will reliably notify all clients of events they have registered for, for the following reason. As an example, client 1 is registered for notifications with the application instance running in pod 1. Client 2 is registered for notifications with the application instance running in pod 2. The next time the event in question occurs, it is handled successfully by the application running in pod 1 (since for whatever reason that is where the load balancer directed it to). So client 1 will be notified of the event, but client 2 will not, since the application running in pod 2 has no idea of what just took place on pod 1. And so forth for subsequent events (next request might go to pod 2, for example).

So I'm thinking of moving towards using reactive streams instead.

Does anyone disagree with my take on implementing SSE's where the application will run in a clustered environment?

-- user1608142
kubernetes

0 Answers