At work we're currently building a webapp that supports SSE
.
We're all relatively new to SSE
, so we're dealing with lot's of (newbie) questions:
Disconnected connections
When a client closes his browsers we end up with a disconnected connection. Some call it ghost connections I think.
How can we detect such connections at the server side? We want to delete those clients from the notification list.
Limit amount of connections
I understood that each 'SSE-connection
' is kept alive on the application server
.
When I shut down my development server, I directly notice on the browser debugger that connection felt away.
Shouldn't we set some upper limit of connections? The application server
connections will get exhausted some time...
Additionally, some server dedicate a thread for each request. So that could lead to some thread exhausting issue...
Application or web server
Should the whole SSE-broadcasting
be managed by an application server
(where most request are business related) or should it be managed by some web server
that is fully dedicated for handling SSE-event
? At the moment, all business request and SSE-events are handled by a Jboss
application server
.
Clustered environment
How is SSE managed in a clustered environment applying an active-active mode
(=master-master) where requests are routed randomly between instances?
If you have more useful information (and caveats to look out for) please feel free to share!