Netty4 HTTP

Netty4 HTTP

Scheme: netty4-http
Syntax: netty4-http:protocol:host:port/path
Description: Netty HTTP server and client using the Netty 4.x library.
Deprecated:false
Async:true
Maven: org.apache.camel/camel-netty4-http/2.18.1.redhat-000039

Netty HTTP server and client using the Netty 4.x library.

Name Kind Group Required Default Type Enum Description
protocol path common true java.lang.String http
https
The protocol to use which is either http or https
host path common true java.lang.String The local hostname such as localhost, or 0.0.0.0 when being a consumer. The remote HTTP server hostname when using producer.
port path common int
path path common java.lang.String Resource path
bridgeEndpoint parameter common boolean If the option is true, the producer will ignore the Exchange.HTTP_URI header, and use the endpoint's URI for request. You may also set the throwExceptionOnFailure to be false to let the producer send all the fault response back. The consumer working in the bridge mode will skip the gzip compression and WWW URL form encoding (by adding the Exchange.SKIP_GZIP_ENCODING and Exchange.SKIP_WWW_FORM_URLENCODED headers to the consumed exchange).
disconnect parameter common boolean
keepAlive parameter common true boolean
reuseAddress parameter common true boolean
sync parameter common true boolean
tcpNoDelay parameter common true boolean
bridgeErrorHandler parameter consumer boolean 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/ERROR level and ignored.
matchOnUriPrefix parameter consumer boolean Whether or not Camel should try to find a target consumer by matching the URI prefix if no exact match is found.
send503whenSuspended parameter consumer true boolean Whether to send back HTTP status code 503 when the consumer has been suspended. If the option is false then the Netty Acceptor is unbound when the consumer is suspended, so clients cannot connect anymore.
backlog parameter consumer (advanced) int
bossCount parameter consumer (advanced) 1 int
bossGroup parameter consumer (advanced) io.netty.channel.EventLoopGroup
chunkedMaxContentLength parameter consumer (advanced) 1048576 int Value in bytes the max content length per chunked frame received on the Netty HTTP server.
compression parameter consumer (advanced) boolean Allow using gzip/deflate for compression on the Netty HTTP server if the client supports it from the HTTP headers.
disconnectOnNoReply parameter consumer (advanced) true boolean
exceptionHandler parameter consumer (advanced) org.apache.camel.spi.ExceptionHandler To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN/ERROR level and ignored.
exchangePattern parameter consumer (advanced) org.apache.camel.ExchangePattern InOnly
RobustInOnly
InOut
InOptionalOut
OutOnly
RobustOutOnly
OutIn
OutOptionalIn
Sets the exchange pattern when the consumer creates an exchange.
httpMethodRestrict parameter consumer (advanced) java.lang.String To disable HTTP methods on the Netty HTTP consumer. You can specify multiple separated by comma.
mapHeaders parameter consumer (advanced) true boolean If this option is enabled, then during binding from Netty to Camel Message then the headers will be mapped as well (eg added as header to the Camel Message as well). You can turn off this option to disable this. The headers can still be accessed from the org.apache.camel.component.netty.http.NettyHttpMessage message with the method getHttpRequest() that returns the Netty HTTP request io.netty.handler.codec.http.HttpRequest instance.
maxHeaderSize parameter consumer (advanced) 8192 int The maximum length of all headers. If the sum of the length of each header exceeds this value, a {@link io.netty.handler.codec.TooLongFrameException} will be raised.
nettyServerBootstrapFactory parameter consumer (advanced) org.apache.camel.component.netty4.NettyServerBootstrapFactory
nettySharedHttpServer parameter consumer (advanced) org.apache.camel.component.netty4.http.NettySharedHttpServer To use a shared Netty HTTP server. See Netty HTTP Server Example for more details.
noReplyLogLevel parameter consumer (advanced) WARN org.apache.camel.LoggingLevel TRACE
DEBUG
INFO
WARN
ERROR
OFF
serverClosedChannelExceptionCaughtLogLevel parameter consumer (advanced) DEBUG org.apache.camel.LoggingLevel TRACE
DEBUG
INFO
WARN
ERROR
OFF
serverExceptionCaughtLogLevel parameter consumer (advanced) WARN org.apache.camel.LoggingLevel TRACE
DEBUG
INFO
WARN
ERROR
OFF
serverInitializerFactory parameter consumer (advanced) org.apache.camel.component.netty4.ServerInitializerFactory
traceEnabled parameter consumer (advanced) boolean Specifies whether to enable HTTP TRACE for this Netty HTTP consumer. By default TRACE is turned off.
urlDecodeHeaders parameter consumer (advanced) boolean If this option is enabled, then during binding from Netty to Camel Message then the header values will be URL decoded (eg %20 will be a space character. Notice this option is used by the default org.apache.camel.component.netty.http.NettyHttpBinding and therefore if you implement a custom org.apache.camel.component.netty4.http.NettyHttpBinding then you would need to decode the headers accordingly to this option.
usingExecutorService parameter consumer (advanced) true boolean
workerCount parameter consumer (advanced) int
workerGroup parameter consumer (advanced) io.netty.channel.EventLoopGroup
connectTimeout parameter producer 10000 int
requestTimeout parameter producer long
reuseChannel parameter producer boolean
throwExceptionOnFailure parameter producer true boolean Option to disable throwing the HttpOperationFailedException in case of failed responses from the remote server. This allows you to get all responses regardless of the HTTP status code.
clientInitializerFactory parameter producer (advanced) org.apache.camel.component.netty4.ClientInitializerFactory
lazyChannelCreation parameter producer (advanced) true boolean
okStatusCodeRange parameter producer (advanced) 200-299 java.lang.String The status codes which is considered a success response. The values are inclusive. The range must be defined as from-to with the dash included.

The default range is 200-299

producerPoolEnabled parameter producer (advanced) true boolean
producerPoolMaxActive parameter producer (advanced) -1 int
producerPoolMaxIdle parameter producer (advanced) 100 int
producerPoolMinEvictableIdle parameter producer (advanced) 300000 long
producerPoolMinIdle parameter producer (advanced) int
useRelativePath parameter producer (advanced) boolean Sets whether to use a relative path in HTTP requests.
allowSerializedHeaders parameter advanced false boolean
bootstrapConfiguration parameter advanced org.apache.camel.component.netty4.NettyServerBootstrapConfiguration To use a custom configured NettyServerBootstrapConfiguration for configuring this endpoint.
channelGroup parameter advanced io.netty.channel.group.ChannelGroup
configuration parameter advanced org.apache.camel.component.netty4.http.NettyHttpConfiguration To use a custom configured NettyHttpConfiguration for configuring this endpoint.
disableStreamCache parameter advanced boolean Determines whether or not the raw input stream from Netty HttpRequest#getContent() or HttpResponset#getContent() is cached or not (Camel will read the stream into a in light-weight memory based Stream caching) cache. By default Camel will cache the Netty input stream to support reading it multiple times to ensure it Camel can retrieve all data from the stream. However you can set this option to true when you for example need to access the raw stream, such as streaming it directly to a file or other persistent store. Mind that if you enable this option, then you cannot read the Netty stream multiple times out of the box, and you would need manually to reset the reader index on the Netty raw stream. Also Netty will auto-close the Netty stream when the Netty HTTP server/HTTP client is done processing, which means that if the asynchronous routing engine is in use then any asynchronous thread that may continue routing the {@link org.apache.camel.Exchange} may not be able to read the Netty stream, because Netty has closed it.
headerFilterStrategy parameter advanced org.apache.camel.spi.HeaderFilterStrategy To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter headers.
nativeTransport parameter advanced boolean
nettyHttpBinding parameter advanced org.apache.camel.component.netty4.http.NettyHttpBinding To use a custom org.apache.camel.component.netty4.http.NettyHttpBinding for binding to/from Netty and Camel Message API.
options parameter advanced java.util.Map
receiveBufferSize parameter advanced 65536 int
receiveBufferSizePredictor parameter advanced int
sendBufferSize parameter advanced 65536 int
synchronous parameter advanced false boolean Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).
transferException parameter advanced boolean If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back serialized in the response as a application/x-java-serialized-object content type. On the producer side the exception will be deserialized and thrown as is, instead of the HttpOperationFailedException. The caused exception is required to be serialized.

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.

transferExchange parameter advanced boolean
decoder parameter codec io.netty.channel.ChannelHandler To use a single decoder. This options is deprecated use encoders instead.
decoders parameter codec java.lang.String
encoder parameter codec io.netty.channel.ChannelHandler To use a single encoder. This options is deprecated use encoders instead.
encoders parameter codec java.lang.String
enabledProtocols parameter security TLSv1,TLSv1.1,TLSv1.2 java.lang.String
keyStoreFile parameter security java.io.File
keyStoreFormat parameter security java.lang.String
keyStoreResource parameter security java.lang.String
needClientAuth parameter security boolean
passphrase parameter security java.lang.String
securityConfiguration parameter security org.apache.camel.component.netty4.http.NettyHttpSecurityConfiguration Refers to a org.apache.camel.component.netty4.http.NettyHttpSecurityConfiguration for configuring secure web resources.
securityOptions parameter security java.util.Map To configure NettyHttpSecurityConfiguration using key/value pairs from the map
securityProvider parameter security java.lang.String
ssl parameter security boolean
sslClientCertHeaders parameter security boolean
sslContextParameters parameter security org.apache.camel.util.jsse.SSLContextParameters
sslHandler parameter security io.netty.handler.ssl.SslHandler
trustStoreFile parameter security java.io.File
trustStoreResource parameter security java.lang.String

netty4-http consumer

HTTP based {@link NettyConsumer}