Skip to content

IntegrationWebSocketContainer: Make Buffer Overflow Strategy Configurable #8678

Closed
@ColoredCarrot

Description

@ColoredCarrot

Within Spring Integration's WebSocket support, ConcurrentWebSocketSessionDecorator, which buffers outbound messages if sending is slow, is used to decorate all websocket sessions in IntegrationWebSocketContainer, the standard entrypoint for using websockets with Integration.

ConcurrentWebSocketSessionDecorator provides the ability to configure three things:

The first two are also configurable in IntegrationWebSocketContainer. However, overflowStrategy is missing.

Suggestion

I'd like to be able to configure overflowStrategy in IntegrationWebSocketContainer, just like the other two options.
This should be possible via a simple setter, analogous to setSendTimeLimit and setSendBufferSizeLimit.

Context

My project's requirements allow me to drop messages if the server can't keep up (UDP-esque).
Currently, when messages aren't being flushed out fast enough, ConcurrentWebSocketSessionDecorator hits its buffer size limit and closes the websocket session.
I wish to use OverflowStrategy.DROP to circumvent this.

A workaround is increasing the buffer size limit, though this is obviously not sustainable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions