spring-framework / org.springframework.web.socket.sockjs.client

Package org.springframework.web.socket.sockjs.client

Types

JettyXhrTransport

open class JettyXhrTransport : AbstractXhrTransport, Lifecycle

An XHR transport based on Jetty's org.eclipse.jetty.client.HttpClient.

When used for testing purposes (e.g. load testing) the HttpClient properties must be set to allow a larger than usual number of connections and threads. For example:

 HttpClient httpClient = new HttpClient(); httpClient.setMaxConnectionsPerDestination(1000); httpClient.setExecutor(new QueuedThreadPool(500)); 

RestTemplateXhrTransport

open class RestTemplateXhrTransport : AbstractXhrTransport

An XhrTransport implementation that uses a org.springframework.web.client.RestTemplate.

SockJsClient

open class SockJsClient : WebSocketClient, Lifecycle

A SockJS implementation of org.springframework.web.socket.client.WebSocketClient with fallback alternatives that simulate a WebSocket interaction through plain HTTP streaming and long polling techniques..

Implements Lifecycle in order to propagate lifecycle events to the transports it is configured with.

SockJsUrlInfo

open class SockJsUrlInfo

Container for the base URL of a SockJS endpoint with additional helper methods to derive related SockJS URLs as the info URL and transport URLs.

Transport

interface Transport

A client-side implementation for a SockJS transport.

UndertowXhrTransport

open class UndertowXhrTransport : AbstractXhrTransport

An XHR transport based on Undertow's io.undertow.client.UndertowClient. Requires Undertow 1.3 or 1.4, including XNIO, as of Spring Framework 5.0.

When used for testing purposes (e.g. load testing) or for specific use cases (like HTTPS configuration), a custom OptionMap should be provided:

 OptionMap optionMap = OptionMap.builder() .set(Options.WORKER_IO_THREADS, 8) .set(Options.TCP_NODELAY, true) .set(Options.KEEP_ALIVE, true) .set(Options.WORKER_NAME, "SockJSClient") .getMap(); UndertowXhrTransport transport = new UndertowXhrTransport(optionMap); 

WebSocketClientSockJsSession

open class WebSocketClientSockJsSession : AbstractClientSockJsSession, NativeWebSocketSession

An extension of AbstractClientSockJsSession wrapping and delegating to an actual WebSocket session.

WebSocketTransport

open class WebSocketTransport : Transport, Lifecycle

A SockJS Transport that uses a org.springframework.web.socket.client.WebSocketClient.

XhrClientSockJsSession

open class XhrClientSockJsSession : AbstractClientSockJsSession

An extension of AbstractClientSockJsSession for use with HTTP transports simulating a WebSocket session.