Netty4

Netty4

Scheme: netty4
Name Kind Type Required Deprecated Default Value Enum Values Description
protocol path java.lang.String true false tcp
udp
The protocol to use which can be tcp or udp.
host path java.lang.String true false The hostname.

For the consumer the hostname is localhost or 0.0.0.0 For the producer the hostname is the remote host to connect to

port path int true false The host port number
requestTimeout parameter long false Allows to use a timeout for the Netty producer when calling a remote server. By default no timeout is in use. The value is in milli seconds, so eg 30000 is 30 seconds. The requestTimeout is using Netty's ReadTimeoutHandler to trigger the timeout.
sync parameter boolean false true Setting to set endpoint as one-way or request-response
textline parameter boolean false Only used for TCP. If no codec is specified, you can use this flag to indicate a text line based codec; if not specified or the value is false, then Object Serialization is assumed over TCP.
delimiter parameter org.apache.camel.component.netty4.TextLineDelimiter false LINE LINE
NULL
The delimiter to use for the textline codec. Possible values are LINE and NULL.
autoAppendDelimiter parameter boolean false true Whether or not to auto append missing end delimiter when sending using the textline codec.
decoderMaxLineLength parameter int false 1024 The max line length to use for the textline codec.
encoding parameter java.lang.String false The encoding (a charset name) to use for the textline codec. If not provided, Camel will use the JVM default Charset.
disconnect parameter boolean false Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer.
lazyChannelCreation parameter boolean false true Channels can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started.
transferExchange parameter boolean false Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body, Out body, fault body, In headers, Out headers, fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level.
disconnectOnNoReply parameter boolean false true If sync is enabled then this option dictates NettyConsumer if it should disconnect where there is no reply to send back.
noReplyLogLevel parameter org.apache.camel.LoggingLevel false WARN TRACE
DEBUG
INFO
WARN
ERROR
OFF
If sync is enabled this option dictates NettyConsumer which logging level to use when logging a there is no reply to send back.
serverExceptionCaughtLogLevel parameter org.apache.camel.LoggingLevel false WARN TRACE
DEBUG
INFO
WARN
ERROR
OFF
If the server (NettyConsumer) catches an exception then its logged using this logging level.
serverClosedChannelExceptionCaughtLogLevel parameter org.apache.camel.LoggingLevel false DEBUG TRACE
DEBUG
INFO
WARN
ERROR
OFF
If the server (NettyConsumer) catches an java.nio.channels.ClosedChannelException then its logged using this logging level. This is used to avoid logging the closed channel exceptions, as clients can disconnect abruptly and then cause a flood of closed exceptions in the Netty server.
allowDefaultCodec parameter boolean false true The netty component installs a default codec if both, encoder/deocder is null and textline is false. Setting allowDefaultCodec to false prevents the netty component from installing a default codec as the first element in the filter chain.
clientInitializerFactory parameter org.apache.camel.component.netty4.ClientInitializerFactory false To use a custom ClientInitializerFactory
maximumPoolSize parameter int false 16 The core pool size for the ordered thread pool, if its in use.
usingExecutorService parameter boolean false true Whether to use ordered thread pool, to ensure events are processed orderly on the same channel.
producerPoolMaxActive parameter int false -1 Sets the cap on the number of objects that can be allocated by the pool (checked out to clients, or idle awaiting checkout) at a given time. Use a negative value for no limit.
producerPoolMinIdle parameter int false Sets the minimum number of instances allowed in the producer pool before the evictor thread (if active) spawns new objects.
producerPoolMaxIdle parameter int false 100 Sets the cap on the number of "idle" instances in the pool.
producerPoolMinEvictableIdle parameter long false 300000 Sets the minimum amount of time (value in millis) an object may sit idle in the pool before it is eligible for eviction by the idle object evictor.
producerPoolEnabled parameter boolean false true Whether producer pool is enabled or not. Important: Do not turn this off, as the pooling is needed for handling concurrency and reliable request/reply.
udpConnectionlessSending parameter boolean false This option supports connection less udp sending which is a real fire and forget. A connected udp send receive the PortUnreachableException if no one is listen on the receiving port.
clientMode parameter boolean false If the clientMode is true, netty consumer will connect the address as a TCP client.
useByteBuf parameter boolean false If the useByteBuf is true, netty producer will turn the message body into {@link ByteBuf} before sending it out.
udpByteArrayCodec parameter boolean false For UDP only. If enabled the using byte array codec instead of Java serialization protocol.
broadcast parameter boolean false Setting to choose Multicast over UDP
sendBufferSize parameter int false 65536 The TCP/UDP buffer sizes to be used during outbound communication. Size is bytes.
receiveBufferSize parameter int false 65536 The TCP/UDP buffer sizes to be used during inbound communication. Size is bytes.
receiveBufferSizePredictor parameter int false Configures the buffer size predictor. See details at Jetty documentation and this mail thread.
bossCount parameter int false 1 When netty works on nio mode, it uses default bossCount parameter from Netty, which is 1. User can use this operation to override the default bossCount from Netty
workerCount parameter int false When netty works on nio mode, it uses default workerCount parameter from Netty, which is cpu_core_threads*2. User can use this operation to override the default workerCount from Netty
keepAlive parameter boolean false true Setting to ensure socket is not closed due to inactivity
tcpNoDelay parameter boolean false true Setting to improve TCP protocol performance
reuseAddress parameter boolean false true Setting to facilitate socket multiplexing
connectTimeout parameter int false 10000 Time to wait for a socket connection to be available. Value is in millis.
backlog parameter int false Allows to configure a backlog for netty consumer (server). Note the backlog is just a best effort depending on the OS. Setting this option to a value such as 200, 500 or 1000, tells the TCP stack how long the "accept" queue can be If this option is not configured, then the backlog depends on OS setting.
serverInitializerFactory parameter org.apache.camel.component.netty4.ServerInitializerFactory false To use a custom ServerInitializerFactory
nettyServerBootstrapFactory parameter org.apache.camel.component.netty4.NettyServerBootstrapFactory false To use a custom NettyServerBootstrapFactory
ssl parameter boolean false Setting to specify whether SSL encryption is applied to this endpoint
sslClientCertHeaders parameter boolean false When enabled and in SSL mode, then the Netty consumer will enrich the Camel Message with headers having information about the client certificate such as subject name, issuer name, serial number, and the valid date range.
sslHandler parameter io.netty.handler.ssl.SslHandler false Reference to a class that could be used to return an SSL Handler
sslContextParameters parameter org.apache.camel.util.jsse.SSLContextParameters false To configure security using SSLContextParameters
needClientAuth parameter boolean false Configures whether the server needs client authentication when using SSL.
keyStoreFile parameter java.io.File false Client side certificate keystore to be used for encryption
trustStoreFile parameter java.io.File false Server side certificate keystore to be used for encryption
keyStoreResource parameter java.lang.String false Client side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with "classpath:", "file:", or "http:" to load the resource from different systems.
trustStoreResource parameter java.lang.String false Server side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with "classpath:", "file:", or "http:" to load the resource from different systems.
keyStoreFormat parameter java.lang.String false Keystore format to be used for payload encryption. Defaults to "JKS" if not set
securityProvider parameter java.lang.String false Security provider to be used for payload encryption. Defaults to "SunX509" if not set.
enabledProtocols parameter java.lang.String false TLSv1,TLSv1.1,TLSv1.2 Which protocols to enable when using SSL
passphrase parameter java.lang.String false Password setting to use in order to encrypt/decrypt payloads sent using SSH
bossGroup parameter io.netty.channel.EventLoopGroup false Set the BossGroup which could be used for handling the new connection of the server side across the NettyEndpoint
workerGroup parameter io.netty.channel.EventLoopGroup false To use a explicit EventLoopGroup as the boss thread pool. For example to share a thread pool with multiple consumers. By default each consumer has their own boss pool with 1 core thread.
networkInterface parameter java.lang.String false When using UDP then this option can be used to specify a network interface by its name, such as eth0 to join a multicast group.
reconnect parameter boolean false true Used only in clientMode in consumer, the consumer will attempt to reconnect on disconnection if this is enabled
reconnectInterval parameter int false 10000 Used if reconnect and clientMode is enabled. The interval in milli seconds to attempt reconnection
exchangePattern parameter org.apache.camel.ExchangePattern false InOnly InOnly
RobustInOnly
InOut
InOptionalOut
OutOnly
RobustOutOnly
OutIn
OutOptionalIn
Sets the default exchange pattern when creating an exchange
synchronous parameter boolean false false Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).

netty4 consumer