Skip to content

High frequency messages are missed [4.1.1] #92

Open
@pmckenna555

Description

@pmckenna555

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions