Mina
Send and receive data over TCP or UDP sockets, or over a pipe within the same JVM, with Apache MINA 2.x.
What’s inside
-
Mina component, URI syntax:
mina:protocol:host:port
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-mina-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 31 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.mina.allow-default-codec | Whether to install a default codec when codec is not set: the text line codec with textline=true, otherwise the object serialization codec. Set to false to install no codec, so the route receives and sends Apache MINA IoBuffer objects. Not used by the udp protocol, which installs its own byte array codec when codec is not set. | true | Boolean |
camel.component.mina.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.mina.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.mina.cached-address | Whether the producer resolves the host name once and reuses the address. Set to false to resolve it again each time the producer opens a new connection, to pick up DNS changes. | true | Boolean |
camel.component.mina.client-mode | Whether the consumer connects as a TCP client to the server at host and port, and receives the messages the server sends, instead of listening for connections. Only used by the tcp protocol. | false | Boolean |
camel.component.mina.codec | A custom Apache MINA ProtocolCodecFactory to encode and decode the messages, used instead of the default codec of the protocol. The option is a org.apache.mina.filter.codec.ProtocolCodecFactory type. | ProtocolCodecFactory | |
camel.component.mina.configuration | The shared configuration that the endpoints of this component start from. The options in the endpoint URI override it. The option is a org.apache.camel.component.mina.MinaConfiguration type. | MinaConfiguration | |
camel.component.mina.decoder-max-line-length | The maximum length of a line that the text line decoder reads. If 0 or less, the default of Apache MINA is used, which is 1024. | 1024 | Integer |
camel.component.mina.disconnect | Whether to close the session after each message: the consumer closes it after it writes the reply, and the producer after the exchange is done. The CamelMinaCloseSessionWhenComplete header overrides it. | false | Boolean |
camel.component.mina.disconnect-on-no-reply | Whether a synchronous consumer closes the session when the route ends with no body, so there is no reply to send back. Set to false to keep the session open. The producer always closes its session on a reply timeout. | true | Boolean |
camel.component.mina.enabled | Whether to enable auto configuration of the mina component. This is enabled by default. | Boolean | |
camel.component.mina.encoder-max-line-length | The maximum length of a line that the text line encoder writes. If 0 or less, the default of Apache MINA is used, which is Integer.MAX_VALUE. | -1 | Integer |
camel.component.mina.encoding | The charset name used by the text line codec, and by the udp protocol to convert text to and from bytes. If not set, the default charset of the JVM is used. | String | |
camel.component.mina.filters | A list of Apache MINA IoFilter beans to add to the filter chain, given as bean references separated by comma. | IoFilter> | |
camel.component.mina.hostname-verification | Whether to check that the certificate of the server matches the host Camel connects to, when SSL is used by the producer, or by the consumer in client mode. When disabled, any certificate accepted by the trust store is accepted, whatever host it was issued for. | true | Boolean |
camel.component.mina.lazy-session-creation | Whether the producer connects to the server on the first message instead of when it starts, so the producer can start while the server is not up yet. | true | Boolean |
camel.component.mina.lazy-start-producer | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | Boolean |
camel.component.mina.maximum-pool-size | The maximum number of threads of the worker pool that processes the I/O events of the sessions. Used by the tcp and udp protocols. | 16 | Integer |
camel.component.mina.mina-logger | Whether to add the Apache MINA LoggingFilter to the filter chain, which logs the session events and the messages sent and received with SLF4J at INFO level (exceptions at WARN level). | false | Boolean |
camel.component.mina.mute-exception | If enabled and an Exchange failed processing on the consumer side the response written back to the remote peer won’t contain the exception’s class, message or stack trace. | true | Boolean |
camel.component.mina.no-reply-log-level | The logging level to use when there is nothing to send: on the consumer (if sync is enabled) when there is no reply to send back, and on the producer when the message has no body. | warn | LoggingLevel |
camel.component.mina.object-codec-pattern | Accept the wildcard specified classes for Object deserialization, unless they are otherwise rejected. Multiple patterns can be separated by comma. This widens the codec’s deserialization allow-list, so keep it as narrow as the route actually needs. Avoid *: it accepts every class the classpath can load from an untrusted peer, including Camel’s own org.apache.camel types. Leaving the option unset is the safest choice - the codec then accepts only the small built-in set and refuses anything else. | String | |
camel.component.mina.ordered-thread-pool-executor | Whether the worker pool processes the events of a session in order, one at a time (Apache MINA OrderedThreadPoolExecutor). When false, an UnorderedThreadPoolExecutor processes them concurrently and in any order. | true | Boolean |
camel.component.mina.ssl-context-parameters | The SSL/TLS configuration (key store, trust store, protocols and cipher suites). Only used by the tcp protocol. The option is a org.apache.camel.support.jsse.SSLContextParameters type. | SSLContextParameters | |
camel.component.mina.sync | Whether the endpoint is request-reply (true) or one-way (false). With true the producer waits for the reply of the server and the consumer writes the result of the route back to the client; with false the producer does not wait and the consumer writes nothing back. | true | Boolean |
camel.component.mina.textline | Whether to use the text line codec, which reads and writes one line of text per message, when codec is not set. When false, the object serialization codec is used. Only used by the tcp and vm protocols. | false | Boolean |
camel.component.mina.textline-delimiter | The line delimiter of the text line codec: DEFAULT (the line separator of the platform), AUTO (reads a line that ends with LF or CRLF, writes LF), UNIX (LF), WINDOWS (CRLF) or MAC (CR). If not set, DEFAULT is used. Only used with textline=true. | MinaTextLineDelimiter | |
camel.component.mina.timeout | The time in milliseconds the producer waits for a reply when sync is enabled. It is also the connect timeout of the producer and of a consumer in client mode. | 30000 | Long |
camel.component.mina.use-global-ssl-context-parameters | Whether to use the global SSL context parameters of the CamelContext when an endpoint does not set sslContextParameters. | false | Boolean |
camel.component.mina.write-timeout | The maximum time in milliseconds to wait until a message is written to the session. The exchange fails if the write does not complete in time. | 10000 | Long |
camel.component.mina.transfer-exchange | Only used by the tcp and vm protocols. Transfers the exchange over the wire instead of just the body: the in and out body, the in and out headers, the exchange properties and variables, and the exception. The objects must be serializable; Camel leaves out the ones that are not and logs it at WARN level. The classes of the transferred objects must be allowed in objectCodecPattern. | false | Boolean |