Package org.apache.camel.component.mina
Class MinaConfiguration
java.lang.Object
org.apache.camel.component.mina.MinaConfiguration
- All Implemented Interfaces:
Cloneable
Mina configuration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns a copy of this configurationorg.apache.mina.filter.codec.ProtocolCodecFactory
getCodec()
int
int
List<org.apache.mina.core.filterchain.IoFilter>
getHost()
int
org.apache.camel.LoggingLevel
int
getPort()
org.apache.camel.support.jsse.SSLContextParameters
long
long
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isSync()
boolean
boolean
void
setAllowDefaultCodec
(boolean allowDefaultCodec) The mina component installs a default codec if both, codec is null and textline is false.void
setCachedAddress
(boolean shouldCacheAddress) Whether to create the InetAddress once and reuse.void
setClientMode
(boolean clientMode) If the clientMode is true, mina consumer will connect the address as a TCP client.void
setCodec
(org.apache.mina.filter.codec.ProtocolCodecFactory codec) To use a custom minda codec implementation.void
setDecoderMaxLineLength
(int decoderMaxLineLength) To set the textline protocol decoder max line length.void
setDisconnect
(boolean disconnect) Whether to disconnect(close) from Mina session right after use.void
setDisconnectOnNoReply
(boolean disconnectOnNoReply) If sync is enabled then this option dictates MinaConsumer if it should disconnect where there is no reply to send back.void
setEncoderMaxLineLength
(int encoderMaxLineLength) To set the textline protocol encoder max line length.void
setEncoding
(String encoding) You can configure the encoding (a charset name) to use for the TCP textline codec and the UDP protocol.void
setFilters
(List<org.apache.mina.core.filterchain.IoFilter> filters) You can set a list of Mina IoFilters to use.void
Hostname to use.void
setLazySessionCreation
(boolean lazySessionCreation) Sessions can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started.void
setMaximumPoolSize
(int maximumPoolSize) Number of worker threads in the worker pool for TCP and UDPvoid
setMinaLogger
(boolean minaLogger) You can enable the Apache MINA logging filter.void
setNoReplyLogLevel
(org.apache.camel.LoggingLevel noReplyLogLevel) If sync is enabled this option dictates MinaConsumer which logging level to use when logging a there is no reply to send back.void
setOrderedThreadPoolExecutor
(boolean orderedThreadPoolExecutor) Whether to use ordered thread pool, to ensure events are processed orderly on the same channel.void
setPort
(int port) Port numbervoid
setProtocol
(String protocol) Protocol to usevoid
setSslContextParameters
(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) To configure SSL security.void
setSync
(boolean sync) Setting to set endpoint as one-way or request-response.void
setTextline
(boolean textline) Only used for TCP.void
setTextlineDelimiter
(MinaTextLineDelimiter textlineDelimiter) Only used for TCP and if textline=true.void
setTimeout
(long timeout) You can configure the timeout that specifies how long to wait for a response from a remote server.void
setTransferExchange
(boolean transferExchange) Only used for TCP.void
setWriteTimeout
(long writeTimeout) Maximum amount of time it should take to send data to the MINA session.
-
Constructor Details
-
MinaConfiguration
public MinaConfiguration()
-
-
Method Details
-
copy
Returns a copy of this configuration -
getCharsetName
-
getProtocol
-
setProtocol
Protocol to use -
getHost
-
setHost
Hostname to use. Use localhost or 0.0.0.0 for local server as consumer. For producer use the hostname or ip address of the remote server. -
getPort
public int getPort() -
setPort
public void setPort(int port) Port number -
isSync
public boolean isSync() -
setSync
public void setSync(boolean sync) Setting to set endpoint as one-way or request-response. -
isTextline
public boolean isTextline() -
setTextline
public void setTextline(boolean textline) 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. -
getTextlineDelimiter
-
setTextlineDelimiter
Only used for TCP and if textline=true. Sets the text line delimiter to use. If none provided, Camel will use DEFAULT. This delimiter is used to mark the end of text. -
getCodec
public org.apache.mina.filter.codec.ProtocolCodecFactory getCodec() -
setCodec
public void setCodec(org.apache.mina.filter.codec.ProtocolCodecFactory codec) To use a custom minda codec implementation. -
getEncoding
-
setEncoding
You can configure the encoding (a charset name) to use for the TCP textline codec and the UDP protocol. If not provided, Camel will use the JVM default Charset -
getWriteTimeout
public long getWriteTimeout() -
setWriteTimeout
public void setWriteTimeout(long writeTimeout) Maximum amount of time it should take to send data to the MINA session. Default is 10000 milliseconds. -
getTimeout
public long getTimeout() -
setTimeout
public void setTimeout(long timeout) You can configure the timeout that specifies how long to wait for a response from a remote server. The timeout unit is in milliseconds, so 60000 is 60 seconds. -
isLazySessionCreation
public boolean isLazySessionCreation() -
setLazySessionCreation
public void setLazySessionCreation(boolean lazySessionCreation) Sessions can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started. -
isTransferExchange
public boolean isTransferExchange() -
setTransferExchange
public void setTransferExchange(boolean transferExchange) 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. -
setEncoderMaxLineLength
public void setEncoderMaxLineLength(int encoderMaxLineLength) To set the textline protocol encoder max line length. By default the default value of Mina itself is used which are Integer.MAX_VALUE. -
getEncoderMaxLineLength
public int getEncoderMaxLineLength() -
setDecoderMaxLineLength
public void setDecoderMaxLineLength(int decoderMaxLineLength) To set the textline protocol decoder max line length. By default the default value of Mina itself is used which are 1024. -
getDecoderMaxLineLength
public int getDecoderMaxLineLength() -
isMinaLogger
public boolean isMinaLogger() -
setMinaLogger
public void setMinaLogger(boolean minaLogger) You can enable the Apache MINA logging filter. Apache MINA uses slf4j logging at INFO level to log all input and output. -
getFilters
-
setFilters
You can set a list of Mina IoFilters to use. -
isDatagramProtocol
public boolean isDatagramProtocol() -
setAllowDefaultCodec
public void setAllowDefaultCodec(boolean allowDefaultCodec) The mina component installs a default codec if both, codec is null and textline is false. Setting allowDefaultCodec to false prevents the mina component from installing a default codec as the first element in the filter chain. This is useful in scenarios where another filter must be the first in the filter chain, like the SSL filter. -
isAllowDefaultCodec
public boolean isAllowDefaultCodec() -
isDisconnect
public boolean isDisconnect() -
setDisconnect
public void setDisconnect(boolean disconnect) Whether to disconnect(close) from Mina session right after use. Can be used for both consumer and producer. -
isDisconnectOnNoReply
public boolean isDisconnectOnNoReply() -
setDisconnectOnNoReply
public void setDisconnectOnNoReply(boolean disconnectOnNoReply) If sync is enabled then this option dictates MinaConsumer if it should disconnect where there is no reply to send back. -
getNoReplyLogLevel
public org.apache.camel.LoggingLevel getNoReplyLogLevel() -
setNoReplyLogLevel
public void setNoReplyLogLevel(org.apache.camel.LoggingLevel noReplyLogLevel) If sync is enabled this option dictates MinaConsumer which logging level to use when logging a there is no reply to send back. -
getSslContextParameters
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters() -
setSslContextParameters
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) To configure SSL security. -
getMaximumPoolSize
public int getMaximumPoolSize() -
setMaximumPoolSize
public void setMaximumPoolSize(int maximumPoolSize) Number of worker threads in the worker pool for TCP and UDP -
isOrderedThreadPoolExecutor
public boolean isOrderedThreadPoolExecutor() -
setOrderedThreadPoolExecutor
public void setOrderedThreadPoolExecutor(boolean orderedThreadPoolExecutor) Whether to use ordered thread pool, to ensure events are processed orderly on the same channel. -
setCachedAddress
public void setCachedAddress(boolean shouldCacheAddress) Whether to create the InetAddress once and reuse. Setting this to false allows to pickup DNS changes in the network. -
isCachedAddress
public boolean isCachedAddress() -
setClientMode
public void setClientMode(boolean clientMode) If the clientMode is true, mina consumer will connect the address as a TCP client. -
isClientMode
public boolean isClientMode() -
getUriString
-