Class StompServerOptions


  • public class StompServerOptions
    extends java.lang.Object
    STOMP Server options. You can also configure the Net Server used by the STOMP server from these options.
    • Field Detail

      • DEFAULT_MAX_CONNECT_FRAME_LENGTH

        public static final int DEFAULT_MAX_CONNECT_FRAME_LENGTH
        See Also:
        Constant Field Values
      • DEFAULT_MAX_HEADER_LENGTH

        public static final int DEFAULT_MAX_HEADER_LENGTH
        See Also:
        Constant Field Values
      • DEFAULT_MAX_BODY_LENGTH

        public static final int DEFAULT_MAX_BODY_LENGTH
        See Also:
        Constant Field Values
      • DEFAULT_WEBSOCKET_PATH

        public static final java.lang.String DEFAULT_WEBSOCKET_PATH
        See Also:
        Constant Field Values
      • DEFAULT_STOMP_PORT

        public static int DEFAULT_STOMP_PORT
      • DEFAULT_STOMP_HOST

        public static java.lang.String DEFAULT_STOMP_HOST
      • DEFAULT_STOMP_HEARTBEAT

        public static io.vertx.core.json.JsonObject DEFAULT_STOMP_HEARTBEAT
      • DEFAULT_TRAILING_LINE

        public static boolean DEFAULT_TRAILING_LINE
      • DEFAULT_DEBUG_ENABLED

        public static boolean DEFAULT_DEBUG_ENABLED
    • Constructor Detail

      • StompServerOptions

        public StompServerOptions()
        Default constructor.
    • Method Detail

      • getMaxConnectFrameLength

        public int getMaxConnectFrameLength()
        Gets the maximum length of the CONNECT frame that can be provided by the client
        Returns:
        the max length of the connect frame in bytes
      • setMaxConnectFrameLength

        public StompServerOptions setMaxConnectFrameLength​(int maxConnectFrameLength)
        Sets the maximum length of the CONNECT frame that can be provided by the client
        Parameters:
        maxConnectFrameLength - the max length of the connect frame in bytes
        Returns:
        the current StompServerOptions
      • getMaxBodyLength

        public int getMaxBodyLength()
        Gets the max length of the frame body accepted by the server. If a frame exceeds this size, the frame is rejected and an error is sent to the client.
        Returns:
        the max body length in bytes
      • setMaxBodyLength

        public StompServerOptions setMaxBodyLength​(int maxBodyLength)
        Sets the max body length accepted by the server. 100 Mb by default.
        Parameters:
        maxBodyLength - the length in bytes.
        Returns:
        the current StompServerOptions
      • getMaxHeaderLength

        public int getMaxHeaderLength()
        Gets the max length of header's value. If a frame has an header with a value exceeding this length, the frame is rejected and an error is sent to the client. 10240 by default.
        Returns:
        the max header length
      • setMaxHeaderLength

        public StompServerOptions setMaxHeaderLength​(int maxHeaderLength)
        Sets the max header length.
        Parameters:
        maxHeaderLength - the max length of headers
        Returns:
        the current StompServerOptions
      • getMaxHeaders

        public int getMaxHeaders()
        Gets the maximum number of headers supported by the server. If a frame exceeds the number of headers, the frame is rejected and an error is sent to the client.
        Returns:
        the max number of headers
      • setMaxHeaders

        public StompServerOptions setMaxHeaders​(int maxHeaders)
        Sets the maximum number of headers. 1000 by default.
        Parameters:
        maxHeaders - the number of headers
        Returns:
        the current StompServerOptions
      • setPort

        public StompServerOptions setPort​(int port)
        Sets the port on which the server is going to listen for connections.
        Parameters:
        port - the port number
        Returns:
        the current StompServerOptions.
      • getPort

        public int getPort()
        Returns:
        the port
      • setHost

        public StompServerOptions setHost​(java.lang.String host)
        Set the host
        Parameters:
        host - the host
        Returns:
        a reference to this, so the API can be used fluently
      • getHost

        public java.lang.String getHost()
        Returns:
        the host
      • getHeartbeat

        public io.vertx.core.json.JsonObject getHeartbeat()
        Gets the heartbeat configuration. Defaults to x: 1000, y: 1000.
        Returns:
        the heartbeat configuration.
        See Also:
        Frame.Heartbeat
      • getWebsocketPath

        public java.lang.String getWebsocketPath()
        Gets the path for the web socket. Only web sockets frame receiving on this path would be handled. By default it's DEFAULT_WEBSOCKET_PATH. The returned String is not a prefix but an exact match.
        Returns:
        the path
      • setWebsocketPath

        public StompServerOptions setWebsocketPath​(java.lang.String websocketPath)
        Sets the websocket path. Only frames received on this path would be considered as STOMP frame.
        Parameters:
        websocketPath - the path, must not be null.
        Returns:
        the current StompServerOptions
      • isTrailingLine

        public boolean isTrailingLine()
        Gets whether or not an empty line should be appended to the written STOMP frame. This option is disabled by default. This option is not compliant with the STOMP specification, and so is not documented on purpose.
        Returns:
        whether or not an empty line should be appended to the written STOMP frame.
      • setTrailingLine

        public StompServerOptions setTrailingLine​(boolean trailingLine)
        Sets whether or not an empty line should be appended to the written STOMP frame. This option is disabled by default. This option is not compliant with the STOMP specification, and so is not documented on purpose.
        Parameters:
        trailingLine - true to add an empty line, false otherwise
        Returns:
        the current StompServerOptions
      • isDebugEnabled

        public boolean isDebugEnabled()
        Gets whether or not debug is enabled. Debug tells the stomp server to provide additional information to the client. Such as stack traces upon an error. This is typically disabled in production.
        Returns:
        true if debug is enabled false if not
      • setDebugEnabled

        public StompServerOptions setDebugEnabled​(boolean debugEnabled)
        Sets if debug should be enabled or not.
        Parameters:
        debugEnabled - true to enable debug false to disable it.
        Returns:
        this