@UriParams public class NettyConfiguration extends NettyServerBootstrapConfiguration implements Cloneable
backlog, bossCount, bossGroup, broadcast, channelGroup, connectTimeout, DEFAULT_ENABLED_PROTOCOLS, enabledProtocols, host, keepAlive, keyStoreFile, keyStoreFormat, keyStoreResource, nativeTransport, needClientAuth, nettyServerBootstrapFactory, networkInterface, options, passphrase, port, protocol, receiveBufferSize, receiveBufferSizePredictor, reuseAddress, securityProvider, sendBufferSize, serverInitializerFactory, ssl, sslClientCertHeaders, sslContextParameters, sslHandler, tcpNoDelay, trustStoreFile, trustStoreResource, workerCount, workerGroup
Constructor and Description |
---|
NettyConfiguration() |
Modifier and Type | Method and Description |
---|---|
NettyConfiguration |
copy()
Returns a copy of this configuration
|
String |
getCharsetName() |
ClientInitializerFactory |
getClientInitializerFactory() |
ClientInitializerFactory |
getClientPipelineFactory()
Deprecated.
use #getClientInitializerFactory
|
NettyCamelStateCorrelationManager |
getCorrelationManager() |
io.netty.channel.ChannelHandler |
getDecoder() |
int |
getDecoderMaxLineLength() |
List<io.netty.channel.ChannelHandler> |
getDecoders() |
TextLineDelimiter |
getDelimiter() |
io.netty.channel.ChannelHandler |
getEncoder() |
List<io.netty.channel.ChannelHandler> |
getEncoders() |
String |
getEncoding() |
org.apache.camel.LoggingLevel |
getNoReplyLogLevel() |
int |
getProducerPoolMaxActive() |
int |
getProducerPoolMaxIdle() |
long |
getProducerPoolMinEvictableIdle() |
int |
getProducerPoolMinIdle() |
long |
getRequestTimeout() |
org.apache.camel.LoggingLevel |
getServerClosedChannelExceptionCaughtLogLevel() |
org.apache.camel.LoggingLevel |
getServerExceptionCaughtLogLevel() |
boolean |
isAllowDefaultCodec() |
boolean |
isAllowSerializedHeaders() |
boolean |
isAutoAppendDelimiter() |
boolean |
isClientMode() |
boolean |
isDisconnect() |
boolean |
isDisconnectOnNoReply() |
boolean |
isLazyChannelCreation() |
boolean |
isProducerPoolEnabled() |
boolean |
isReuseChannel() |
boolean |
isSync() |
boolean |
isTextline() |
boolean |
isTransferExchange() |
boolean |
isUdpByteArrayCodec() |
boolean |
isUdpConnectionlessSending() |
boolean |
isUseByteBuf() |
boolean |
isUsingExecutorService() |
void |
parseURI(URI uri,
Map<String,Object> parameters,
NettyComponent component,
String... supportedProtocols) |
void |
setAllowDefaultCodec(boolean allowDefaultCodec)
The netty component installs a default codec if both, encoder/decoder is null and textline is false.
|
void |
setAllowSerializedHeaders(boolean allowSerializedHeaders)
Only used for TCP when transferExchange is true.
|
void |
setAutoAppendDelimiter(boolean autoAppendDelimiter)
Whether or not to auto append missing end delimiter when sending using the textline codec.
|
void |
setClientInitializerFactory(ClientInitializerFactory clientInitializerFactory)
To use a custom ClientInitializerFactory
|
void |
setClientMode(boolean clientMode)
If the clientMode is true, netty consumer will connect the address as a TCP client.
|
void |
setClientPipelineFactory(ClientInitializerFactory clientPipelineFactory)
Deprecated.
use #setClientInitializerFactory
|
void |
setCorrelationManager(NettyCamelStateCorrelationManager correlationManager)
To use a custom correlation manager to manage how request and reply messages are mapped when using request/reply with the netty producer.
|
void |
setDecoder(io.netty.channel.ChannelHandler decoder)
A custom ChannelHandler class that can be used to perform special marshalling of inbound payloads.
|
void |
setDecoderMaxLineLength(int decoderMaxLineLength)
The max line length to use for the textline codec.
|
void |
setDecoders(List<io.netty.channel.ChannelHandler> decoders)
A list of decoders to be used.
|
void |
setDelimiter(TextLineDelimiter delimiter)
The delimiter to use for the textline codec.
|
void |
setDisconnect(boolean disconnect)
Whether or not to disconnect(close) from Netty Channel right after use.
|
void |
setDisconnectOnNoReply(boolean disconnectOnNoReply)
If sync is enabled then this option dictates NettyConsumer if it should disconnect where there is no reply to send back.
|
void |
setEncoder(io.netty.channel.ChannelHandler encoder)
A custom ChannelHandler class that can be used to perform special marshalling of outbound payloads.
|
void |
setEncoders(List<io.netty.channel.ChannelHandler> encoders)
A list of encoders to be used.
|
void |
setEncoding(String encoding)
The encoding (a charset name) to use for the textline codec.
|
void |
setLazyChannelCreation(boolean lazyChannelCreation)
Channels can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started.
|
void |
setNoReplyLogLevel(org.apache.camel.LoggingLevel noReplyLogLevel)
If sync is enabled this option dictates NettyConsumer which logging level to use when logging a there is no reply to send back.
|
void |
setProducerPoolEnabled(boolean producerPoolEnabled)
Whether producer pool is enabled or not.
|
void |
setProducerPoolMaxActive(int producerPoolMaxActive)
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.
|
void |
setProducerPoolMaxIdle(int producerPoolMaxIdle)
Sets the cap on the number of "idle" instances in the pool.
|
void |
setProducerPoolMinEvictableIdle(long producerPoolMinEvictableIdle)
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.
|
void |
setProducerPoolMinIdle(int producerPoolMinIdle)
Sets the minimum number of instances allowed in the producer pool before the evictor thread (if active) spawns new objects.
|
void |
setRequestTimeout(long requestTimeout)
Allows to use a timeout for the Netty producer when calling a remote server.
|
void |
setReuseChannel(boolean reuseChannel)
This option allows producers and consumers (in client mode) to reuse the same Netty
Channel for the lifecycle of processing the Exchange . |
void |
setServerClosedChannelExceptionCaughtLogLevel(org.apache.camel.LoggingLevel serverClosedChannelExceptionCaughtLogLevel)
If the server (NettyConsumer) catches an java.nio.channels.ClosedChannelException then its logged using this logging level.
|
void |
setServerExceptionCaughtLogLevel(org.apache.camel.LoggingLevel serverExceptionCaughtLogLevel)
If the server (NettyConsumer) catches an exception then its logged using this logging level.
|
void |
setSync(boolean sync)
Setting to set endpoint as one-way or request-response
|
void |
setTextline(boolean textline)
Only used for TCP.
|
void |
setTransferExchange(boolean transferExchange)
Only used for TCP.
|
void |
setUdpByteArrayCodec(boolean udpByteArrayCodec)
For UDP only.
|
void |
setUdpConnectionlessSending(boolean udpConnectionlessSending)
This option supports connection less udp sending which is a real fire and forget.
|
void |
setUseByteBuf(boolean useByteBuf)
If the useByteBuf is true, netty producer will turn the message body into
ByteBuf before sending it out. |
void |
setUsingExecutorService(boolean usingExecutorService)
Whether to use ordered thread pool, to ensure events are processed orderly on the same channel.
|
void |
validateConfiguration() |
compatible, getAddress, getBacklog, getBossCount, getBossGroup, getChannelGroup, getConnectTimeout, getEnabledProtocols, getHost, getKeyStoreFile, getKeyStoreFormat, getKeyStoreResource, getNettyServerBootstrapFactory, getNetworkInterface, getOptions, getPassphrase, getPort, getProtocol, getReceiveBufferSize, getReceiveBufferSizePredictor, getReconnectInterval, getSecurityProvider, getSendBufferSize, getServerInitializerFactory, getServerPipelineFactory, getSslContextParameters, getSslHandler, getTrustStoreFile, getTrustStoreResource, getWorkerCount, getWorkerGroup, isBroadcast, isKeepAlive, isNativeTransport, isNeedClientAuth, isReconnect, isReuseAddress, isSsl, isSslClientCertHeaders, isTcp, isTcpNoDelay, setBacklog, setBossCount, setBossGroup, setBroadcast, setChannelGroup, setConnectTimeout, setEnabledProtocols, setHost, setKeepAlive, setKeyStoreFile, setKeyStoreFormat, setKeyStoreResource, setNativeTransport, setNeedClientAuth, setNettyServerBootstrapFactory, setNetworkInterface, setOptions, setPassphrase, setPort, setProtocol, setReceiveBufferSize, setReceiveBufferSizePredictor, setReconnect, setReconnectInterval, setReuseAddress, setSecurityProvider, setSendBufferSize, setServerInitializerFactory, setServerPipelineFactory, setSsl, setSslClientCertHeaders, setSslContextParameters, setSslHandler, setTcpNoDelay, setTrustStoreFile, setTrustStoreResource, setWorkerCount, setWorkerGroup, toStringBootstrapConfiguration
public NettyConfiguration copy()
public void validateConfiguration()
public void parseURI(URI uri, Map<String,Object> parameters, NettyComponent component, String... supportedProtocols) throws Exception
Exception
public String getCharsetName()
public long getRequestTimeout()
public void setRequestTimeout(long requestTimeout)
public boolean isSync()
public void setSync(boolean sync)
public boolean isTextline()
public void setTextline(boolean textline)
public int getDecoderMaxLineLength()
public void setDecoderMaxLineLength(int decoderMaxLineLength)
public TextLineDelimiter getDelimiter()
public void setDelimiter(TextLineDelimiter delimiter)
public boolean isAutoAppendDelimiter()
public void setAutoAppendDelimiter(boolean autoAppendDelimiter)
public String getEncoding()
public void setEncoding(String encoding)
public List<io.netty.channel.ChannelHandler> getDecoders()
public void setDecoders(List<io.netty.channel.ChannelHandler> decoders)
public List<io.netty.channel.ChannelHandler> getEncoders()
public void setEncoders(List<io.netty.channel.ChannelHandler> encoders)
public io.netty.channel.ChannelHandler getEncoder()
public void setEncoder(io.netty.channel.ChannelHandler encoder)
public io.netty.channel.ChannelHandler getDecoder()
public void setDecoder(io.netty.channel.ChannelHandler decoder)
public boolean isDisconnect()
public void setDisconnect(boolean disconnect)
public boolean isLazyChannelCreation()
public void setLazyChannelCreation(boolean lazyChannelCreation)
public boolean isTransferExchange()
public void setTransferExchange(boolean transferExchange)
public boolean isAllowSerializedHeaders()
public void setAllowSerializedHeaders(boolean allowSerializedHeaders)
public boolean isDisconnectOnNoReply()
public void setDisconnectOnNoReply(boolean disconnectOnNoReply)
public org.apache.camel.LoggingLevel getNoReplyLogLevel()
public void setNoReplyLogLevel(org.apache.camel.LoggingLevel noReplyLogLevel)
public org.apache.camel.LoggingLevel getServerExceptionCaughtLogLevel()
public void setServerExceptionCaughtLogLevel(org.apache.camel.LoggingLevel serverExceptionCaughtLogLevel)
public org.apache.camel.LoggingLevel getServerClosedChannelExceptionCaughtLogLevel()
public void setServerClosedChannelExceptionCaughtLogLevel(org.apache.camel.LoggingLevel serverClosedChannelExceptionCaughtLogLevel)
public boolean isAllowDefaultCodec()
public void setAllowDefaultCodec(boolean allowDefaultCodec)
@Deprecated public void setClientPipelineFactory(ClientInitializerFactory clientPipelineFactory)
@Deprecated public ClientInitializerFactory getClientPipelineFactory()
public ClientInitializerFactory getClientInitializerFactory()
public void setClientInitializerFactory(ClientInitializerFactory clientInitializerFactory)
public boolean isUsingExecutorService()
public void setUsingExecutorService(boolean usingExecutorService)
public int getProducerPoolMaxActive()
public void setProducerPoolMaxActive(int producerPoolMaxActive)
public int getProducerPoolMinIdle()
public void setProducerPoolMinIdle(int producerPoolMinIdle)
public int getProducerPoolMaxIdle()
public void setProducerPoolMaxIdle(int producerPoolMaxIdle)
public long getProducerPoolMinEvictableIdle()
public void setProducerPoolMinEvictableIdle(long producerPoolMinEvictableIdle)
public boolean isProducerPoolEnabled()
public void setProducerPoolEnabled(boolean producerPoolEnabled)
NettyCamelStateCorrelationManager
as correlation manager and configure it via the correlationManager option.
See also the correlationManager option for more details.public boolean isUdpConnectionlessSending()
public void setUdpConnectionlessSending(boolean udpConnectionlessSending)
public boolean isClientMode()
public void setClientMode(boolean clientMode)
public boolean isUseByteBuf()
public void setUseByteBuf(boolean useByteBuf)
ByteBuf
before sending it out.public boolean isUdpByteArrayCodec()
public void setUdpByteArrayCodec(boolean udpByteArrayCodec)
public boolean isReuseChannel()
public void setReuseChannel(boolean reuseChannel)
Channel
for the lifecycle of processing the Exchange
.
This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection.
When using this, the channel is not returned to the connection pool until the Exchange
is done; or disconnected
if the disconnect option is set to true.
The reused Channel
is stored on the Exchange
as an exchange property with the key NettyConstants.NETTY_CHANNEL
which allows you to obtain the channel during routing and use it as well.public NettyCamelStateCorrelationManager getCorrelationManager()
public void setCorrelationManager(NettyCamelStateCorrelationManager correlationManager)
TimeoutCorrelationManagerSupport
when you build custom correlation managers.
This provides support for timeout and other complexities you otherwise would need to implement as well.
See also the producerPoolEnabled option for more details.Apache Camel