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:44:29 UTC

[camel] branch main updated (43703611902 -> a038e86c4e2)

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

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


    from 43703611902 (chores) camel-javadoc-plugin: removed unused arguments
     new ff0e830aee8 [CAMEL-18459] Fixes incorrect JmsSendDynamicAware parsing for destinations that starts with "schema://" and dose not have queue: or topic: prefix
     new a038e86c4e2 [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 main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ff0e830aee89fc574ea667a7ccec46cc834f66e0
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 d2d972b8954..188f03830b0 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() {
                 // 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 main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a038e86c4e291e3ece0a1cf3b89cb20bd7b597bc
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) {