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 when a request uses context-type=application/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential 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

Allows to set a timeout in millis when using Jetty as consumer (server). By default Jetty uses 30000. You can use a value of = 0 to never expire. If a timeout occurs then the request will be expired and Jetty will return back a http error 503 to the client. This option is only in use when using Jetty with the Asynchronous Routing Engine.

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 conservative default filter denying java.net. and otherwise allowing java., javax. and org.apache.camel. packages is applied.

String

camel.component.jetty.enable-jmx

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

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

This option is used to set the ErrorHandler that Jetty server uses. The option is a org.eclipse.jetty.server.handler.ErrorHandler type.

ErrorHandler

camel.component.jetty.file-size-threshold

The size threshold after which files will be written to disk for multipart/form-data requests. By default the files are not written to disk

0

Integer

camel.component.jetty.files-location

The directory location where files will be store for multipart/form-data requests. By default the files are written in the system temporary folder

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 to be used - use JettyHttpBinding instead. The option is a org.apache.camel.http.common.HttpBinding type.

HttpBinding

camel.component.jetty.http-configuration

Jetty component does not use HttpConfiguration. The option is a org.apache.camel.http.common.HttpConfiguration type.

HttpConfiguration

camel.component.jetty.keystore

Specifies the location of the Java keystore file, which contains the Jetty server’s own X.509 certificate in a key entry.

String

camel.component.jetty.max-file-size

The maximum size allowed for uploaded files. -1 means no limit

-1

Long

camel.component.jetty.max-request-size

The maximum size allowed for multipart/form-data requests. -1 means no limit

-1

Long

camel.component.jetty.max-threads

To set a value for maximum number of threads in server thread pool. Notice that both a min and max size must be configured.

Integer

camel.component.jetty.mb-container

To use a existing configured org.eclipse.jetty.jmx.MBeanContainer if JMX is enabled that Jetty uses for registering mbeans. The option is a org.eclipse.jetty.jmx.MBeanContainer type.

MBeanContainer

camel.component.jetty.min-threads

To set a value for minimum number of threads in server thread pool. Notice that both a min and max size must be configured.

Integer

camel.component.jetty.mute-exception

If enabled and an Exchange failed processing on the consumer side the response’s body won’t contain the exception’s stack trace.

true

Boolean

camel.component.jetty.proxy-host

To use a http proxy to configure the hostname.

String

camel.component.jetty.proxy-port

To use a http proxy to configure the port number.

Integer

camel.component.jetty.request-buffer-size

Allows to configure a custom value of the request buffer size on the Jetty connectors.

Integer

camel.component.jetty.request-header-size

Allows to configure a custom value of the request header size on the Jetty connectors.

Integer

camel.component.jetty.request-log

To configure Jetty request logging. The option is a org.eclipse.jetty.server.RequestLog type.

RequestLog

camel.component.jetty.response-buffer-size

Allows to configure a custom value of the response buffer size on the Jetty connectors.

Integer

camel.component.jetty.response-header-size

Allows to configure a custom value of the response header size on the Jetty connectors.

Integer

camel.component.jetty.secure-request-customizer

To use a custom SecureRequestCustomizer. The option is a org.eclipse.jetty.server.SecureRequestCustomizer type. The option is a org.eclipse.jetty.server.SecureRequestCustomizer type.

SecureRequestCustomizer

camel.component.jetty.send-server-version

If the option is true, jetty will send the server header with the jetty version information to the client which sends the request. NOTE please make sure there is no any other camel-jetty endpoint is share the same port, otherwise this option may not work as expected.

true

Boolean

camel.component.jetty.socket-connector-properties

A map which contains general HTTP connector properties. Uses the same principle as sslSocketConnectorProperties.

Object>

camel.component.jetty.socket-connectors

A map which contains per port number specific HTTP connectors. Uses the same principle as sslSocketConnectors.

ServerConnector>

camel.component.jetty.ssl-context-parameters

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

SSLContextParameters

camel.component.jetty.ssl-key-password

The key password, which is used to access the certificate’s key entry in the keystore (this is the same password that is supplied to the keystore command’s -keypass option).

String

camel.component.jetty.ssl-password

The ssl password, which is required to access the keystore file (this is the same password that is supplied to the keystore command’s -storepass option).

String

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

A map which contains general SSL connector properties.

Object>

camel.component.jetty.ssl-socket-connectors

A map which contains per port number specific SSL connectors.

ServerConnector>

camel.component.jetty.thread-pool

To use a custom thread pool for the server. This option should only be used in special circumstances. The option is a org.eclipse.jetty.util.thread.ThreadPool type.

ThreadPool

camel.component.jetty.use-continuation

Whether or not to use Jetty continuations for the Jetty Server.

true

Boolean

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

Enable usage of global SSL context parameters

false

Boolean

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

To use the X-Forwarded-For header in HttpServletRequest.getRemoteAddr.

false

Boolean