You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/07/30 08:51:16 UTC

[camel] branch camel-3.11.x updated: CAMEL-16811: camel-sjms2 - Fixed timeToLive = -1 should not be used.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-3.11.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.11.x by this push:
     new 2c75482  CAMEL-16811: camel-sjms2 - Fixed timeToLive = -1 should not be used.
2c75482 is described below

commit 2c7548257389414d1e1acf12b969b6ac02c2d027
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Jul 30 10:45:17 2021 +0200

    CAMEL-16811: camel-sjms2 - Fixed timeToLive = -1 should not be used.
---
 .../apache/camel/catalog/docs/sjms2-component.adoc |  6 +--
 .../apache/camel/component/sjms/SjmsTemplate.java  |  2 +-
 .../camel/component/sjms/jms/JmsBinding.java       | 59 +++++-----------------
 .../sjms/producer/InOnlyQueueProducerTest.java     |  2 +-
 .../org/apache/camel/component/sjms2/sjms2.json    |  6 +--
 .../camel-sjms2/src/main/docs/sjms2-component.adoc |  6 +--
 .../camel/component/sjms2/Sjms2Endpoint.java       |  6 +--
 .../sjms2/producer/InOnlyQueueProducerTest.java    | 32 ++++++++++--
 .../component/sjms2/support/Jms2TestSupport.java   |  4 +-
 .../endpoint/dsl/Sjms2EndpointBuilderFactory.java  | 11 ++--
 .../modules/ROOT/pages/sjms2-component.adoc        |  6 +--
 11 files changed, 66 insertions(+), 74 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms2-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms2-component.adoc
index 872792e..2ac8caa 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms2-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms2-component.adoc
@@ -137,11 +137,11 @@ with the following path and query parameters:
 | *bridgeErrorHandler* (consumer) | 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 or ERROR level and ignored. | false | boolean
 | *clientId* (consumer) | 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. |  | String
 | *concurrentConsumers* (consumer) | 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. | 1 | int
-| *durable* (consumer) | Sets topic consumer to durable. | false | boolean
+| *durable* (consumer) | Sets the topic to be durable | false | boolean
 | *durableSubscriptionName* (consumer) | The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well. |  | String
 | *replyToDeliveryPersistent* (consumer) | Specifies whether to use persistent delivery by default for replies. | true | boolean
-| *shared* (consumer) | Sets the consumer to shared. | false | boolean
-| *subscriptionId* (consumer) | Sets the subscription Id, required for durable or shared topics. |  | String
+| *shared* (consumer) | Sets the topic to be shared | false | boolean
+| *subscriptionId* (consumer) | Sets the topic subscription id, required for durable or shared topics. |  | String
 | *eagerLoadingOfProperties* (consumer) | Enables eager loading of JMS properties and payload 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. See also the option eagerPoisonBody. | false | boolean
 | *eagerPoisonBody* (consumer) | If eagerLoadingOfProperties is enabled and the JMS message payload (JMS body or JMS properties) is poison (cannot be read/mapped), then set this text as the message body instead so the message can be processed (the cause of the poison are already stored as exception on the Exchange). This can be turned off by setting eagerPoisonBody=false. See also the option eagerLoadingOfProperties. | Poison JMS message due to ${exception.message} | String
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
diff --git a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsTemplate.java b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsTemplate.java
index b173130..701902c 100644
--- a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsTemplate.java
+++ b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsTemplate.java
@@ -69,7 +69,7 @@ public class SjmsTemplate {
             this.priority = priority;
             this.explicitQosEnabled = true;
         }
-        if (timeToLive != 0) {
+        if (timeToLive > 0) {
             this.timeToLive = timeToLive;
             this.explicitQosEnabled = true;
         }
diff --git a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsBinding.java b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsBinding.java
index fe36a1e..0eb9b4c 100644
--- a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsBinding.java
+++ b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsBinding.java
@@ -214,50 +214,18 @@ public class JmsBinding {
      */
     public Message makeJmsMessage(Exchange exchange, org.apache.camel.Message camelMessage, Session session, Exception cause)
             throws JMSException {
-        Message answer = null;
-
-        // TODO: look at supporting some of these options
-
-        /*        boolean alwaysCopy = endpoint != null && endpoint.getConfiguration().isAlwaysCopyMessage();
-        boolean force = endpoint != null && endpoint.getConfiguration().isForceSendOriginalMessage();
-        if (!alwaysCopy && camelMessage instanceof JmsMessage) {
-            JmsMessage jmsMessage = (JmsMessage)camelMessage;
-            if (!jmsMessage.shouldCreateNewMessage() || force) {
-                answer = jmsMessage.getJmsMessage();
-        
-                if (!force) {
-                    // answer must match endpoint type
-                    JmsMessageType type = endpoint != null ? endpoint.getConfiguration().getJmsMessageType() : null;
-                    if (type != null && answer != null) {
-                        if (type == JmsMessageType.Text) {
-                            answer = answer instanceof TextMessage ? answer : null;
-                        } else if (type == JmsMessageType.Bytes) {
-                            answer = answer instanceof BytesMessage ? answer : null;
-                        } else if (type == JmsMessageType.Map) {
-                            answer = answer instanceof MapMessage ? answer : null;
-                        } else if (type == JmsMessageType.Object) {
-                            answer = answer instanceof ObjectMessage ? answer : null;
-                        } else if (type == JmsMessageType.Stream) {
-                            answer = answer instanceof StreamMessage ? answer : null;
-                        }
-                    }
-                }
-            }
-        }
-        */
-
-        if (answer == null) {
-            if (cause != null) {
-                // an exception occurred so send it as response
-                LOG.debug("Will create JmsMessage with caused exception: {}", cause.getMessage(), cause);
-                // create jms message containing the caused exception
-                answer = createJmsMessage(cause, session);
-            } else {
-                // create regular jms message using the camel message body
-                answer = createJmsMessage(exchange, camelMessage.getBody(), camelMessage.getHeaders(), session,
-                        exchange.getContext());
-                appendJmsProperties(answer, exchange, camelMessage.getHeaders());
-            }
+        Message answer;
+
+        if (cause != null) {
+            // an exception occurred so send it as response
+            LOG.debug("Will create JmsMessage with caused exception: {}", cause.getMessage(), cause);
+            // create jms message containing the caused exception
+            answer = createJmsMessage(cause, session);
+        } else {
+            // create regular jms message using the camel message body
+            answer = createJmsMessage(exchange, camelMessage.getBody(), camelMessage.getHeaders(), session,
+                    exchange.getContext());
+            appendJmsProperties(answer, exchange, camelMessage.getHeaders());
         }
 
         if (answer != null && messageCreatedStrategy != null) {
@@ -404,9 +372,8 @@ public class JmsBinding {
     protected Message createJmsMessage(
             Exchange exchange, Object body, Map<String, Object> headers, Session session, CamelContext context)
             throws JMSException {
-        JmsMessageType type = null;
 
-        type = getJMSMessageTypeForBody(exchange, body, headers, session, context);
+        JmsMessageType type = getJMSMessageTypeForBody(exchange, body, headers, session, context);
 
         // create the JmsMessage based on the type
         if (type != null) {
diff --git a/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/producer/InOnlyQueueProducerTest.java b/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/producer/InOnlyQueueProducerTest.java
index 2abaa0a..78f2602 100644
--- a/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/producer/InOnlyQueueProducerTest.java
+++ b/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/producer/InOnlyQueueProducerTest.java
@@ -97,7 +97,7 @@ public class InOnlyQueueProducerTest extends JmsTestSupport {
         return new RouteBuilder() {
             public void configure() {
                 from("direct:start")
-                        .to("sjms:queue:" + TEST_DESTINATION_NAME);
+                        .to("sjms:queue:" + TEST_DESTINATION_NAME + "?deliveryMode=1");
 
                 from("direct:finish")
                         .to("log:test.log.1?showBody=true", "mock:result");
diff --git a/components/camel-sjms2/src/generated/resources/org/apache/camel/component/sjms2/sjms2.json b/components/camel-sjms2/src/generated/resources/org/apache/camel/component/sjms2/sjms2.json
index 078f469..bfd1ca2 100644
--- a/components/camel-sjms2/src/generated/resources/org/apache/camel/component/sjms2/sjms2.json
+++ b/components/camel-sjms2/src/generated/resources/org/apache/camel/component/sjms2/sjms2.json
@@ -47,11 +47,11 @@
     "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 m [...]
     "clientId": { "kind": "parameter", "displayName": "Client Id", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "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 pref [...]
     "concurrentConsumers": { "kind": "parameter", "displayName": "Concurrent Consumers", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1, "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 r [...]
-    "durable": { "kind": "parameter", "displayName": "Durable", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets topic consumer to durable." },
+    "durable": { "kind": "parameter", "displayName": "Durable", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets the topic to be durable" },
     "durableSubscriptionName": { "kind": "parameter", "displayName": "Durable Subscription Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well." },
     "replyToDeliveryPersistent": { "kind": "parameter", "displayName": "Reply To Delivery Persistent", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Specifies whether to use persistent delivery by default for replies." },
-    "shared": { "kind": "parameter", "displayName": "Shared", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets the consumer to shared." },
-    "subscriptionId": { "kind": "parameter", "displayName": "Subscription Id", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the subscription Id, required for durable or shared topics." },
+    "shared": { "kind": "parameter", "displayName": "Shared", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets the topic to be shared" },
+    "subscriptionId": { "kind": "parameter", "displayName": "Subscription Id", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the topic subscription id, required for durable or shared topics." },
     "eagerLoadingOfProperties": { "kind": "parameter", "displayName": "Eager Loading Of Properties", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enables eager loading of JMS properties and payload as soon as a message is loaded which generally is inefficient as the JMS properties may not be required but sometimes c [...]
     "eagerPoisonBody": { "kind": "parameter", "displayName": "Eager Poison Body", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Poison JMS message due to ${exception.message}", "description": "If eagerLoadingOfProperties is enabled and the JMS message payload (JMS body or JMS properties) is poison (cannot be read\/mapped), then se [...]
     "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
diff --git a/components/camel-sjms2/src/main/docs/sjms2-component.adoc b/components/camel-sjms2/src/main/docs/sjms2-component.adoc
index 872792e..2ac8caa 100644
--- a/components/camel-sjms2/src/main/docs/sjms2-component.adoc
+++ b/components/camel-sjms2/src/main/docs/sjms2-component.adoc
@@ -137,11 +137,11 @@ with the following path and query parameters:
 | *bridgeErrorHandler* (consumer) | 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 or ERROR level and ignored. | false | boolean
 | *clientId* (consumer) | 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. |  | String
 | *concurrentConsumers* (consumer) | 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. | 1 | int
-| *durable* (consumer) | Sets topic consumer to durable. | false | boolean
+| *durable* (consumer) | Sets the topic to be durable | false | boolean
 | *durableSubscriptionName* (consumer) | The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well. |  | String
 | *replyToDeliveryPersistent* (consumer) | Specifies whether to use persistent delivery by default for replies. | true | boolean
-| *shared* (consumer) | Sets the consumer to shared. | false | boolean
-| *subscriptionId* (consumer) | Sets the subscription Id, required for durable or shared topics. |  | String
+| *shared* (consumer) | Sets the topic to be shared | false | boolean
+| *subscriptionId* (consumer) | Sets the topic subscription id, required for durable or shared topics. |  | String
 | *eagerLoadingOfProperties* (consumer) | Enables eager loading of JMS properties and payload 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. See also the option eagerPoisonBody. | false | boolean
 | *eagerPoisonBody* (consumer) | If eagerLoadingOfProperties is enabled and the JMS message payload (JMS body or JMS properties) is poison (cannot be read/mapped), then set this text as the message body instead so the message can be processed (the cause of the poison are already stored as exception on the Exchange). This can be turned off by setting eagerPoisonBody=false. See also the option eagerLoadingOfProperties. | Poison JMS message due to ${exception.message} | String
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
diff --git a/components/camel-sjms2/src/main/java/org/apache/camel/component/sjms2/Sjms2Endpoint.java b/components/camel-sjms2/src/main/java/org/apache/camel/component/sjms2/Sjms2Endpoint.java
index 1902517..a035ae0 100644
--- a/components/camel-sjms2/src/main/java/org/apache/camel/component/sjms2/Sjms2Endpoint.java
+++ b/components/camel-sjms2/src/main/java/org/apache/camel/component/sjms2/Sjms2Endpoint.java
@@ -33,11 +33,11 @@ import org.apache.camel.spi.UriParam;
              syntax = "sjms2:destinationType:destinationName", category = { Category.MESSAGING })
 public class Sjms2Endpoint extends SjmsEndpoint implements AsyncEndpoint {
 
-    @UriParam(label = "consumer", description = "Sets the subscription Id, required for durable or shared topics.")
+    @UriParam(label = "consumer", description = "Sets the topic subscription id, required for durable or shared topics.")
     private String subscriptionId;
-    @UriParam(label = "consumer", description = "Sets topic consumer to durable.")
+    @UriParam(label = "consumer", description = "Sets the topic to be durable")
     private boolean durable;
-    @UriParam(label = "consumer", description = "Sets the consumer to shared.")
+    @UriParam(label = "consumer", description = "Sets the topic to be shared")
     private boolean shared;
 
     public Sjms2Endpoint() {
diff --git a/components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/producer/InOnlyQueueProducerTest.java b/components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/producer/InOnlyQueueProducerTest.java
index ac59fa2..68e7ee6 100644
--- a/components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/producer/InOnlyQueueProducerTest.java
+++ b/components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/producer/InOnlyQueueProducerTest.java
@@ -22,6 +22,7 @@ import javax.jms.TextMessage;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.sjms.SjmsConstants;
 import org.apache.camel.component.sjms2.support.Jms2TestSupport;
 import org.junit.jupiter.api.Test;
 
@@ -32,9 +33,6 @@ public class InOnlyQueueProducerTest extends Jms2TestSupport {
 
     private static final String TEST_DESTINATION_NAME = "sync.queue.producer.test";
 
-    public InOnlyQueueProducerTest() {
-    }
-
     @Test
     public void testInOnlyQueueProducer() throws Exception {
         MessageConsumer mc = createQueueConsumer(TEST_DESTINATION_NAME);
@@ -58,7 +56,32 @@ public class InOnlyQueueProducerTest extends Jms2TestSupport {
 
         mock.assertIsSatisfied();
         mc.close();
+    }
+
+    @Test
+    public void testInOnlyQueueProducerHeader() throws Exception {
+        MessageConsumer mc = createQueueConsumer("foo");
+        assertNotNull(mc);
+
+        final String expectedBody = "Hello World!";
+        MockEndpoint mock = getMockEndpoint("mock:result");
+
+        mock.expectedMessageCount(1);
+        mock.expectedBodiesReceived(expectedBody);
 
+        template.sendBodyAndHeader("direct:start", expectedBody, SjmsConstants.JMS_DESTINATION_NAME, "foo");
+        Message message = mc.receive(5000);
+        assertNotNull(message);
+        assertTrue(message instanceof TextMessage);
+
+        TextMessage tm = (TextMessage) message;
+        String text = tm.getText();
+        assertNotNull(text);
+
+        template.sendBody("direct:finish", text);
+
+        mock.assertIsSatisfied();
+        mc.close();
     }
 
     @Override
@@ -66,7 +89,8 @@ public class InOnlyQueueProducerTest extends Jms2TestSupport {
         return new RouteBuilder() {
             public void configure() {
                 from("direct:start")
-                        .to("sjms2:queue:" + TEST_DESTINATION_NAME);
+                        //                        .setHeader("JMSDeliveryMode", constant(1))
+                        .to("sjms2:queue:" + TEST_DESTINATION_NAME + "?deliveryMode=1");
 
                 from("direct:finish")
                         .to("log:test.log.1?showBody=true", "mock:result");
diff --git a/components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/support/Jms2TestSupport.java b/components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/support/Jms2TestSupport.java
index 33f0b5c..c932dc8 100644
--- a/components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/support/Jms2TestSupport.java
+++ b/components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/support/Jms2TestSupport.java
@@ -163,12 +163,12 @@ public class Jms2TestSupport extends CamelTestSupport {
 
     public MessageConsumer createQueueConsumer(String destination) throws Exception {
         return new Jms2ObjectFactory().createMessageConsumer(session,
-                destinationCreationStrategy.createDestination(session, destination, false), null, false, null, false, false);
+                destinationCreationStrategy.createDestination(session, destination, false), null, false, null, true, false);
     }
 
     public MessageConsumer createTopicConsumer(String destination, String messageSelector) throws Exception {
         return new Jms2ObjectFactory().createMessageConsumer(session,
-                destinationCreationStrategy.createDestination(session, destination, true), messageSelector, true, null, false,
+                destinationCreationStrategy.createDestination(session, destination, true), messageSelector, true, null, true,
                 false);
     }
 }
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sjms2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sjms2EndpointBuilderFactory.java
index 02762df..ecb4945 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sjms2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sjms2EndpointBuilderFactory.java
@@ -402,7 +402,7 @@ public interface Sjms2EndpointBuilderFactory {
             return this;
         }
         /**
-         * Sets topic consumer to durable.
+         * Sets the topic to be durable.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
          * 
@@ -417,7 +417,7 @@ public interface Sjms2EndpointBuilderFactory {
             return this;
         }
         /**
-         * Sets topic consumer to durable.
+         * Sets the topic to be durable.
          * 
          * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
          * type.
@@ -482,7 +482,7 @@ public interface Sjms2EndpointBuilderFactory {
             return this;
         }
         /**
-         * Sets the consumer to shared.
+         * Sets the topic to be shared.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
          * 
@@ -497,7 +497,7 @@ public interface Sjms2EndpointBuilderFactory {
             return this;
         }
         /**
-         * Sets the consumer to shared.
+         * Sets the topic to be shared.
          * 
          * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
          * type.
@@ -513,7 +513,8 @@ public interface Sjms2EndpointBuilderFactory {
             return this;
         }
         /**
-         * Sets the subscription Id, required for durable or shared topics.
+         * Sets the topic subscription id, required for durable or shared
+         * topics.
          * 
          * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
diff --git a/docs/components/modules/ROOT/pages/sjms2-component.adoc b/docs/components/modules/ROOT/pages/sjms2-component.adoc
index 9f86ffe..1e2dce0 100644
--- a/docs/components/modules/ROOT/pages/sjms2-component.adoc
+++ b/docs/components/modules/ROOT/pages/sjms2-component.adoc
@@ -139,11 +139,11 @@ with the following path and query parameters:
 | *bridgeErrorHandler* (consumer) | 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 or ERROR level and ignored. | false | boolean
 | *clientId* (consumer) | 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. |  | String
 | *concurrentConsumers* (consumer) | 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. | 1 | int
-| *durable* (consumer) | Sets topic consumer to durable. | false | boolean
+| *durable* (consumer) | Sets the topic to be durable | false | boolean
 | *durableSubscriptionName* (consumer) | The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well. |  | String
 | *replyToDeliveryPersistent* (consumer) | Specifies whether to use persistent delivery by default for replies. | true | boolean
-| *shared* (consumer) | Sets the consumer to shared. | false | boolean
-| *subscriptionId* (consumer) | Sets the subscription Id, required for durable or shared topics. |  | String
+| *shared* (consumer) | Sets the topic to be shared | false | boolean
+| *subscriptionId* (consumer) | Sets the topic subscription id, required for durable or shared topics. |  | String
 | *eagerLoadingOfProperties* (consumer) | Enables eager loading of JMS properties and payload 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. See also the option eagerPoisonBody. | false | boolean
 | *eagerPoisonBody* (consumer) | If eagerLoadingOfProperties is enabled and the JMS message payload (JMS body or JMS properties) is poison (cannot be read/mapped), then set this text as the message body instead so the message can be processed (the cause of the poison are already stored as exception on the Exchange). This can be turned off by setting eagerPoisonBody=false. See also the option eagerLoadingOfProperties. | Poison JMS message due to ${exception.message} | String
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler