You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "DenisIstomin (via GitHub)" <gi...@apache.org> on 2023/08/22 20:48:07 UTC

[GitHub] [camel] DenisIstomin opened a new pull request, #11178: Fix usage of FQQN with toD

DenisIstomin opened a new pull request, #11178:
URL: https://github.com/apache/camel/pull/11178

   CAMEL-19777
   Fixes handling of FQQN with `.toD` endpoint:
   ```
   // DOES NOT WORK
   .setHeader("fqqn", constant("addr::q1"))
   .toD("jms:queue:${header.fqqn}");
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus merged pull request #11178: CAMEL-19777: Fix usage of FQQN with toD

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #11178:
URL: https://github.com/apache/camel/pull/11178


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #11178: Fix usage of FQQN with toD

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11178:
URL: https://github.com/apache/camel/pull/11178#issuecomment-1688911965

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :camel: Maintainers, please note that first-time contributors *require manual approval* for the GitHub Actions to run.
   
   :warning: Please note that the changes on this PR may be **tested automatically** if they change components.
   
   :robot: Use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] DenisIstomin commented on pull request #11178: CAMEL-19777: Fix usage of FQQN with toD

Posted by "DenisIstomin (via GitHub)" <gi...@apache.org>.
DenisIstomin commented on PR #11178:
URL: https://github.com/apache/camel/pull/11178#issuecomment-1689678325

   > I wonder why you use colons in JMS queue names ?
   
   This is a part of Artemis address model: https://activemq.apache.org/components/artemis/documentation/2.0.0/address-model.html
   
   As far as I know, it is not a part of JMS specification, but rather extension from Artemis side.
   And it does not contradict with JMS specification:
   
   ```
   <configuration ...>
     <core ...>
       ...
       <addresses>
          <address name="foo">
             <anycast>
                <queue name="q1" />
                <queue name="q2" />
             </anycast>
          </address>
       </addresses>
     </core>
   </configuration>
   ```
   _In the client code, use both the address name and the queue name when requesting a connection from the broker. Remember to use two colons, ::, to separate the names, as in the example Java code below._
   
   ```
   String FQQN = "foo::q1";
   Queue q1 session.createQueue(FQQN);
   MessageConsumer consumer = session.createConsumer(q1);
   ```
   
   Camel is able to handle this address model, except few cases with `toD`. Static `to` works as expected.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] DenisIstomin commented on pull request #11178: CAMEL-19777: Fix usage of FQQN with toD

Posted by "DenisIstomin (via GitHub)" <gi...@apache.org>.
DenisIstomin commented on PR #11178:
URL: https://github.com/apache/camel/pull/11178#issuecomment-1688970614

   /component-test camel-jms


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #11178: CAMEL-19777: Fix usage of FQQN with toD

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11178:
URL: https://github.com/apache/camel/pull/11178#issuecomment-1688970832

   :robot: The Apache Camel test robot will run the tests for you :+1:


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #11178: CAMEL-19777: Fix usage of FQQN with toD

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #11178:
URL: https://github.com/apache/camel/pull/11178#issuecomment-1689732892

   Can you see if you get test error locally in ActiveMQConsumeWildcardQueuesTest


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] DenisIstomin commented on pull request #11178: CAMEL-19777: Fix usage of FQQN with toD

Posted by "DenisIstomin (via GitHub)" <gi...@apache.org>.
DenisIstomin commented on PR #11178:
URL: https://github.com/apache/camel/pull/11178#issuecomment-1689766633

   Latest PR Build: org.apache.camel.component.jms.JmsPriorityConsumerTest.testPriority is failing
   Looks like there are some flaky tests in camel-jms. But I did not observe that flakiness locally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #11178: CAMEL-19777: Fix usage of FQQN with toD

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #11178:
URL: https://github.com/apache/camel/pull/11178#issuecomment-1689282323

   I wonder why you use colons in JMS queue names ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on a diff in pull request #11178: CAMEL-19777: Fix usage of FQQN with toD

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on code in PR #11178:
URL: https://github.com/apache/camel/pull/11178#discussion_r1302694837


##########
components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java:
##########
@@ -109,8 +109,15 @@ private String parseDestinationName(String uri) {
         if (pos != -1) {
             uri = uri.substring(0, pos);
         }
-        // destination name is after last colon
-        pos = uri.lastIndexOf(':');
+
+        // destination name is after last colon (but not after double colon)
+        int posDoubleCol = uri.indexOf("::");
+        if (posDoubleCol != -1) {
+            pos = uri.substring(0, posDoubleCol).lastIndexOf(':');
+        } else {
+            pos = uri.lastIndexOf(':');
+        }
+

Review Comment:
   Please, can you take a look at `StringHelper` (I guess `between` method) and try to use that, instead? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] DenisIstomin commented on pull request #11178: CAMEL-19777: Fix usage of FQQN with toD

Posted by "DenisIstomin (via GitHub)" <gi...@apache.org>.
DenisIstomin commented on PR #11178:
URL: https://github.com/apache/camel/pull/11178#issuecomment-1689760257

   When I run it locally for the whole component, it says:
   >mvn clean install -Psourcecheck
   >
   >[INFO] Tests run: **0**, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.078 s -- in >org.apache.camel.component.jms.activemq.ActiveMQConsumeWildcardQueuesTest
   
   When I run it with:
   >mvn clean -Dtest=ActiveMQConsumeWildcardQueuesTest test
   [INFO] Running org.apache.camel.component.jms.activemq.ActiveMQConsumeWildcardQueuesTest
   [INFO] Tests run: **1**, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.871 s -- in org.apache.camel.component.jms.activemq.ActiveMQConsumeWildcardQueuesTest
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] DenisIstomin commented on a diff in pull request #11178: CAMEL-19777: Fix usage of FQQN with toD

Posted by "DenisIstomin (via GitHub)" <gi...@apache.org>.
DenisIstomin commented on code in PR #11178:
URL: https://github.com/apache/camel/pull/11178#discussion_r1302797596


##########
components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsSendDynamicAware.java:
##########
@@ -109,8 +109,15 @@ private String parseDestinationName(String uri) {
         if (pos != -1) {
             uri = uri.substring(0, pos);
         }
-        // destination name is after last colon
-        pos = uri.lastIndexOf(':');
+
+        // destination name is after last colon (but not after double colon)
+        int posDoubleCol = uri.indexOf("::");
+        if (posDoubleCol != -1) {
+            pos = uri.substring(0, posDoubleCol).lastIndexOf(':');
+        } else {
+            pos = uri.lastIndexOf(':');
+        }
+

Review Comment:
   Thanks, made use of `StringHelper`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org