Camel Spring Boot

Atmosphere Websocket

Receive messages from WebSocket clients that connect to a CamelWebSocketServlet with the Atmosphere framework, and send messages to them.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-atmosphere-websocket-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 14 options, which are listed below.

Name Description Default Type

camel.component.atmosphere-websocket.allow-java-serialized-object

Whether to allow Java serialization of a message body with Content-Type application/x-java-serialized-object: a consumer deserializes such a request body and can write a Java object as such a response, and the HTTP producer deserializes such a response body. When not allowed, such a body that is received is dropped (null). This is turned off by default: if you enable it, be aware that Java deserializes the data that the other side sends, which can be a security risk.

false

Boolean

camel.component.atmosphere-websocket.attachment-multipart-binding

Whether to bind the parts of a multipart/form-data request as attachments on the Camel message, keyed by the part (form field) name and with the part headers as attachment headers. The parts are read with HttpServletRequest.getParts(), which the Servlet API allows only for a servlet with a multipart configuration (MultipartConfig, or multipart-config in web.xml), so configure one for the CamelHttpTransportServlet. Enabling it turns on disableStreamCache; an explicit disableStreamCache=false fails the endpoint creation. This is the default of the endpoints, also of the Rest DSL consumers.

false

Boolean

camel.component.atmosphere-websocket.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.atmosphere-websocket.bridge-error-handler

Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. 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.atmosphere-websocket.deserialization-filter

Sets an ObjectInputFilter pattern (jdk.serialFilter syntax) applied when deserializing Java objects from requests or responses with Content-Type application/x-java-serialized-object (only used when allowJavaSerializedObject or transferException is enabled). When not set, the JVM-wide jdk.serialFilter is used if present; otherwise a default filter is applied that rejects java.net., allows java., javax.* and org.apache.camel.*, and rejects every other class.

String

camel.component.atmosphere-websocket.enabled

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

Boolean

camel.component.atmosphere-websocket.file-name-ext-whitelist

The accepted extensions of uploaded file names, without the dot and separated by comma, such as txt,xml. A file part of a multipart request with another extension is not bound as an attachment (see attachmentMultipartBinding). The extension is all after the first dot of the submitted file name (tar.gz for report.tar.gz) and is compared ignoring case. When not set, or set to *, every file is accepted. This is the default of the endpoints, also of the Rest DSL consumers.

String

camel.component.atmosphere-websocket.header-filter-strategy

To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message. The option is a org.apache.camel.spi.HeaderFilterStrategy type.

HeaderFilterStrategy

camel.component.atmosphere-websocket.http-binding

To use a custom HttpBinding for the consumers of this component, which reads the HTTP servlet request into the Camel message and writes the Camel message to the HTTP servlet response. The HTTP producer (camel-http) does not use it. The option is a org.apache.camel.http.common.HttpBinding type.

HttpBinding

camel.component.atmosphere-websocket.http-configuration

A shared HttpConfiguration with default options for the endpoints that this component creates; an option set on the endpoint takes precedence. Only the HTTP producer (camel-http) uses it, and only its authentication options (authMethod, which must be set, with the credentials) configure the HTTP client. The consumer components ignore it. The option is a org.apache.camel.http.common.HttpConfiguration type.

HttpConfiguration

camel.component.atmosphere-websocket.http-registry

A custom org.apache.camel.http.common.HttpRegistry that connects the consumers to the CamelHttpTransportServlet instances. When not set, each consumer registers in the shared registry of its servletName, where the CamelHttpTransportServlet of that name registers itself. The option is a org.apache.camel.http.common.HttpRegistry type.

HttpRegistry

camel.component.atmosphere-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.atmosphere-websocket.mute-exception

Whether to keep the exception out of the response when an exchange fails on a consumer: the response is the 500 status code with an empty body. It is the default of the muteException option of the endpoints.

true

Boolean

camel.component.atmosphere-websocket.servlet-name

The default servletName of the endpoints: the name of the CamelHttpTransportServlet that receives the requests of the consumers, as its servlet name in the servlet container, such as the servlet-name in web.xml.

CamelServlet

String