Open
Description
Hi, my SSE server emits a steady stream of events but will occasionally emit high frequency bursts. I have realised that when my SSE server emits events at a very high frequency that the SSE client misses these events.
if I put a sleep on my SSE server between each message emit then all the messages are received but I want to avoid this. Is this a bug or am I just missing a setting? I do not get any missed messages when consuming the events via a browser or terminal.
fun subscribeToStream(streamId: String?, eventHandler: TestEventHandler?) {
val streamURL = "$apiUrl/stream/$streamId"
val httpConnectStrategy = HttpConnectStrategy.http(URI.create(streamURL))
httpConnectStrategy
.readTimeout(0, TimeUnit.SECONDS)
.connectTimeout(0, TimeUnit.SECONDS) // no timeout
.writeTimeout(0, TimeUnit.SECONDS)
val builder = Builder(httpConnectStrategy)
builder.retryDelay(3, TimeUnit.SECONDS);
val backgroundEventSource = BackgroundEventSource.Builder(eventHandler, builder)
.build()
backgroundEventSource.start();
}
Metadata
Metadata
Assignees
Labels
No labels