CAMEL-10629: Add more details to component level options
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8c0f3c3c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8c0f3c3c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8c0f3c3c Branch: refs/heads/master Commit: 8c0f3c3c41e9d5da709ffd4f176f821cee970936 Parents: bf5d419 Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Dec 21 19:37:07 2016 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Dec 21 19:37:07 2016 +0100 ---------------------------------------------------------------------- .../springboot/JmsComponentConfiguration.java | 68 ++--- .../camel-jms/src/main/docs/jms-component.adoc | 13 +- .../camel/component/jms/JmsComponent.java | 256 ++++++++++++++++++- .../camel/component/jms/JmsConfiguration.java | 11 +- 4 files changed, 301 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/8c0f3c3c/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java b/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java index 99008ea..fad5811 100644 --- a/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java +++ b/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java @@ -57,7 +57,7 @@ public class JmsComponentConfiguration { /** * Specifies whether the consumer accept messages while it is stopping. You * may consider enabling this option if you start and stop JMS routes at - * runtime while there are still messages enqued on the queue. If this + * runtime while there are still messages enqueued on the queue. If this * option is false and you stop the JMS route then messages may be rejected * and the JMS broker would have to attempt redeliveries which yet again may * be rejected and eventually the message may be moved at a dead letter @@ -92,23 +92,23 @@ public class JmsComponentConfiguration { * The JMS acknowledgement name which is one of: SESSION_TRANSACTED * CLIENT_ACKNOWLEDGE AUTO_ACKNOWLEDGE DUPS_OK_ACKNOWLEDGE */ - private String acknowledgementModeName; + private String acknowledgementModeName = "AUTO_ACKNOWLEDGE"; /** * Specifies whether the consumer container should auto-startup. */ - private Boolean autoStartup; + private Boolean autoStartup = true; /** * Sets the cache level by ID for the underlying JMS resources. See * cacheLevelName option for more details. */ - private Integer cacheLevel; + private Integer cacheLevel = true; /** * Sets the cache level by name for the underlying JMS resources. Possible * values are: CACHE_AUTO CACHE_CONNECTION CACHE_CONSUMER CACHE_NONE and * CACHE_SESSION. The default setting is CACHE_AUTO. See the Spring * documentation and Transactions Cache Levels for more information. */ - private String cacheLevelName; + private String cacheLevelName = "CACHE_AUTO"; /** * Sets the cache level by name for the reply consumer when doing * request/reply over JMS. This option only applies when using fixed reply @@ -134,15 +134,16 @@ public class JmsComponentConfiguration { * request/reply over JMS then the option replyToConcurrentConsumers is used * to control number of concurrent consumers on the reply message listener. */ - private Integer concurrentConsumers; + private Integer concurrentConsumers = 1; /** * Specifies the default number of concurrent consumers when doing * request/reply over JMS. See also the maxMessagesPerTask option to control * dynamic scaling up/down of threads. */ - private Integer replyToConcurrentConsumers; + private Integer replyToConcurrentConsumers = 1; /** - * Sets the default connection factory to be use + * The connection factory to be use. A connection factory must be configured + * either on the component or endpoint. */ private ConnectionFactory connectionFactory; /** @@ -158,7 +159,7 @@ public class JmsComponentConfiguration { /** * Specifies whether persistent delivery is used by default. */ - private Boolean deliveryPersistent; + private Boolean deliveryPersistent = true; /** * Specifies the delivery mode to be used. Possible values are Possibles * values are those defined by javax.jms.DeliveryMode. NON_PERSISTENT = 1 @@ -190,12 +191,12 @@ public class JmsComponentConfiguration { * Allows to configure the default errorHandler logging level for logging * uncaught exceptions. */ - private LoggingLevel errorHandlerLoggingLevel; + private LoggingLevel errorHandlerLoggingLevel = LoggingLevel.WARN; /** * Allows to control whether stacktraces should be logged or not by the * default errorHandler. */ - private Boolean errorHandlerLogStackTrace; + private Boolean errorHandlerLogStackTrace = true; /** * Set if the deliveryMode priority or timeToLive qualities of service * should be used when sending messages. This option is based on Spring's @@ -204,7 +205,7 @@ public class JmsComponentConfiguration { * option which operates at message granularity reading QoS properties * exclusively from the Camel In message headers. */ - private Boolean explicitQosEnabled; + private Boolean explicitQosEnabled = false; /** * Specifies whether the listener session should be exposed when consuming * messages. @@ -217,12 +218,12 @@ public class JmsComponentConfiguration { * case of dynamic scheduling; see the maxConcurrentConsumers setting). * There is additional doc available from Spring. */ - private Integer idleTaskExecutionLimit; + private Integer idleTaskExecutionLimit = 1; /** * Specify the limit for the number of consumers that are allowed to be idle * at any given time. */ - private Integer idleConsumerLimit; + private Integer idleConsumerLimit = 1; /** * Specifies the maximum number of concurrent consumers when consuming from * JMS (not for request/reply over JMS). See also the maxMessagesPerTask @@ -242,14 +243,14 @@ public class JmsComponentConfiguration { * Specifies the maximum number of concurrent consumers for continue routing * when timeout occurred when using request/reply over JMS. */ - private Integer replyOnTimeoutToMaxConcurrentConsumers; + private Integer replyOnTimeoutToMaxConcurrentConsumers = 1; /** * The number of messages per task. -1 is unlimited. If you use a range for * concurrent consumers (eg min max) then this option can be used to set a * value to eg 100 to control how fast the consumers will shrink when less * work is required. */ - private Integer maxMessagesPerTask; + private Integer maxMessagesPerTask = -1; /** * To use a custom Spring * org.springframework.jms.support.converter.MessageConverter so you can be @@ -262,16 +263,19 @@ public class JmsComponentConfiguration { * suited payload type such as javax.jms.TextMessage to a String etc. See * section about how mapping works below for more details. */ - private Boolean mapJmsMessage; + private Boolean mapJmsMessage = true; /** - * When sending specifies whether message IDs should be added. + * When sending specifies whether message IDs should be added. This is just + * an hint to the JMS Broker. If the JMS provider accepts this hint these + * messages must have the message ID set to null; if the provider ignores + * the hint the message ID must be set to its normal unique value */ - private Boolean messageIdEnabled; + private Boolean messageIdEnabled = true; /** * Specifies whether timestamps should be enabled by default on sending * messages. */ - private Boolean messageTimestampEnabled; + private Boolean messageTimestampEnabled = true; /** * If true Camel will always make a JMS message copy of the message when it * is passed to the producer for sending. Copying the message is needed in @@ -290,7 +294,7 @@ public class JmsComponentConfiguration { * is the lowest priority and 9 is the highest). The explicitQosEnabled * option must also be enabled in order for this option to have any effect. */ - private Integer priority; + private Integer priority = 4; /** * Specifies whether to inhibit the delivery of messages published by its * own connection. @@ -299,13 +303,13 @@ public class JmsComponentConfiguration { /** * The timeout for receiving messages (in milliseconds). */ - private Long receiveTimeout; + private Long receiveTimeout = 1000L; /** * Specifies the interval between recovery attempts i.e. when a connection * is being refreshed in milliseconds. The default is 5000 ms that is 5 * seconds. */ - private Long recoveryInterval; + private Long recoveryInterval = 5000L; /** * Deprecated: Enabled by default if you specify a durableSubscriptionName * and a clientId. @@ -321,7 +325,7 @@ public class JmsComponentConfiguration { * When sending messages specifies the time-to-live of the message (in * milliseconds). */ - private Long timeToLive; + private Long timeToLive = -1L; /** * Specifies whether to use transacted mode */ @@ -330,7 +334,7 @@ public class JmsComponentConfiguration { * If true Camel will create a JmsTransactionManager if there is no * transactionManager injected when option transacted=true. */ - private Boolean lazyCreateTransactionManager; + private Boolean lazyCreateTransactionManager = true; /** * The Spring transaction manager to use. */ @@ -344,7 +348,7 @@ public class JmsComponentConfiguration { * The timeout value of the transaction (in seconds) if using transacted * mode. */ - private Integer transactionTimeout; + private Integer transactionTimeout = -1; /** * Specifies whether to test the connection on startup. This ensures that * when Camel starts that all the JMS consumers have a valid connection to @@ -385,7 +389,7 @@ public class JmsComponentConfiguration { * and thus have per message individual timeout values. See also the * requestTimeoutCheckerInterval option. */ - private Long requestTimeout; + private Long requestTimeout = 20000L; /** * Configures how often Camel should check for timed out Exchanges when * doing request/reply over JMS. By default Camel checks once per second. @@ -393,7 +397,7 @@ public class JmsComponentConfiguration { * this interval to check more frequently. The timeout is determined by the * option requestTimeout. */ - private Long requestTimeoutCheckerInterval; + private Long requestTimeoutCheckerInterval = 1000L; /** * You can transfer the exchange over the wire instead of just the body and * headers. The following fields are transferred: In body Out body Fault @@ -483,7 +487,7 @@ public class JmsComponentConfiguration { * Whether to allow sending messages with no body. If this option is false * and the message body is null then an JMSException is thrown. */ - private Boolean allowNullBody; + private Boolean allowNullBody = true; /** * Only applicable when sending to JMS destination using InOnly (eg fire and * forget). Enabling this option will enrich the Camel Exchange with the @@ -544,12 +548,12 @@ public class JmsComponentConfiguration { * the actual correlation id when doing request/reply over JMS and when the * option useMessageIDAsCorrelationID is enabled. */ - private Integer waitForProvisionCorrelationToBeUpdatedCounter; + private Integer waitForProvisionCorrelationToBeUpdatedCounter = 50; /** * Interval in millis to sleep each time while waiting for provisional * correlation id to be updated. */ - private Long waitForProvisionCorrelationToBeUpdatedThreadSleepingTime; + private Long waitForProvisionCorrelationToBeUpdatedThreadSleepingTime = 100L; /** * To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter * header to and from Camel message. @@ -1216,7 +1220,7 @@ public class JmsComponentConfiguration { /** * Specifies whether the consumer accept messages while it is stopping. * You may consider enabling this option, if you start and stop JMS - * routes at runtime, while there are still messages enqued on the + * routes at runtime, while there are still messages enqueued on the * queue. If this option is false, and you stop the JMS route, then * messages may be rejected, and the JMS broker would have to attempt * redeliveries, which yet again may be rejected, and eventually the http://git-wip-us.apache.org/repos/asf/camel/blob/8c0f3c3c/components/camel-jms/src/main/docs/jms-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-jms/src/main/docs/jms-component.adoc b/components/camel-jms/src/main/docs/jms-component.adoc index c010d54..3315299 100644 --- a/components/camel-jms/src/main/docs/jms-component.adoc +++ b/components/camel-jms/src/main/docs/jms-component.adoc @@ -223,7 +223,7 @@ The JMS component supports 74 options which are listed below. |======================================================================= | Name | Java Type | Description | configuration | JmsConfiguration | To use a shared JMS configuration -| acceptMessagesWhileStopping | boolean | Specifies whether the consumer accept messages while it is stopping. You may consider enabling this option if you start and stop JMS routes at runtime while there are still messages enqued on the queue. If this option is false and you stop the JMS route then messages may be rejected and the JMS broker would have to attempt redeliveries which yet again may be rejected and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option. +| acceptMessagesWhileStopping | boolean | Specifies whether the consumer accept messages while it is stopping. You may consider enabling this option if you start and stop JMS routes at runtime while there are still messages enqueued on the queue. If this option is false and you stop the JMS route then messages may be rejected and the JMS broker would have to attempt redeliveries which yet again may be rejected and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option. | allowReplyManagerQuickStop | boolean | Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow the DefaultMessageListenerContainer.runningAllowed flag to quick stop in case JmsConfigurationisAcceptMessagesWhileStopping is enabled and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by default in the regular JMS consumers but to enable for reply managers you must enable this flag. | acknowledgementMode | int | The JMS acknowledgement mode defined as an Integer. Allows you to set vendor-specific extensions to the acknowledgment mode. For the regular modes it is preferable to use the acknowledgementModeName instead. | eagerLoadingOfProperties | boolean | Enables eager loading of JMS properties as soon as a message is loaded which generally is inefficient as the JMS properties may not be required but sometimes can catch early any issues with the underlying JMS provider and the use of JMS properties @@ -235,7 +235,7 @@ The JMS component supports 74 options which are listed below. | clientId | String | Sets the JMS client ID to use. Note that this value if specified must be unique and can only be used by a single JMS connection instance. It is typically only required for durable topic subscriptions. If using Apache ActiveMQ you may prefer to use Virtual Topics instead. | concurrentConsumers | int | Specifies the default number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToConcurrentConsumers is used to control number of concurrent consumers on the reply message listener. | replyToConcurrentConsumers | int | Specifies the default number of concurrent consumers when doing request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. -| connectionFactory | ConnectionFactory | Sets the default connection factory to be use +| connectionFactory | ConnectionFactory | The connection factory to be use. A connection factory must be configured either on the component or endpoint. | username | String | Username to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory. | password | String | Password to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory. | deliveryPersistent | boolean | Specifies whether persistent delivery is used by default. @@ -255,7 +255,7 @@ The JMS component supports 74 options which are listed below. | maxMessagesPerTask | int | The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min max) then this option can be used to set a value to eg 100 to control how fast the consumers will shrink when less work is required. | messageConverter | MessageConverter | To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a javax.jms.Message. | mapJmsMessage | 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. -| messageIdEnabled | boolean | When sending specifies whether message IDs should be added. +| messageIdEnabled | boolean | When sending specifies whether message IDs should be added. This is just an hint to the JMS Broker. If the JMS provider accepts this hint these messages must have the message ID set to null; if the provider ignores the hint the message ID must be set to its normal unique value | messageTimestampEnabled | boolean | Specifies whether timestamps should be enabled by default on sending messages. | alwaysCopyMessage | boolean | If true Camel will always make a JMS message copy of the message when it is passed to the producer for sending. Copying the message is needed in some situations such as when a replyToDestinationSelectorName is set (incidentally Camel will set the alwaysCopyMessage option to true if a replyToDestinationSelectorName is set) | useMessageIDAsCorrelationID | boolean | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. @@ -320,7 +320,7 @@ Endpoint options // endpoint options: START -The JMS component supports 83 endpoint options which are listed below: +The JMS component supports 84 endpoint options which are listed below: {% raw %} [width="100%",cols="2,1,1m,1m,5",options="header"] @@ -344,8 +344,8 @@ The JMS component supports 83 endpoint options which are listed below: | replyTo | consumer | | String | Provides an explicit ReplyTo destination which overrides any incoming value of Message.getJMSReplyTo(). | replyToDeliveryPersistent | consumer | true | boolean | Specifies whether to use persistent delivery by default for replies. | selector | consumer | | String | Sets the JMS selector to use -| acceptMessagesWhileStopping | consumer (advanced) | false | boolean | Specifies whether the consumer accept messages while it is stopping. You may consider enabling this option if you start and stop JMS routes at runtime while there are still messages enqued on the queue. If this option is false and you stop the JMS route then messages may be rejected and the JMS broker would have to attempt redeliveries which yet again may be rejected and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option. -| allowReplyManagerQuickStop | consumer (advanced) | false | boolean | Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow the DefaultMessageListenerContainer.runningAllowed flag to quick stop in case link JmsConfigurationisAcceptMessagesWhileStopping() is enabled and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by default in the regular JMS consumers but to enable for reply managers you must enable this flag. +| acceptMessagesWhileStopping | consumer (advanced) | false | boolean | Specifies whether the consumer accept messages while it is stopping. You may consider enabling this option if you start and stop JMS routes at runtime while there are still messages enqueued on the queue. If this option is false and you stop the JMS route then messages may be rejected and the JMS broker would have to attempt redeliveries which yet again may be rejected and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option. +| allowReplyManagerQuickStop | consumer (advanced) | false | boolean | Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow the link DefaultMessageListenerContainerrunningAllowed() flag to quick stop in case link JmsConfigurationisAcceptMessagesWhileStopping() is enabled and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by default in the regular JMS consumers but to enable for reply managers you must enable this flag. | consumerType | consumer (advanced) | Default | ConsumerType | The consumer type to use which can be one of: Simple Default or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use. | defaultTaskExecutorType | consumer (advanced) | | DefaultTaskExecutorType | Specifies what default TaskExecutor type to use in the DefaultMessageListenerContainer for both consumer endpoints and the ReplyTo consumer of producer endpoints. Possible values: SimpleAsync (uses Spring's SimpleAsyncTaskExecutor) or ThreadPool (uses Spring's ThreadPoolTaskExecutor with optimal values - cached threadpool-like). If not set it defaults to the previous behaviour which uses a cached thread pool for consumer endpoints and SimpleAsync for reply consumers. The use of ThreadPool is recommended to reduce thread trash in elastic configurations with dynamically increasing and decreasing concurrent consumers. | eagerLoadingOfProperties | consumer (advanced) | false | boolean | Enables eager loading of JMS properties as soon as a message is loaded which generally is inefficient as the JMS properties may not be required but sometimes can catch early any issues with the underlying JMS provider and the use of JMS properties @@ -353,6 +353,7 @@ The JMS component supports 83 endpoint options which are listed below: | exchangePattern | consumer (advanced) | | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange. | exposeListenerSession | consumer (advanced) | false | boolean | Specifies whether the listener session should be exposed when consuming messages. | replyToSameDestinationAllowed | consumer (advanced) | false | boolean | Whether a JMS consumer is allowed to send a reply message to the same destination that the consumer is using to consume from. This prevents an endless loop by consuming and sending back the same message to itself. +| taskExecutor | consumer (advanced) | | TaskExecutor | Allows you to specify a custom task executor for consuming messages. | deliveryMode | producer | | Integer | Specifies the delivery mode to be used. Possibles values are those defined by javax.jms.DeliveryMode. NON_PERSISTENT = 1 and PERSISTENT = 2. | deliveryPersistent | producer | true | boolean | Specifies whether persistent delivery is used by default. | explicitQosEnabled | producer | false | Boolean | Set if the deliveryMode priority or timeToLive qualities of service should be used when sending messages. This option is based on Spring's JmsTemplate. The deliveryMode priority and timeToLive options are applied to the current endpoint. This contrasts with the preserveMessageQos option which operates at message granularity reading QoS properties exclusively from the Camel In message headers. http://git-wip-us.apache.org/repos/asf/camel/blob/8c0f3c3c/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java index b1ee124..749d018 100644 --- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java +++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java @@ -20,6 +20,7 @@ import java.util.Map; import java.util.concurrent.ExecutorService; import javax.jms.ConnectionFactory; import javax.jms.ExceptionListener; +import javax.jms.Message; import javax.jms.Session; import org.apache.camel.CamelContext; @@ -27,6 +28,7 @@ import org.apache.camel.Endpoint; import org.apache.camel.LoggingLevel; import org.apache.camel.impl.HeaderFilterStrategyComponent; import org.apache.camel.spi.Metadata; +import org.apache.camel.spi.UriParam; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -204,10 +206,16 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specifies whether the consumer accept messages while it is stopping. * You may consider enabling this option, if you start and stop JMS routes at runtime, while there are still messages - * enqued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected, + * enqueued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected, * and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message * may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option. */ + @Metadata(label = "consumer,advanced", + description = "Specifies whether the consumer accept messages while it is stopping." + + " You may consider enabling this option, if you start and stop JMS routes at runtime, while there are still messages" + + " enqueued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected," + + " and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message" + + " may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option.") public void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping) { getConfiguration().setAcceptMessagesWhileStopping(acceptMessagesWhileStopping); } @@ -218,6 +226,11 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * is enabled, and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by * default in the regular JMS consumers but to enable for reply managers you must enable this flag. */ + @Metadata(label = "consumer,advanced", + description = "Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow " + + " the DefaultMessageListenerContainer.runningAllowed flag to quick stop in case JmsConfiguration#isAcceptMessagesWhileStopping" + + " is enabled, and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by" + + " default in the regular JMS consumers but to enable for reply managers you must enable this flag.") public void setAllowReplyManagerQuickStop(boolean allowReplyManagerQuickStop) { getConfiguration().setAllowReplyManagerQuickStop(allowReplyManagerQuickStop); } @@ -227,6 +240,9 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Allows you to set vendor-specific extensions to the acknowledgment mode. * For the regular modes, it is preferable to use the acknowledgementModeName instead. */ + @Metadata(label = "consumer", + description = "The JMS acknowledgement mode defined as an Integer. Allows you to set vendor-specific extensions to the acknowledgment mode." + + "For the regular modes, it is preferable to use the acknowledgementModeName instead.") public void setAcknowledgementMode(int consumerAcknowledgementMode) { getConfiguration().setAcknowledgementMode(consumerAcknowledgementMode); } @@ -237,6 +253,11 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * but sometimes can catch early any issues with the underlying JMS provider * and the use of JMS properties */ + @Metadata(label = "consumer,advanced", + description = "Enables eager loading of JMS properties as soon as a message is loaded" + + " which generally is inefficient as the JMS properties may not be required" + + " but sometimes can catch early any issues with the underlying JMS provider" + + " and the use of JMS properties") public void setEagerLoadingOfProperties(boolean eagerLoadingOfProperties) { getConfiguration().setEagerLoadingOfProperties(eagerLoadingOfProperties); } @@ -244,6 +265,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * The JMS acknowledgement name, which is one of: SESSION_TRANSACTED, CLIENT_ACKNOWLEDGE, AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE */ + @Metadata(defaultValue = "AUTO_ACKNOWLEDGE", label = "consumer", + description = "The JMS acknowledgement name, which is one of: SESSION_TRANSACTED, CLIENT_ACKNOWLEDGE, AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE") public void setAcknowledgementModeName(String consumerAcknowledgementMode) { getConfiguration().setAcknowledgementModeName(consumerAcknowledgementMode); } @@ -251,6 +274,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specifies whether the consumer container should auto-startup. */ + @Metadata(label = "consumer", defaultValue = "true", + description = "Specifies whether the consumer container should auto-startup.") public void setAutoStartup(boolean autoStartup) { getConfiguration().setAutoStartup(autoStartup); } @@ -258,6 +283,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Sets the cache level by ID for the underlying JMS resources. See cacheLevelName option for more details. */ + @Metadata(label = "consumer", defaultValue = "true", + description = "Sets the cache level by ID for the underlying JMS resources. See cacheLevelName option for more details.") public void setCacheLevel(int cacheLevel) { getConfiguration().setCacheLevel(cacheLevel); } @@ -267,6 +294,10 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Possible values are: CACHE_AUTO, CACHE_CONNECTION, CACHE_CONSUMER, CACHE_NONE, and CACHE_SESSION. * The default setting is CACHE_AUTO. See the Spring documentation and Transactions Cache Levels for more information. */ + @Metadata(defaultValue = "CACHE_AUTO", label = "consumer", + description = "Sets the cache level by name for the underlying JMS resources." + + " Possible values are: CACHE_AUTO, CACHE_CONNECTION, CACHE_CONSUMER, CACHE_NONE, and CACHE_SESSION." + + " The default setting is CACHE_AUTO. See the Spring documentation and Transactions Cache Levels for more information.") public void setCacheLevelName(String cacheName) { getConfiguration().setCacheLevelName(cacheName); } @@ -280,6 +311,14 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Note: If using temporary queues then CACHE_NONE is not allowed, * and you must use a higher value such as CACHE_CONSUMER or CACHE_SESSION. */ + @Metadata(label = "producer,advanced", + description = "Sets the cache level by name for the reply consumer when doing request/reply over JMS." + + " This option only applies when using fixed reply queues (not temporary)." + + " Camel will by default use: CACHE_CONSUMER for exclusive or shared w/ replyToSelectorName." + + " And CACHE_SESSION for shared without replyToSelectorName. Some JMS brokers such as IBM WebSphere" + + " may require to set the replyToCacheLevelName=CACHE_NONE to work." + + " Note: If using temporary queues then CACHE_NONE is not allowed," + + " and you must use a higher value such as CACHE_CONSUMER or CACHE_SESSION.") public void setReplyToCacheLevelName(String cacheName) { getConfiguration().setReplyToCacheLevelName(cacheName); } @@ -290,6 +329,9 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * <p/> * If using Apache ActiveMQ you may prefer to use Virtual Topics instead. */ + @Metadata(description = "Sets the JMS client ID to use. Note that this value, if specified, must be unique and can only be used by a single JMS connection instance." + + " It is typically only required for durable topic subscriptions." + + " If using Apache ActiveMQ you may prefer to use Virtual Topics instead.") public void setClientId(String consumerClientId) { getConfiguration().setClientId(consumerClientId); } @@ -301,6 +343,11 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * When doing request/reply over JMS then the option replyToConcurrentConsumers is used to control number * of concurrent consumers on the reply message listener. */ + @Metadata(defaultValue = "1", label = "consumer", + description = "Specifies the default number of concurrent consumers when consuming from JMS (not for request/reply over JMS)." + + " See also the maxMessagesPerTask option to control dynamic scaling up/down of threads." + + " When doing request/reply over JMS then the option replyToConcurrentConsumers is used to control number" + + " of concurrent consumers on the reply message listener.") public void setConcurrentConsumers(int concurrentConsumers) { getConfiguration().setConcurrentConsumers(concurrentConsumers); } @@ -309,13 +356,17 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Specifies the default number of concurrent consumers when doing request/reply over JMS. * See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. */ + @Metadata(defaultValue = "1", label = "producer", + description = "Specifies the default number of concurrent consumers when doing request/reply over JMS." + + " See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.") public void setReplyToConcurrentConsumers(int concurrentConsumers) { getConfiguration().setReplyToConcurrentConsumers(concurrentConsumers); } /** - * Sets the default connection factory to be use + * The connection factory to be use. A connection factory must be configured either on the component or endpoint. */ + @Metadata(description = "The connection factory to be use. A connection factory must be configured either on the component or endpoint.") public void setConnectionFactory(ConnectionFactory connectionFactory) { getConfiguration().setConnectionFactory(connectionFactory); } @@ -323,7 +374,7 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Username to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory. */ - @Metadata(secret = true) + @Metadata(label = "security", secret = true, description = "Username to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.") public void setUsername(String username) { getConfiguration().setUsername(username); } @@ -331,7 +382,7 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Password to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory. */ - @Metadata(secret = true) + @Metadata(label = "security", secret = true, description = "Password to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.") public void setPassword(String password) { getConfiguration().setPassword(password); } @@ -339,6 +390,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specifies whether persistent delivery is used by default. */ + @Metadata(defaultValue = "true", label = "producer", + description = "Specifies whether persistent delivery is used by default.") public void setDeliveryPersistent(boolean deliveryPersistent) { getConfiguration().setDeliveryPersistent(deliveryPersistent); } @@ -348,6 +401,10 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Possibles values are those defined by javax.jms.DeliveryMode. * NON_PERSISTENT = 1 and PERSISTENT = 2. */ + @Metadata(label = "producer", + description = "Specifies the delivery mode to be used." + + " Possibles values are those defined by javax.jms.DeliveryMode." + + " NON_PERSISTENT = 1 and PERSISTENT = 2.") public void setDeliveryMode(Integer deliveryMode) { getConfiguration().setDeliveryMode(deliveryMode); } @@ -355,6 +412,7 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well. */ + @Metadata(description = "The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well.") public void setDurableSubscriptionName(String durableSubscriptionName) { getConfiguration().setDurableSubscriptionName(durableSubscriptionName); } @@ -362,6 +420,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions. */ + @Metadata(label = "advanced", + description = "Specifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions.") public void setExceptionListener(ExceptionListener exceptionListener) { getConfiguration().setExceptionListener(exceptionListener); } @@ -372,6 +432,11 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * You can configure logging level and whether stack traces should be logged using errorHandlerLoggingLevel and errorHandlerLogStackTrace options. * This makes it much easier to configure, than having to code a custom errorHandler. */ + @Metadata(label = "advanced", + description = "Specifies a org.springframework.util.ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message." + + " By default these exceptions will be logged at the WARN level, if no errorHandler has been configured." + + " You can configure logging level and whether stack traces should be logged using errorHandlerLoggingLevel and errorHandlerLogStackTrace options." + + " This makes it much easier to configure, than having to code a custom errorHandler.") public void setErrorHandler(ErrorHandler errorHandler) { getConfiguration().setErrorHandler(errorHandler); } @@ -379,6 +444,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Allows to configure the default errorHandler logging level for logging uncaught exceptions. */ + @Metadata(defaultValue = "WARN", label = "advanced", + description = "Allows to configure the default errorHandler logging level for logging uncaught exceptions.") public void setErrorHandlerLoggingLevel(LoggingLevel errorHandlerLoggingLevel) { getConfiguration().setErrorHandlerLoggingLevel(errorHandlerLoggingLevel); } @@ -386,6 +453,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Allows to control whether stacktraces should be logged or not, by the default errorHandler. */ + @Metadata(defaultValue = "true", label = "advanced", + description = "Allows to control whether stacktraces should be logged or not, by the default errorHandler.") public void setErrorHandlerLogStackTrace(boolean errorHandlerLogStackTrace) { getConfiguration().setErrorHandlerLogStackTrace(errorHandlerLogStackTrace); } @@ -396,6 +465,11 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * This contrasts with the preserveMessageQos option, which operates at message granularity, * reading QoS properties exclusively from the Camel In message headers. */ + @Metadata(label = "producer", defaultValue = "false", + description = "Set if the deliveryMode, priority or timeToLive qualities of service should be used when sending messages." + + " This option is based on Spring's JmsTemplate. The deliveryMode, priority and timeToLive options are applied to the current endpoint." + + " This contrasts with the preserveMessageQos option, which operates at message granularity," + + " reading QoS properties exclusively from the Camel In message headers.") public void setExplicitQosEnabled(boolean explicitQosEnabled) { getConfiguration().setExplicitQosEnabled(explicitQosEnabled); } @@ -403,6 +477,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specifies whether the listener session should be exposed when consuming messages. */ + @Metadata(label = "consumer,advanced", + description = "Specifies whether the listener session should be exposed when consuming messages.") public void setExposeListenerSession(boolean exposeListenerSession) { getConfiguration().setExposeListenerSession(exposeListenerSession); } @@ -413,6 +489,11 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). * There is additional doc available from Spring. */ + @Metadata(defaultValue = "1", label = "advanced", + description = "Specifies the limit for idle executions of a receive task, not having received any message within its execution." + + " If this limit is reached, the task will shut down and leave receiving to other executing tasks" + + " (in the case of dynamic scheduling; see the maxConcurrentConsumers setting)." + + " There is additional doc available from Spring.") public void setIdleTaskExecutionLimit(int idleTaskExecutionLimit) { getConfiguration().setIdleTaskExecutionLimit(idleTaskExecutionLimit); } @@ -420,6 +501,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specify the limit for the number of consumers that are allowed to be idle at any given time. */ + @Metadata(defaultValue = "1", label = "advanced", + description = "Specify the limit for the number of consumers that are allowed to be idle at any given time.") public void setIdleConsumerLimit(int idleConsumerLimit) { getConfiguration().setIdleConsumerLimit(idleConsumerLimit); } @@ -431,6 +514,11 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * When doing request/reply over JMS then the option replyToMaxConcurrentConsumers is used to control number * of concurrent consumers on the reply message listener. */ + @Metadata(label = "consumer", + description = "Specifies the maximum number of concurrent consumers when consuming from JMS (not for request/reply over JMS)." + + " See also the maxMessagesPerTask option to control dynamic scaling up/down of threads." + + " When doing request/reply over JMS then the option replyToMaxConcurrentConsumers is used to control number" + + " of concurrent consumers on the reply message listener.") public void setMaxConcurrentConsumers(int maxConcurrentConsumers) { getConfiguration().setMaxConcurrentConsumers(maxConcurrentConsumers); } @@ -439,6 +527,9 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Specifies the maximum number of concurrent consumers when using request/reply over JMS. * See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. */ + @Metadata(label = "producer", + description = "Specifies the maximum number of concurrent consumers when using request/reply over JMS." + + " See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.") public void setReplyToMaxConcurrentConsumers(int maxConcurrentConsumers) { getConfiguration().setReplyToMaxConcurrentConsumers(maxConcurrentConsumers); } @@ -446,6 +537,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specifies the maximum number of concurrent consumers for continue routing when timeout occurred when using request/reply over JMS. */ + @Metadata(label = "producer", defaultValue = "1", + description = "Specifies the maximum number of concurrent consumers for continue routing when timeout occurred when using request/reply over JMS.") public void setReplyOnTimeoutToMaxConcurrentConsumers(int maxConcurrentConsumers) { getConfiguration().setReplyToOnTimeoutMaxConcurrentConsumers(maxConcurrentConsumers); } @@ -455,6 +548,10 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * If you use a range for concurrent consumers (eg min < max), then this option can be used to set * a value to eg 100 to control how fast the consumers will shrink when less work is required. */ + @Metadata(defaultValue = "-1", label = "advanced", + description = "The number of messages per task. -1 is unlimited." + + " If you use a range for concurrent consumers (eg min < max), then this option can be used to set" + + " a value to eg 100 to control how fast the consumers will shrink when less work is required.") public void setMaxMessagesPerTask(int maxMessagesPerTask) { getConfiguration().setMaxMessagesPerTask(maxMessagesPerTask); } @@ -463,6 +560,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control * how to map to/from a javax.jms.Message. */ + @Metadata(label = "advanced", + description = "To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a javax.jms.Message.") public void setMessageConverter(MessageConverter messageConverter) { getConfiguration().setMessageConverter(messageConverter); } @@ -471,13 +570,20 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * 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. */ + @Metadata(defaultValue = "true", label = "advanced", + description = "Specifies whether Camel should auto map the received JMS message to a suited payload type, such as javax.jms.TextMessage to a String etc.") public void setMapJmsMessage(boolean mapJmsMessage) { getConfiguration().setMapJmsMessage(mapJmsMessage); } /** - * When sending, specifies whether message IDs should be added. + * When sending, specifies whether message IDs should be added. This is just an hint to the JMS Broker. + * If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, the message ID must be set to its normal unique value */ + @Metadata(defaultValue = "true", label = "advanced", + description = "When sending, specifies whether message IDs should be added. This is just an hint to the JMS broker." + + "If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, " + + "the message ID must be set to its normal unique value") public void setMessageIdEnabled(boolean messageIdEnabled) { getConfiguration().setMessageIdEnabled(messageIdEnabled); } @@ -485,6 +591,10 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specifies whether timestamps should be enabled by default on sending messages. */ + @Metadata(defaultValue = "true", label = "advanced", + description = "Specifies whether timestamps should be enabled by default on sending messages. This is just an hint to the JMS broker." + + "If the JMS provider accepts this hint, these messages must have the timestamp set to zero; if the provider ignores the hint " + + "the timestamp must be set to its normal value") public void setMessageTimestampEnabled(boolean messageTimestampEnabled) { getConfiguration().setMessageTimestampEnabled(messageTimestampEnabled); } @@ -494,6 +604,10 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Copying the message is needed in some situations, such as when a replyToDestinationSelectorName is set * (incidentally, Camel will set the alwaysCopyMessage option to true, if a replyToDestinationSelectorName is set) */ + @Metadata(label = "producer,advanced", + description = "If true, Camel will always make a JMS message copy of the message when it is passed to the producer for sending." + + " Copying the message is needed in some situations, such as when a replyToDestinationSelectorName is set" + + " (incidentally, Camel will set the alwaysCopyMessage option to true, if a replyToDestinationSelectorName is set)") public void setAlwaysCopyMessage(boolean alwaysCopyMessage) { getConfiguration().setAlwaysCopyMessage(alwaysCopyMessage); } @@ -501,6 +615,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. */ + @Metadata(label = "advanced", + description = "Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages.") public void setUseMessageIDAsCorrelationID(boolean useMessageIDAsCorrelationID) { getConfiguration().setUseMessageIDAsCorrelationID(useMessageIDAsCorrelationID); } @@ -509,6 +625,9 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Values greater than 1 specify the message priority when sending (where 0 is the lowest priority and 9 is the highest). * The explicitQosEnabled option must also be enabled in order for this option to have any effect. */ + @Metadata(defaultValue = "" + Message.DEFAULT_PRIORITY, label = "producer", + description = "Values greater than 1 specify the message priority when sending (where 0 is the lowest priority and 9 is the highest)." + + " The explicitQosEnabled option must also be enabled in order for this option to have any effect.") public void setPriority(int priority) { getConfiguration().setPriority(priority); } @@ -516,6 +635,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specifies whether to inhibit the delivery of messages published by its own connection. */ + @Metadata(label = "advanced", + description = "Specifies whether to inhibit the delivery of messages published by its own connection.") public void setPubSubNoLocal(boolean pubSubNoLocal) { getConfiguration().setPubSubNoLocal(pubSubNoLocal); } @@ -523,6 +644,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * The timeout for receiving messages (in milliseconds). */ + @Metadata(defaultValue = "1000", label = "advanced", + description = "The timeout for receiving messages (in milliseconds).") public void setReceiveTimeout(long receiveTimeout) { getConfiguration().setReceiveTimeout(receiveTimeout); } @@ -531,6 +654,9 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Specifies the interval between recovery attempts, i.e. when a connection is being refreshed, in milliseconds. * The default is 5000 ms, that is, 5 seconds. */ + @Metadata(defaultValue = "5000", label = "advanced", + description = "Specifies the interval between recovery attempts, i.e. when a connection is being refreshed, in milliseconds." + + " The default is 5000 ms, that is, 5 seconds.") public void setRecoveryInterval(long recoveryInterval) { getConfiguration().setRecoveryInterval(recoveryInterval); } @@ -546,6 +672,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Allows you to specify a custom task executor for consuming messages. */ + @Metadata(label = "consumer.advanced", + description = "Allows you to specify a custom task executor for consuming messages.") public void setTaskExecutor(TaskExecutor taskExecutor) { getConfiguration().setTaskExecutor(taskExecutor); } @@ -553,6 +681,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * When sending messages, specifies the time-to-live of the message (in milliseconds). */ + @Metadata(defaultValue = "-1", label = "producer", + description = "When sending messages, specifies the time-to-live of the message (in milliseconds).") public void setTimeToLive(long timeToLive) { getConfiguration().setTimeToLive(timeToLive); } @@ -560,6 +690,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Specifies whether to use transacted mode */ + @Metadata(label = "transaction", + description = "Specifies whether to use transacted mode") public void setTransacted(boolean consumerTransacted) { getConfiguration().setTransacted(consumerTransacted); } @@ -567,6 +699,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * If true, Camel will create a JmsTransactionManager, if there is no transactionManager injected when option transacted=true. */ + @Metadata(defaultValue = "true", label = "transaction,advanced", + description = "If true, Camel will create a JmsTransactionManager, if there is no transactionManager injected when option transacted=true.") public void setLazyCreateTransactionManager(boolean lazyCreating) { getConfiguration().setLazyCreateTransactionManager(lazyCreating); } @@ -574,6 +708,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * The Spring transaction manager to use. */ + @Metadata(label = "transaction,advanced", + description = "The Spring transaction manager to use.") public void setTransactionManager(PlatformTransactionManager transactionManager) { getConfiguration().setTransactionManager(transactionManager); } @@ -581,6 +717,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * The name of the transaction to use. */ + @Metadata(label = "transaction,advanced", + description = "The name of the transaction to use.") public void setTransactionName(String transactionName) { getConfiguration().setTransactionName(transactionName); } @@ -588,6 +726,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * The timeout value of the transaction (in seconds), if using transacted mode. */ + @Metadata(defaultValue = "-1", label = "transaction,advanced", + description = "The timeout value of the transaction (in seconds), if using transacted mode.") public void setTransactionTimeout(int transactionTimeout) { getConfiguration().setTransactionTimeout(transactionTimeout); } @@ -599,6 +739,11 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * This ensures that Camel is not started with failed connections. * The JMS producers is tested as well. */ + @Metadata(description = "Specifies whether to test the connection on startup." + + " This ensures that when Camel starts that all the JMS consumers have a valid connection to the JMS broker." + + " If a connection cannot be granted then Camel throws an exception on startup." + + " This ensures that Camel is not started with failed connections." + + " The JMS producers is tested as well.") public void setTestConnectionOnStartup(boolean testConnectionOnStartup) { getConfiguration().setTestConnectionOnStartup(testConnectionOnStartup); } @@ -612,6 +757,14 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * 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. */ + @Metadata(label = "advanced", + description = "Whether to startup the JmsConsumer 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.") public void setAsyncStartListener(boolean asyncStartListener) { getConfiguration().setAsyncStartListener(asyncStartListener); } @@ -619,6 +772,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Whether to stop the JmsConsumer message listener asynchronously, when stopping a route. */ + @Metadata(label = "advanced", + description = "Whether to stop the JmsConsumer message listener asynchronously, when stopping a route.") public void setAsyncStopListener(boolean asyncStopListener) { getConfiguration().setAsyncStopListener(asyncStopListener); } @@ -628,6 +783,10 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * if you touch the headers (get or set) during the route. Set this option to true to force Camel to send * the original JMS message that was received. */ + @Metadata(label = "producer,advanced", + description = "When using mapJmsMessage=false Camel will create a new JMS message to send to a new JMS destination" + + " if you touch the headers (get or set) during the route. Set this option to true to force Camel to send" + + " the original JMS message that was received.") public void setForceSendOriginalMessage(boolean forceSendOriginalMessage) { getConfiguration().setForceSendOriginalMessage(forceSendOriginalMessage); } @@ -638,6 +797,11 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * timeout value, and thus have per message individual timeout values. * See also the requestTimeoutCheckerInterval option. */ + @Metadata(defaultValue = "20000", label = "producer", + description = "The timeout for waiting for a reply when using the InOut Exchange Pattern (in milliseconds)." + + " The default is 20 seconds. You can include the header \"CamelJmsRequestTimeout\" to override this endpoint configured" + + " timeout value, and thus have per message individual timeout values." + + " See also the requestTimeoutCheckerInterval option.") public void setRequestTimeout(long requestTimeout) { getConfiguration().setRequestTimeout(requestTimeout); } @@ -647,6 +811,10 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * By default Camel checks once per second. But if you must react faster when a timeout occurs, * then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. */ + @Metadata(defaultValue = "1000", label = "advanced", + description = "Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS." + + " By default Camel checks once per second. But if you must react faster when a timeout occurs," + + " then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout.") public void setRequestTimeoutCheckerInterval(long requestTimeoutCheckerInterval) { getConfiguration().setRequestTimeoutCheckerInterval(requestTimeoutCheckerInterval); } @@ -658,6 +826,12 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. * You must enable this option on both the producer and consumer side, so Camel knows the payloads is an Exchange and not a regular payload. */ + @Metadata(label = "advanced", + description = "You can transfer the exchange over the wire instead of just the body and headers." + + " 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." + + " You must enable this option on both the producer and consumer side, so Camel knows the payloads is an Exchange and not a regular payload.") public void setTransferExchange(boolean transferExchange) { getConfiguration().setTransferExchange(transferExchange); } @@ -672,6 +846,15 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * The original Exception on the consumer side can be wrapped in an outer exception * such as org.apache.camel.RuntimeCamelException when returned to the producer. */ + @Metadata(label = "advanced", + description = "If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side," + + " then the caused Exception will be send back in response as a javax.jms.ObjectMessage." + + " If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge" + + " in your routing - for example, using persistent queues to enable robust routing." + + " Notice that if you also have transferExchange enabled, this option takes precedence." + + " The caught exception is required to be serializable." + + " The original Exception on the consumer side can be wrapped in an outer exception" + + " such as org.apache.camel.RuntimeCamelException when returned to the producer.") public void setTransferException(boolean transferException) { getConfiguration().setTransferException(transferException); } @@ -684,6 +867,12 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * <p/> * You may want to enable this when using Camel components that support faults such as SOAP based such as cxf or spring-ws. */ + @Metadata(label = "advanced", + description = "If enabled and you are using Request Reply messaging (InOut) and an Exchange failed with a SOAP fault (not exception) on the consumer side," + + " then the fault flag on Message#isFault() will be send back in the response as a JMS header with the key" + + " org.apache.camel.component.jms.JmsConstants#JMS_TRANSFER_FAULT#JMS_TRANSFER_FAULT." + + " If the client is Camel, the returned fault flag will be set on the {@link org.apache.camel.Message#setFault(boolean)}." + + " You may want to enable this when using Camel components that support faults such as SOAP based such as cxf or spring-ws.") public void setTransferFault(boolean transferFault) { getConfiguration().setTransferFault(transferFault); } @@ -692,6 +881,9 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Allows you to use your own implementation of the org.springframework.jms.core.JmsOperations interface. * Camel uses JmsTemplate as default. Can be used for testing purpose, but not used much as stated in the spring API docs. */ + @Metadata(label = "advanced", + description = "Allows you to use your own implementation of the org.springframework.jms.core.JmsOperations interface." + + " Camel uses JmsTemplate as default. Can be used for testing purpose, but not used much as stated in the spring API docs.") public void setJmsOperations(JmsOperations jmsOperations) { getConfiguration().setJmsOperations(jmsOperations); } @@ -700,6 +892,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * A pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver * (for example, to lookup the real destination in a JNDI registry). */ + @Metadata(label = "advanced", description = "A pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver" + + " (for example, to lookup the real destination in a JNDI registry).") public void setDestinationResolver(DestinationResolver destinationResolver) { getConfiguration().setDestinationResolver(destinationResolver); } @@ -712,6 +906,13 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * See Camel JMS documentation for more details, and especially the notes about the implications if running in a clustered environment, * and the fact that Shared reply queues has lower performance than its alternatives Temporary and Exclusive. */ + @Metadata(label = "producer", + description = "Allows for explicitly specifying which kind of strategy to use for replyTo queues when doing request/reply over JMS." + + " Possible values are: Temporary, Shared, or Exclusive." + + " By default Camel will use temporary queues. However if replyTo has been configured, then Shared is used by default." + + " This option allows you to use exclusive queues instead of shared ones." + + " See Camel JMS documentation for more details, and especially the notes about the implications if running in a clustered environment," + + " and the fact that Shared reply queues has lower performance than its alternatives Temporary and Exclusive.") public void setReplyToType(ReplyToType replyToType) { getConfiguration().setReplyToType(replyToType); } @@ -723,6 +924,12 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * values from the endpoint instead. So, when using this option, the headers override the values from the endpoint. * The explicitQosEnabled option, by contrast, will only use options set on the endpoint, and not values from the message header. */ + @Metadata(label = "producer", + description = "Set to true, if you want to send message using the QoS settings specified on the message," + + " instead of the QoS settings on the JMS endpoint. The following three headers are considered JMSPriority, JMSDeliveryMode," + + " and JMSExpiration. You can provide all or only some of them. If not provided, Camel will fall back to use the" + + " values from the endpoint instead. So, when using this option, the headers override the values from the endpoint." + + " The explicitQosEnabled option, by contrast, will only use options set on the endpoint, and not values from the message header.") public void setPreserveMessageQos(boolean preserveMessageQos) { getConfiguration().setPreserveMessageQos(preserveMessageQos); } @@ -736,6 +943,14 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Note if transacted has been enabled, then asyncConsumer=true does not run asynchronously, as transaction * must be executed synchronously (Camel 3.0 may support async transactions). */ + @Metadata(label = "consumer", + description = "Whether the JmsConsumer processes the Exchange asynchronously." + + " If enabled then the JmsConsumer may pickup the next message from the JMS queue," + + " while the previous message is being processed asynchronously (by the Asynchronous Routing Engine)." + + " This means that messages may be processed not 100% strictly in order. If disabled (as default)" + + " then the Exchange is fully processed before the JmsConsumer will pickup the next message from the JMS queue." + + " Note if transacted has been enabled, then asyncConsumer=true does not run asynchronously, as transaction" + + " must be executed synchronously (Camel 3.0 may support async transactions).") public void setAsyncConsumer(boolean asyncConsumer) { getConfiguration().setAsyncConsumer(asyncConsumer); } @@ -743,6 +958,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Whether to allow sending messages with no body. If this option is false and the message body is null, then an JMSException is thrown. */ + @Metadata(defaultValue = "true", label = "producer,advanced", + description = "Whether to allow sending messages with no body. If this option is false and the message body is null, then an JMSException is thrown.") public void setAllowNullBody(boolean allowNullBody) { getConfiguration().setAllowNullBody(allowNullBody); } @@ -752,6 +969,10 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Enabling this option will enrich the Camel Exchange with the actual JMSMessageID * that was used by the JMS client when the message was sent to the JMS destination. */ + @Metadata(label = "producer,advanced", + description = "Only applicable when sending to JMS destination using InOnly (eg fire and forget)." + + " Enabling this option will enrich the Camel Exchange with the actual JMSMessageID" + + " that was used by the JMS client when the message was sent to the JMS destination.") public void setIncludeSentJMSMessageID(boolean includeSentJMSMessageID) { getConfiguration().setIncludeSentJMSMessageID(includeSentJMSMessageID); } @@ -761,6 +982,10 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * 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. */ + @Metadata(label = "advanced", + description = "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.") public void setIncludeAllJMSXProperties(boolean includeAllJMSXProperties) { getConfiguration().setIncludeAllJMSXProperties(includeAllJMSXProperties); } @@ -775,6 +1000,15 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * The use of ThreadPool is recommended to reduce "thread trash" in elastic configurations * with dynamically increasing and decreasing concurrent consumers. */ + @Metadata(label = "consumer,advanced", + description = "Specifies what default TaskExecutor type to use in the DefaultMessageListenerContainer," + + " for both consumer endpoints and the ReplyTo consumer of producer endpoints." + + " Possible values: SimpleAsync (uses Spring's SimpleAsyncTaskExecutor) or ThreadPool" + + " (uses Spring's ThreadPoolTaskExecutor with optimal values - cached threadpool-like)." + + " If not set, it defaults to the previous behaviour, which uses a cached thread pool" + + " for consumer endpoints and SimpleAsync for reply consumers." + + " The use of ThreadPool is recommended to reduce thread trash in elastic configurations" + + " with dynamically increasing and decreasing concurrent consumers.") public void setDefaultTaskExecutorType(DefaultTaskExecutorType type) { getConfiguration().setDefaultTaskExecutorType(type); } @@ -787,6 +1021,13 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy * and refer to it using the # notation. */ + @Metadata(label = "advanced", + description = "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.") public void setJmsKeyFormatStrategy(JmsKeyFormatStrategy jmsKeyFormatStrategy) { getConfiguration().setJmsKeyFormatStrategy(jmsKeyFormatStrategy); } @@ -850,6 +1091,9 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli * Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS * and when the option useMessageIDAsCorrelationID is enabled. */ + @Metadata(defaultValue = "50", label = "advanced", + description = "Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS" + + " and when the option useMessageIDAsCorrelationID is enabled.") public void setWaitForProvisionCorrelationToBeUpdatedCounter(int counter) { getConfiguration().setWaitForProvisionCorrelationToBeUpdatedCounter(counter); } @@ -861,6 +1105,8 @@ public class JmsComponent extends HeaderFilterStrategyComponent implements Appli /** * Interval in millis to sleep each time while waiting for provisional correlation id to be updated. */ + @Metadata(defaultValue = "100", label = "advanced", + description = "Interval in millis to sleep each time while waiting for provisional correlation id to be updated.") public void setWaitForProvisionCorrelationToBeUpdatedThreadSleepingTime(long sleepingTime) { getConfiguration().setWaitForProvisionCorrelationToBeUpdatedThreadSleepingTime(sleepingTime); } http://git-wip-us.apache.org/repos/asf/camel/blob/8c0f3c3c/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java index 3a99b5e..be84a8a 100644 --- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java +++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java @@ -79,7 +79,8 @@ public class JmsConfiguration implements Cloneable { @UriParam(defaultValue = "AUTO_ACKNOWLEDGE", enums = "SESSION_TRANSACTED,CLIENT_ACKNOWLEDGE,AUTO_ACKNOWLEDGE,DUPS_OK_ACKNOWLEDGE", label = "consumer", description = "The JMS acknowledgement name, which is one of: SESSION_TRANSACTED, CLIENT_ACKNOWLEDGE, AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE") private String acknowledgementModeName; - @UriParam(label = "advanced") + @UriParam(label = "advanced", description = "A pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver" + + " (for example, to lookup the real destination in a JNDI registry).") private DestinationResolver destinationResolver; // Used to configure the spring Container @UriParam(label = "advanced", @@ -116,7 +117,7 @@ public class JmsConfiguration implements Cloneable { @UriParam(label = "consumer,advanced", description = "Specifies whether the consumer accept messages while it is stopping." + " You may consider enabling this option, if you start and stop JMS routes at runtime, while there are still messages" - + " enqued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected," + + " enqueued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected," + " and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message" + " may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option.") private boolean acceptMessagesWhileStopping; @@ -131,6 +132,8 @@ public class JmsConfiguration implements Cloneable { @UriParam(label = "consumer,advanced", description = "Specifies whether the listener session should be exposed when consuming messages.") private boolean exposeListenerSession = true; + @UriParam(label = "consumer,advanced", + description = "Allows you to specify a custom task executor for consuming messages.") private TaskExecutor taskExecutor; @UriParam(label = "advanced", description = "Specifies whether to inhibit the delivery of messages published by its own connection.") @@ -807,7 +810,7 @@ public class JmsConfiguration implements Cloneable { /** * Specifies whether the consumer accept messages while it is stopping. * You may consider enabling this option, if you start and stop JMS routes at runtime, while there are still messages - * enqued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected, + * enqueued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected, * and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message * may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option. */ @@ -817,7 +820,7 @@ public class JmsConfiguration implements Cloneable { /** * Whether the {@link DefaultMessageListenerContainer} used in the reply managers for request-reply messaging allow - * the {@link DefaultMessageListenerContainer.runningAllowed} flag to quick stop in case {@link JmsConfiguration#isAcceptMessagesWhileStopping()} + * the {@link DefaultMessageListenerContainer#runningAllowed()} flag to quick stop in case {@link JmsConfiguration#isAcceptMessagesWhileStopping()} * is enabled, and {@link org.apache.camel.CamelContext} is currently being stopped. This quick stop ability is enabled by * default in the regular JMS consumers but to enable for reply managers you must enable this flag. */