Camel Spring Boot Starter for websocket

Spring Boot Auto-Configuration

When using websocket with Spring Boot make sure to use the following Maven dependency to have support for auto configuration:

<dependency>
  <groupId>org.apache.camel.springboot</groupId>
  <artifactId>camel-websocket-starter</artifactId>
  <version>x.x.x</version>
  <!-- use the same version as your Camel core version -->
</dependency>

The component supports 16 options, which are listed below.

Name Description Default Type

camel.component.websocket.basic-property-binding

Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities

false

Boolean

camel.component.websocket.bridge-error-handler

Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.

false

Boolean

camel.component.websocket.enable-jmx

If this option is true, Jetty JMX support will be enabled for this endpoint. See Jetty JMX support for more details.

false

Boolean

camel.component.websocket.enabled

Whether to enable auto configuration of the websocket component. This is enabled by default.

Boolean

camel.component.websocket.host

The hostname. The default value is 0.0.0.0

0.0.0.0

String

camel.component.websocket.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.websocket.max-threads

To set a value for maximum number of threads in server thread pool. MaxThreads/minThreads or threadPool fields are required due to switch to Jetty9. The default values for maxThreads is 1 2 noCores.

Integer

camel.component.websocket.min-threads

To set a value for minimum number of threads in server thread pool. MaxThreads/minThreads or threadPool fields are required due to switch to Jetty9. The default values for minThreads is 1.

Integer

camel.component.websocket.port

The port number. The default value is 9292

9292

Integer

camel.component.websocket.ssl-context-parameters

To configure security using SSLContextParameters. The option is a org.apache.camel.support.jsse.SSLContextParameters type.

String

camel.component.websocket.ssl-key-password

The password for the keystore when using SSL.

String

camel.component.websocket.ssl-keystore

The path to the keystore.

String

camel.component.websocket.ssl-password

The password when using SSL.

String

camel.component.websocket.static-resources

Set a resource path for static resources (such as .html files etc). The resources can be loaded from classpath, if you prefix with classpath:, otherwise the resources is loaded from file system or from JAR files. For example to load from root classpath use classpath:., or classpath:WEB-INF/static If not configured (eg null) then no static resource is in use.

String

camel.component.websocket.thread-pool

To use a custom thread pool for the server. MaxThreads/minThreads or threadPool fields are required due to switch to Jetty9. The option is a org.eclipse.jetty.util.thread.ThreadPool type.

String

camel.component.websocket.use-global-ssl-context-parameters

Enable usage of global SSL context parameters.

false

Boolean