Generated component and endpoint options in Camel SJMS components
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/85518255 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/85518255 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/85518255 Branch: refs/heads/master Commit: 855182553de1350079a08ee810f7c6f510bb72da Parents: d183edc Author: Antonin Stefanutti <anto...@stefanutti.fr> Authored: Mon Mar 21 14:48:35 2016 +0100 Committer: Antonin Stefanutti <anto...@stefanutti.fr> Committed: Mon Mar 21 15:23:51 2016 +0100 ---------------------------------------------------------------------- .../camel-sjms/src/main/docs/sjms-batch.adoc | 59 ++--- components/camel-sjms/src/main/docs/sjms.adoc | 220 +++++-------------- 2 files changed, 92 insertions(+), 187 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/85518255/components/camel-sjms/src/main/docs/sjms-batch.adoc ---------------------------------------------------------------------- diff --git a/components/camel-sjms/src/main/docs/sjms-batch.adoc b/components/camel-sjms/src/main/docs/sjms-batch.adoc index 8d4cfa7..9b13de1 100644 --- a/components/camel-sjms/src/main/docs/sjms-batch.adoc +++ b/components/camel-sjms/src/main/docs/sjms-batch.adoc @@ -113,41 +113,50 @@ link:aggregator2.html[aggregator] in this scenario. Component Options and Configurations ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The SJMS Batch Component supports the following configuration options: -[width="100%",cols="10%,10%,10%,80%",options="header",] -|======================================================================= -|Option |Required |Default Value |Description -|`aggregationStrategy` -| icon:check[] -|`null` |A reference to an `AggregationStrategy` in the Camel registry -(e.g. `#myAggregationStrategy`) +// component options: START +The Simple JMS Batch component supports 1 options which are listed below. -|`completionSize` | |`200` a| -The size of the batch to aggregate. -Care should be taken to ensure that this is not larger than the JMS -consumer's prefetch buffer, or the maximum page size for a queue on the -broker; either of these could cause the consumer to hang if no timeout -is used. -A value of 0 or less indicates that `completionTimeout` only should be -used. +[width="100%",cols="2s,1m,8",options="header"] +|======================================================================= +| Name | Java Type | Description +| connectionFactory | ConnectionFactory | A ConnectionFactory is required to enable the SjmsBatchComponent. +|======================================================================= +// component options: END -|`completionTimeout` | |`500` a| -The maximum time to wait from the receipt of the first message before -emitting the Exchange. -A value of 0 or less indicates that `completionSize` only should be -used. -|`pollDuration` | |`1000` a| -The maximum length of a call to `MessageConsumer.receive()`. The time -remaining before timeout takes precedence within a batch. -This value is effectively the poll time between batches. +// endpoint options: START +The Simple JMS Batch component supports 19 endpoint options which are listed below: +[width="100%",cols="2s,1,1m,1m,5",options="header"] |======================================================================= +| Name | Group | Default | Java Type | Description +| destinationName | consumer | | String | *Required* The destination name. Only queues are supported names may be prefixed by 'queue:'. +| aggregationStrategy | consumer | | AggregationStrategy | *Required* The aggregation strategy to use which merges all the batched messages into a single message +| allowNullBody | consumer | true | boolean | Whether to allow sending messages with no body. If this option is false and the message body is null then an JMSException is thrown. +| bridgeErrorHandler | consumer | false | 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. +| completionInterval | consumer | 1000 | int | The completion interval in millis which causes batches to be completed in a scheduled fixed rate every interval. The batch may be empty if the timeout triggered and there was no messages in the batch. Notice you cannot use both completion timeout and completion interval at the same time only one can be configured. +| completionSize | consumer | 200 | int | The number of messages consumed at which the batch will be completed +| completionTimeout | consumer | 500 | int | The timeout in millis from receipt of the first first message when the batch will be completed. The batch may be empty if the timeout triggered and there was no messages in the batch. Notice you cannot use both completion timeout and completion interval at the same time only one can be configured. +| consumerCount | consumer | 1 | int | The number of JMS sessions to consume from +| includeAllJMSXProperties | consumer | false | boolean | Whether to include all JMSXxxx properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply. +| mapJmsMessage | consumer | true | boolean | Specifies whether Camel should auto map the received JMS message to a suited payload type such as javax.jms.TextMessage to a String etc. See section about how mapping works below for more details. +| pollDuration | consumer | 1000 | int | The duration in milliseconds of each poll for messages. completionTimeOut will be used if it is shorter and a batch has started. +| sendEmptyMessageWhenIdle | consumer | false | boolean | If using completion timeout or interval then the batch may be empty if the timeout triggered and there was no messages in the batch. If this option is true and the batch is empty then an empty message is added to the batch so an empty message is routed. +| exceptionHandler | consumer (advanced) | | 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 | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange +| headerFilterStrategy | advanced | | HeaderFilterStrategy | To use a custom HeaderFilterStrategy to filter header to and from Camel message. +| jmsKeyFormatStrategy | advanced | | JmsKeyFormatStrategy | Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the notation. +| messageCreatedStrategy | advanced | | MessageCreatedStrategy | To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of javax.jms.Message objects when Camel is sending a JMS message. +| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). +| timeoutCheckerExecutorService | advanced | | ScheduledExecutorService | If using the completionInterval option a background thread is created to trigger the completion interval. Set this option to provide a custom thread pool to be used rather than creating a new thread for every consumer. +|======================================================================= +// endpoint options: END + The `completionSize` endpoint attribute is used in conjunction with `completionTimeout`, where the first condition to be met will cause the http://git-wip-us.apache.org/repos/asf/camel/blob/85518255/components/camel-sjms/src/main/docs/sjms.adoc ---------------------------------------------------------------------- diff --git a/components/camel-sjms/src/main/docs/sjms.adoc b/components/camel-sjms/src/main/docs/sjms.adoc index dc3e2c9..5d18f9c 100644 --- a/components/camel-sjms/src/main/docs/sjms.adoc +++ b/components/camel-sjms/src/main/docs/sjms.adoc @@ -100,53 +100,67 @@ You append query options to the URI using the following format, Component Options and Configurations ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The SJMS Component supports the following configuration options: -[width="100%",cols="10%,10%,10%,70%",options="header",] +// component options: START +The Simple JMS component supports 9 options which are listed below. + + + +[width="100%",cols="2s,1m,8",options="header"] |======================================================================= -|Option |Required |Default Value |Description -|`connectionCount` | |`1` |The maximum number of connections available -to endpoints started under this component - -|`connectionFactory` -|icon:check[] -|`null` |A -http://docs.oracle.com/javaee/5/api/javax/jms/ConnectionFactory.html[ConnectionFactory] -is required to enable the `SjmsComponent`. It can be set directly or set -set as part of a `ConnectionResource`. - -|`connectionResource` | |`null` |A `ConnectionResource` is an interface -that allows for customization and container control of the -`ConnectionFactory`. See link:sjms.html[Plugable Connection Resource -Management] for further details. - -|`headerFilterStrategy` | |`DefaultJmsKeyFormatStrategy` | - -|`keyFormatStrategy` | |`DefaultJmsKeyFormatStrategy` |**Camel 2.15.x -or older**: See option below - -|`jmsKeyFormatStrategy` | |`DefaultJmsKeyFormatStrategy` |*Camel 2.16:* -Pluggable strategy for encoding and decoding JMS keys so they can be -compliant with the JMS specification. Camel provides two implementations -out of the box: `default` and `passthrough`. The `default` strategy will -safely marshal dots and hyphens (`.` and `-`). -The `passthrough` strategy leaves the key as is. Can be used for JMS -brokers which do not care whether JMS header keys contain illegal -characters. You can provide your own implementation of -the `org.apache.camel.component.jms.JmsKeyFormatStrategy` and refer to it -using the `#` notation. - -|`transactionCommitStrategy` | |`null` | - -|`DestinationCreationStrategy` | |`DefaultDestinationCreationStrategy` -|**Camel 2.15.0**: Support to set the custom `DestinationCreationStrategy` -on the SJMS Component. - -|`messageCreatedStrategy` | | |*Camel 2.16:* To use the given -`MessageCreatedStrategy` which are invoked when Camel creates new -instances of `javax.jms.Message` objects when Camel is sending a JMS -message. +| Name | Java Type | Description +| connectionFactory | ConnectionFactory | A ConnectionFactory is required to enable the SjmsComponent. It can be set directly or set set as part of a ConnectionResource. +| headerFilterStrategy | HeaderFilterStrategy | To use a custom HeaderFilterStrategy to filter header to and from Camel message. +| connectionResource | ConnectionResource | A ConnectionResource is an interface that allows for customization and container control of the ConnectionFactory. See Plugable Connection Resource Management for further details. +| connectionCount | Integer | The maximum number of connections available to endpoints started under this component +| jmsKeyFormatStrategy | JmsKeyFormatStrategy | Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides one implementation out of the box: default. The default strategy will safely marshal dots and hyphens (. and -). Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the notation. +| transactionCommitStrategy | TransactionCommitStrategy | To configure which kind of commit strategy to use. Camel provides two implementations out of the box default and batch. +| destinationCreationStrategy | DestinationCreationStrategy | To use a custom DestinationCreationStrategy. +| timedTaskManager | TimedTaskManager | To use a custom TimedTaskManager +| messageCreatedStrategy | MessageCreatedStrategy | To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of javax.jms.Message objects when Camel is sending a JMS message. |======================================================================= +// component options: END + + + +// endpoint options: START +The Simple JMS component supports 29 endpoint options which are listed below: + +[width="100%",cols="2s,1,1m,1m,5",options="header"] +|======================================================================= +| Name | Group | Default | Java Type | Description +| destinationType | common | queue | String | The kind of destination to use +| destinationName | common | | String | *Required* DestinationName is a JMS queue or topic name. By default the destinationName is interpreted as a queue name. +| acknowledgementMode | common | AUTO_ACKNOWLEDGE | SessionAcknowledgementType | The JMS acknowledgement name which is one of: SESSION_TRANSACTED CLIENT_ACKNOWLEDGE AUTO_ACKNOWLEDGE DUPS_OK_ACKNOWLEDGE +| bridgeErrorHandler | consumer | false | 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. +| consumerCount | consumer | 1 | int | Sets the number of consumer listeners used for this endpoint. +| durableSubscriptionId | consumer | | String | Sets the durable subscription Id required for durable topics. +| synchronous | consumer | true | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). +| exceptionHandler | consumer (advanced) | | 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. +| messageSelector | consumer (advanced) | | String | Sets the JMS Message selector syntax. +| namedReplyTo | producer | | String | Sets the reply to destination name used for InOut producer endpoints. +| persistent | producer | true | boolean | Flag used to enable/disable message persistence. +| producerCount | producer | 1 | int | Sets the number of producers used for this endpoint. +| ttl | producer | -1 | long | Flag used to adjust the Time To Live value of produced messages. +| allowNullBody | producer (advanced) | true | boolean | Whether to allow sending messages with no body. If this option is false and the message body is null then an JMSException is thrown. +| prefillPool | producer (advanced) | true | boolean | Whether to prefill the producer connection pool on startup or create connections lazy when needed. +| responseTimeOut | producer (advanced) | 5000 | long | Sets the amount of time we should wait before timing out a InOut response. +| asyncStartListener | advanced | false | boolean | Whether to startup the consumer message listener asynchronously when starting a route. For example if a JmsConsumer cannot get a connection to a remote JMS broker then it may block while retrying and/or failover. This will cause Camel to block while starting routes. By setting this option to true you will let routes startup while the JmsConsumer connects to the JMS broker using a dedicated thread in asynchronous mode. If this option is used then beware that if the connection could not be established then an exception is logged at WARN level and the consumer will not be able to receive messages; You can then restart the route to retry. +| asyncStopListener | advanced | false | boolean | Whether to stop the consumer message listener asynchronously when stopping a route. +| destinationCreationStrategy | advanced | | DestinationCreationStrategy | To use a custom DestinationCreationStrategy. +| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange +| headerFilterStrategy | advanced | | HeaderFilterStrategy | To use a custom HeaderFilterStrategy to filter header to and from Camel message. +| includeAllJMSXProperties | advanced | false | boolean | Whether to include all JMSXxxx properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply. +| jmsKeyFormatStrategy | advanced | | JmsKeyFormatStrategy | Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the notation. +| mapJmsMessage | advanced | true | boolean | Specifies whether Camel should auto map the received JMS message to a suited payload type such as javax.jms.TextMessage to a String etc. See section about how mapping works below for more details. +| messageCreatedStrategy | advanced | | MessageCreatedStrategy | To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of javax.jms.Message objects when Camel is sending a JMS message. +| transacted | transaction | false | boolean | Specifies whether to use transacted mode +| transactionBatchCount | transaction | -1 | int | If transacted sets the number of messages to process before committing a transaction. +| transactionBatchTimeout | transaction | 5000 | long | Sets timeout (in millis) for batch transactions the value should be 1000 or higher. +| transactionCommitStrategy | transaction | | TransactionCommitStrategy | Sets the commit strategy. +|======================================================================= +// endpoint options: END + Below is an example of how to configure the `SjmsComponent` with its required `ConnectionFactory` provider. It will create a single connection @@ -176,82 +190,6 @@ component.setConnectionResource(connectionResource); component.setMaxConnections(1); ---- -[[SJMS-ProducerConfigurationOptions]] -Producer Configuration Options -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The SJMS producer endpoint supports the following properties: - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Option |Default Value |Description -|`acknowledgementMode` |`AUTO_ACKNOWLEDGE` |The JMS acknowledgement -name, which is one of: `SESSION_TRANSACTED`, `AUTO_ACKNOWLEDGE` or -`DUPS_OK_ACKNOWLEDGE`. `CLIENT_ACKNOWLEDGE` is not supported at this -time. - -|`consumerCount` |`1` |*InOut only.* Defines the number of -http://docs.oracle.com/javaee/5/api/javax/jms/MessageListener.html[MessageListener] -instances that for response consumers. - -|`exchangePattern` |`InOnly` |Sets the Producers message exchange -pattern. - -|`namedReplyTo` |`null` |*InOut only.* Specifies a named reply to -destination for responses. - -|`persistent` |`true` |Whether a message should be delivered with -persistence enabled. - -|`producerCount` |`1` |Defines the number of -http://docs.oracle.com/javaee/5/api/javax/jms/MessageProducer.html[MessageProducer] -instances. - -|`responseTimeOut` |`5000` |*InOut only.* Specifies the amount of time -an InOut Producer will wait for its response. - -|`synchronous` |`true` |Sets whether the Endpoint will use synchronous -or asynchronous processing. - -|`transacted` |`false` |If the endpoint should use a JMS Session -transaction. - -|`ttl` |`-1` |Disabled by default. Sets the Message time to live header. - -|`prefillPool` |`true` |*Camel 2.14:* Whether to prefill the producer connection pool on -startup, or create connections lazy when needed. - -|`allowNullBody` |`true` |*Camel 2.15.1:* Whether to allow sending messages -with no body. If this option is `false` and the message body is null, -then an `JMSException` is thrown. - -|`mapJmsMessage` |`true` |*Camel 2.16:* Specifies whether Camel should -auto map the received JMS message to an appropiate payload type, such -as `javax.jms.TextMessage` to a `String` etc. - -|`messageCreatedStrategy` | |**Camel 2.16:** To use the given -MessageCreatedStrategy which are invoked when Camel creates new -instances of javax.jms.Message objects when Camel is sending a JMS -message. - -|`jmsKeyFormatStrategy` | |**Camel 2.16:** Pluggable strategy for -encoding and decoding JMS keys so they can be compliant with the JMS -specification. Camel provides two implementations out of the -box: `default` and `passthrough`. The `default` strategy will safely -marshal dots and hyphens (`.` and `-`). The `passthrough` strategy -leaves the key as is. Can be used for JMS brokers which do not care -whether JMS header keys contain illegal characters. You can provide your -own implementation of -the`org.apache.camel.component.jms.JmsKeyFormatStrategy` and refer to it -using the `#` notation. - -|`includeAllJMSXProperties` | |*Camel 2.16:* Whether to include all -JMSXxxx properties when mapping from JMS to Camel Message. Setting this -to `true` will include properties such as `JMSXAppID`, -and `JMSXUserID` etc. **Note:** If you are using a -custom `headerFilterStrategy` then this option does not apply. -|======================================================================= - [[SJMS-ProducerUsage]] Producer Usage ^^^^^^^^^^^^^^ @@ -292,48 +230,6 @@ from("direct:start") .to("sjms:queue:bar?exchangePattern=InOut&namedReplyTo=my.reply.to.queue"); ---- -[[SJMS-ConsumersConfigurationOptions]] -Consumers Configuration Options -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The SJMS consumer endpoint supports the following properties: - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Option |Default Value |Description -|`acknowledgementMode` |`AUTO_ACKNOWLEDGE` |The JMS acknowledgement -name, which is one of: `TRANSACTED`, `AUTO_ACKNOWLEDGE` or -`DUPS_OK_ACKNOWLEDGE`. `CLIENT_ACKNOWLEDGE` is not supported at this -time. - -|`consumerCount` |`1` |Defines the number of -http://docs.oracle.com/javaee/5/api/javax/jms/MessageListener.html[`MessageListener`] -instances. - -|`durableSubscriptionId` |`null` |Required for a durable subscriptions. - -|`exchangePattern` |`InOnly` |Sets the Consumers message exchange -pattern. - -|`messageSelector` |`null` |Sets the message selector. - -|`synchronous` |`true` |Sets whether the Endpoint will use synchronous -or asynchronous processing. - -|`transacted` |`false` |If the endpoint should use a JMS Session -transaction. - -|`transactionBatchCount` |`1` |The number of exchanges to process before -committing a local JMS transaction. The `transacted` property must also -be set to true or this property will be ignored. - -|`transactionBatchTimeout` |`5000` |The amount of time a the transaction -will stay open between messages before committing what has already been -consumed. Minimum value is 1000ms. - -|`ttl` |`-1` |Disabled by default. Sets the Message time to live header. -|======================================================================= - [[SJMS-ConsumerUsage]] Consumer Usage ^^^^^^^^^^^^^^