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 2022/06/01 19:45:39 UTC

[camel] branch camel-3.14.x updated (9459a8948cd -> 6154019ab2c)

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

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


    from 9459a8948cd CAMEL-17949 -  Infinite loop when setting retries
     new 1cb148ed9f4 [CAMEL-18459] Fixes incorrect JmsSendDynamicAware parsing for destinations that starts with "schema://" and dose not have queue: or topic: prefix
     new 6154019ab2c [CAMEL-18459] redundant empty line removed

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/camel/component/jms/JmsSendDynamicAware.java | 1 +
 .../org/apache/camel/component/jms/JmsToDSendDynamicTest.java    | 9 +++++++++
 2 files changed, 10 insertions(+)


[camel] 01/02: [CAMEL-18459] Fixes incorrect JmsSendDynamicAware parsing for destinations that starts with "schema://" and dose not have queue: or topic: prefix

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1cb148ed9f4b75b10ccd1eac5ff06a29b82fbf45
Author: Artem Starikov <ar...@gmail.com>
AuthorDate: Wed Jun 1 18:50:17 2022 +0300

    [CAMEL-18459] Fixes incorrect JmsSendDynamicAware parsing for destinations that starts with "schema://" and dose not have queue: or topic: prefix
---
 .../java/org/apache/camel/component/jms/JmsSendDynamicAware.java | 2 ++
 .../org/apache/camel/component/jms/JmsToDSendDynamicTest.java    | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java
index 0a42ce7c913..6329db3f106 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java
@@ -104,10 +104,12 @@ public class JmsSendDynamicAware extends ServiceSupport implements SendDynamicAw
 
     private String parseDestinationName(String uri) {
         // strip query
+        uri = uri.replaceFirst(scheme + "://", ":");
         int pos = uri.indexOf('?');
         if (pos != -1) {
             uri = uri.substring(0, pos);
         }
+
         // destination name is after last colon
         pos = uri.lastIndexOf(':');
         if (pos != -1) {
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsToDSendDynamicTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsToDSendDynamicTest.java
index fb75eed1bbb..cd227b1b471 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsToDSendDynamicTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsToDSendDynamicTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.jms;
 import javax.jms.ConnectionFactory;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
@@ -43,6 +44,13 @@ public class JmsToDSendDynamicTest extends CamelTestSupport {
         out = consumer.receiveBody("activemq:queue:beer", 2000, String.class);
         assertEquals("Hello beer", out);
     }
+    @Test
+    public void testToDSlashed() {
+        template.sendBodyAndHeader("direct:startSlashed", "Hello bar", "where", "bar");
+
+        Exchange exchange = consumer.receive("activemq://bar", 2000);
+        exchange.getMessage().getHeader(JmsConstants.JMS_DESTINATION_NAME);
+    }
 
     @Override
     protected CamelContext createCamelContext() throws Exception {
@@ -61,6 +69,7 @@ public class JmsToDSendDynamicTest extends CamelTestSupport {
             public void configure() throws Exception {
                 // route message dynamic using toD
                 from("direct:start").toD("activemq:queue:${header.where}");
+                from("direct:startSlashed").toD("activemq://${header.where}");
             }
         };
     }


[camel] 02/02: [CAMEL-18459] redundant empty line removed

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6154019ab2c8b277710a974a4a21f9de9365464a
Author: Artem Starikov <ar...@gmail.com>
AuthorDate: Wed Jun 1 19:10:25 2022 +0300

    [CAMEL-18459] redundant empty line removed
---
 .../main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java    | 1 -
 1 file changed, 1 deletion(-)

diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java
index 6329db3f106..310f63525b6 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java
@@ -109,7 +109,6 @@ public class JmsSendDynamicAware extends ServiceSupport implements SendDynamicAw
         if (pos != -1) {
             uri = uri.substring(0, pos);
         }
-
         // destination name is after last colon
         pos = uri.lastIndexOf(':');
         if (pos != -1) {