Enum WebSocketFrameType
- All Implemented Interfaces:
Serializable, Comparable<WebSocketFrameType>
Defines the type of WebSocket frames to use when sending STOMP messages over WebSocket.
This configuration allows choosing between text and binary WebSocket frames for STOMP message transmission. The choice affects compatibility with different STOMP clients:
TEXT- Uses text WebSocket frames. Compatible with JavaScript STOMP clients (e.g. StompJS). This is the recommended default for most use cases as STOMP is a text-based protocol.BINARY- Uses binary WebSocket frames. This was the legacy behavior and may be needed for backward compatibility with existing applications that expect binary frames.
- Author:
- Clement Escoffier
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic WebSocketFrameTypeReturns the enum constant of this type with the specified name.static WebSocketFrameType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
TEXT
Use text WebSocket frames for STOMP messages.This is the recommended option for maximum compatibility with JavaScript STOMP clients and aligns with STOMP being a text-oriented protocol.
Note: When using text frames, STOMP message bodies containing binary data must be UTF-8 safe or should be Base64 encoded at the application level.
-
BINARY
Use binary WebSocket frames for STOMP messages.This was the legacy behavior in earlier versions. It handles any content (text or binary) but may not be compatible with some JavaScript STOMP clients that expect text frames.
Use this option for backward compatibility with existing applications.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-