Camel Spring Boot

Jetty

Expose HTTP endpoints using Jetty 12.

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-jetty-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 40 options, which are listed below.

Name Description Default Type

camel.component.jetty.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.jetty.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.jetty.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.jetty.continuation-timeout

The timeout in milliseconds of the asynchronous processing of a request (Servlet AsyncContext timeout), for the endpoints that do not set continuationTimeout. When it expires, the client gets a 504 Gateway Timeout response (with the default errorHandler) and the result of the route is discarded. 0 or a negative value means no timeout. Only used when useContinuation is enabled.

30000

Long

camel.component.jetty.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.jetty.enable-jmx

Whether to register the Jetty servers as MBeans (Jetty JMX) in the MBeanServer of the CamelContext, which needs JMX to be enabled in the CamelContext. This is the default for the endpoints that do not set enableJmx.

false

Boolean

camel.component.jetty.enabled

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

Boolean

camel.component.jetty.error-handler

A custom Jetty ErrorHandler for the Jetty servers that the component creates, which writes the error responses that Jetty generates itself (for example 404 or a timeout). By default Camel uses an ErrorHandler that sends no exception details and answers 504 Gateway Timeout when the continuationTimeout expires. The option is a org.eclipse.jetty.server.handler.ErrorHandler type.

ErrorHandler

camel.component.jetty.file-size-threshold

The size in bytes above which a part of a multipart/form-data request is written to a file in filesLocation instead of kept in memory, for the endpoints that do not set fileSizeThreshold. With the default 0 every part is written to a file.

0

Integer

camel.component.jetty.files-location

The directory where the parts of multipart/form-data requests are written to, for the endpoints that do not set filesLocation. By default the temporary directory of the JVM (java.io.tmpdir).

String

camel.component.jetty.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.jetty.http-binding

Not supported on the jetty component: setting it fails with an IllegalArgumentException. Set httpBinding on the endpoint instead. The option is a org.apache.camel.http.common.HttpBinding type.

HttpBinding

camel.component.jetty.http-configuration

Not supported: the jetty component does not use the shared HttpConfiguration, and setting it fails with an IllegalArgumentException. The option is a org.apache.camel.http.common.HttpConfiguration type.

HttpConfiguration

camel.component.jetty.keystore

The path or URL of the keystore file (PKCS12 by default) that holds the X.509 certificate and private key of the Jetty server. Only used for https endpoints without SSLContextParameters; the JVM system property org.eclipse.jetty.ssl.keystore takes precedence.

String

camel.component.jetty.max-file-size

The maximum size in bytes of one part (such as an uploaded file) of a multipart/form-data request, for the endpoints that do not set maxFileSize. -1 means no limit.

-1

Long

camel.component.jetty.max-request-size

The maximum size in bytes of a multipart/form-data request, for the endpoints that do not set maxRequestSize. -1 means no limit.

-1

Long

camel.component.jetty.max-threads

The maximum number of threads of the Jetty QueuedThreadPool that the component creates for each Jetty server (one per port). When only one of minThreads and maxThreads is set, the other keeps the Jetty default (8 and 200). Cannot be combined with threadPool.

Integer

camel.component.jetty.mb-container

A custom Jetty MBeanContainer to register the MBeans of the Jetty servers with, when enableJmx is enabled. By default the component creates one for the MBeanServer of the CamelContext. The option is a org.eclipse.jetty.jmx.MBeanContainer type.

MBeanContainer

camel.component.jetty.min-threads

The minimum number of threads of the Jetty QueuedThreadPool that the component creates for each Jetty server (one per port). When only one of minThreads and maxThreads is set, the other keeps the Jetty default (8 and 200). Cannot be combined with threadPool.

Integer

camel.component.jetty.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.jetty.proxy-host

The hostname of an HTTP proxy, copied to the endpoints. Note that the jetty endpoints only consume, so they do not use a proxy.

String

camel.component.jetty.proxy-port

The port number of an HTTP proxy, copied to the endpoints together with proxyHost. Note that the jetty endpoints only consume, so they do not use a proxy.

Integer

camel.component.jetty.request-buffer-size

The size in bytes of the request buffer of the connectors. Note that the jetty component does not apply it to the connectors.

Integer

camel.component.jetty.request-header-size

The maximum size in bytes of the request line and headers of a request on the connectors that the component creates (the requestHeaderSize of the Jetty HttpConfiguration, 8192 by default). Jetty rejects a request with larger headers.

Integer

camel.component.jetty.request-log

A Jetty RequestLog (for example a CustomRequestLog) that logs the requests of the Jetty servers that the component creates. The option is a org.eclipse.jetty.server.RequestLog type.

RequestLog

camel.component.jetty.response-buffer-size

The size in bytes of the response output buffer of the connectors that the component creates (the outputBufferSize of the Jetty HttpConfiguration, 32768 by default).

Integer

camel.component.jetty.response-header-size

The maximum size in bytes of the response headers on the connectors that the component creates (the responseHeaderSize of the Jetty HttpConfiguration, 8192 by default).

Integer

camel.component.jetty.secure-request-customizer

A custom Jetty SecureRequestCustomizer for the TLS connectors that the component creates, for example to configure the SNI host check or HSTS. By default a SecureRequestCustomizer with the Jetty defaults is used. The option is a org.eclipse.jetty.server.SecureRequestCustomizer type.

SecureRequestCustomizer

camel.component.jetty.send-server-version

Whether the Jetty server sends the Server response header with the Jetty version. This is the default for the endpoints that do not set sendServerVersion. It is set on the connector of a port, so the endpoint that creates the connector decides it for all the endpoints on that port.

true

Boolean

camel.component.jetty.socket-connector-properties

Properties for the http connectors that the component creates. Note that the jetty component does not apply them to the connectors.

Object>

camel.component.jetty.socket-connectors

A map of port number to a Jetty ServerConnector, used for the http endpoints on that port instead of a connector that the component creates. The other connector options (header and buffer sizes, sendServerVersion and so on) are not applied to such a connector.

ServerConnector>

camel.component.jetty.ssl-context-parameters

The SSL/TLS configuration (SSLContextParameters) for the endpoints that do not set sslContextParameters. When set, the keystore, sslPassword and sslKeyPassword options are not used. The option is a org.apache.camel.support.jsse.SSLContextParameters type.

SSLContextParameters

camel.component.jetty.ssl-key-password

The password of the private key entry in the keystore (the -keypass of keytool), set as the key manager password of the Jetty SslContextFactory. When not set, Jetty uses the keystore password (sslPassword). Only used for https endpoints without SSLContextParameters; the JVM system property org.eclipse.jetty.ssl.keypassword takes precedence.

String

camel.component.jetty.ssl-password

The password of the keystore file (the -storepass of keytool), set as the keystore password of the Jetty SslContextFactory. Only used for https endpoints without SSLContextParameters; the JVM system property org.eclipse.jetty.ssl.password takes precedence.

String

camel.component.jetty.ssl-socket-connector-properties

Properties to set on the Jetty SslContextFactory.Server of the https connectors that the component creates, for example needClientAuth or excludeProtocols. A property that does not exist fails the creation of the connector.

Object>

camel.component.jetty.ssl-socket-connectors

A map of port number to a Jetty ServerConnector, used for the https endpoints on that port instead of a connector that the component creates. The other connector options (TLS, header and buffer sizes, sendServerVersion and so on) are not applied to such a connector.

ServerConnector>

camel.component.jetty.thread-pool

A custom Jetty ThreadPool for the Jetty servers that the component creates; the same instance is used for every server (port). Cannot be combined with minThreads or maxThreads. The option is a org.eclipse.jetty.util.thread.ThreadPool type.

ThreadPool

camel.component.jetty.use-continuation

Whether to process the requests asynchronously (Servlet async, known as Jetty continuations), so that a request that waits for an asynchronous route does not block a Jetty thread. This is the default for the endpoints that do not set useContinuation.

true

Boolean

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

Whether to use the global SSLContextParameters of the CamelContext, when neither the endpoint nor the component sets sslContextParameters.

false

Boolean

camel.component.jetty.use-x-forwarded-for-header

Whether to add the Jetty ForwardedRequestCustomizer to the connectors that the component creates, so that a request takes its client address, scheme, host and port from the Forwarded and X-Forwarded-* headers (for example X-Forwarded-For becomes HttpServletRequest.getRemoteAddr). Enable it only behind a trusted proxy, as any client can send these headers.

false

Boolean