Class VertxWebsocketConfiguration
java.lang.Object
org.apache.camel.component.vertx.websocket.VertxWebsocketConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.vertx.core.http.HttpClientOptions
getHost()
int
getPath()
int
getPort()
int
int
io.vertx.ext.web.Router
io.vertx.core.http.HttpServerOptions
org.apache.camel.support.jsse.SSLContextParameters
To configure security using SSLContextParametersboolean
boolean
boolean
boolean
void
setAllowedOriginPattern
(String allowedOriginPattern) Regex pattern to match the origin header sent by WebSocket clientsvoid
setAllowOriginHeader
(boolean allowOriginHeader) Whether the WebSocket client should add the Origin header to the WebSocket handshake request.void
setClientOptions
(io.vertx.core.http.HttpClientOptions clientOptions) Sets customized options for configuring the WebSocket client used in the producervoid
setClientSubProtocols
(String clientSubProtocols) Comma separated list of WebSocket subprotocols that the client should use for the Sec-WebSocket-Protocol headervoid
setConsumeAsClient
(boolean consumeAsClient) When set to true, the consumer acts as a WebSocket client, creating exchanges on each received WebSocket event.void
setFireWebSocketConnectionEvents
(boolean fireWebSocketConnectionEvents) Whether the server consumer will create a message exchange when a new WebSocket peer connects or disconnectsvoid
setHandshakeHeaders
(Map<String, Object> handshakeHeaders) Headers to send in the HTTP handshake request.void
WebSocket hostname, such as localhost or a remote host when in client mode.void
setMaxReconnectAttempts
(int maxReconnectAttempts) When consumeAsClient is set to true this sets the maximum number of allowed reconnection attempts to a previously closed WebSocket.void
setOriginHeaderUrl
(String originHeaderUrl) The value of the Origin header that the WebSocket client should use on the WebSocket handshake request.void
WebSocket path to use.void
setPort
(int port) WebSocket port number to use.void
setReconnectInitialDelay
(int reconnectInitialDelay) When consumeAsClient is set to true this sets the initial delay in milliseconds before attempting to reconnect to a previously closed WebSocket.void
setReconnectInterval
(int reconnectInterval) When consumeAsClient is set to true this sets the interval in milliseconds at which reconnecting to a previously closed WebSocket occurs.void
setRouter
(io.vertx.ext.web.Router router) To use an existing vertx router for the HTTP servervoid
setSendToAll
(boolean sendToAll) To send to all websocket subscribers.void
setServerOptions
(io.vertx.core.http.HttpServerOptions serverOptions) Sets customized options for configuring the HTTP server hosting the WebSocket for the consumervoid
setSslContextParameters
(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) void
setWebsocketURI
(URI websocketURI) The WebSocket URI address to use.
-
Constructor Details
-
VertxWebsocketConfiguration
public VertxWebsocketConfiguration()
-
-
Method Details
-
setWebsocketURI
The WebSocket URI address to use. -
getWebsocketURI
-
getHost
-
setHost
WebSocket hostname, such as localhost or a remote host when in client mode. -
getPort
public int getPort() -
setPort
public void setPort(int port) WebSocket port number to use. -
getPath
-
setPath
WebSocket path to use. -
setClientOptions
public void setClientOptions(io.vertx.core.http.HttpClientOptions clientOptions) Sets customized options for configuring the WebSocket client used in the producer -
getServerOptions
public io.vertx.core.http.HttpServerOptions getServerOptions() -
setServerOptions
public void setServerOptions(io.vertx.core.http.HttpServerOptions serverOptions) Sets customized options for configuring the HTTP server hosting the WebSocket for the consumer -
isConsumeAsClient
public boolean isConsumeAsClient() -
getReconnectInitialDelay
public int getReconnectInitialDelay() -
setReconnectInitialDelay
public void setReconnectInitialDelay(int reconnectInitialDelay) When consumeAsClient is set to true this sets the initial delay in milliseconds before attempting to reconnect to a previously closed WebSocket. -
getReconnectInterval
public int getReconnectInterval() -
setReconnectInterval
public void setReconnectInterval(int reconnectInterval) When consumeAsClient is set to true this sets the interval in milliseconds at which reconnecting to a previously closed WebSocket occurs. -
getMaxReconnectAttempts
public int getMaxReconnectAttempts() -
setMaxReconnectAttempts
public void setMaxReconnectAttempts(int maxReconnectAttempts) When consumeAsClient is set to true this sets the maximum number of allowed reconnection attempts to a previously closed WebSocket. A value of 0 (the default) will attempt to reconnect indefinitely. -
setConsumeAsClient
public void setConsumeAsClient(boolean consumeAsClient) When set to true, the consumer acts as a WebSocket client, creating exchanges on each received WebSocket event. -
getClientOptions
public io.vertx.core.http.HttpClientOptions getClientOptions() -
setSendToAll
public void setSendToAll(boolean sendToAll) To send to all websocket subscribers. Can be used to configure at the endpoint level, instead of providing theVertxWebsocketConstants.SEND_TO_ALL
header on the message. Note that when using this option, the host name specified for the vertx-websocket producer URI must match one used for an existing vertx-websocket consumer. Note that this option only applies when producing messages to endpoints hosted by the vertx-websocket consumer and not to an externally hosted WebSocket. -
isSendToAll
public boolean isSendToAll() -
getSslContextParameters
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters()To configure security using SSLContextParameters -
setSslContextParameters
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) -
getAllowedOriginPattern
-
setAllowedOriginPattern
Regex pattern to match the origin header sent by WebSocket clients -
getRouter
public io.vertx.ext.web.Router getRouter() -
setRouter
public void setRouter(io.vertx.ext.web.Router router) To use an existing vertx router for the HTTP server -
setClientSubProtocols
Comma separated list of WebSocket subprotocols that the client should use for the Sec-WebSocket-Protocol header -
getClientSubProtocols
-
setFireWebSocketConnectionEvents
public void setFireWebSocketConnectionEvents(boolean fireWebSocketConnectionEvents) Whether the server consumer will create a message exchange when a new WebSocket peer connects or disconnects -
isFireWebSocketConnectionEvents
public boolean isFireWebSocketConnectionEvents() -
isAllowOriginHeader
public boolean isAllowOriginHeader() -
setAllowOriginHeader
public void setAllowOriginHeader(boolean allowOriginHeader) Whether the WebSocket client should add the Origin header to the WebSocket handshake request. -
getOriginHeaderUrl
-
setOriginHeaderUrl
The value of the Origin header that the WebSocket client should use on the WebSocket handshake request. When not specified, the WebSocket client will automatically determine the value for the Origin from the request URL. -
getHandshakeHeaders
-
setHandshakeHeaders
Headers to send in the HTTP handshake request. When the endpoint is a consumer, it only works when it consumes a remote host as a client (i.e. consumeAsClient is true).
-