You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/05/24 07:01:56 UTC

[GitHub] [camel-quarkus] koskom-alt opened a new issue, #3807: Duplicate JMSMessageIDs in camel-quarkus-activemq

koskom-alt opened a new issue, #3807:
URL: https://github.com/apache/camel-quarkus/issues/3807

   I'm trying to set up interaction with activemq. I am using **camel-quarkus-activemq**.
   In native mode, after restarting the service, I encountered the following problem:
   
   the message broker periodically resets to dlq instead of the destination queue with an error
   `dlqDeliveryFailureCause=java.lang.Throwable: duplicate from store for queue:test.queue.`
   As far as I can tell, the problem is that there are duplicate JMSMessageIDs. And they appear because the ActiveMQConnectionFactory is created during assembly, and not at the start of the service, respectively, the producerId is registered in advance in the image. And it does not change when the service is restarted, and even worse, this behavior makes horizontal scaling impossible, since each replica will have the same producerId and there will be contention for a unique JMSMessageID.
   
   route:
   ```
   @ApplicationScoped
   public class Test extends RouteBuilder {
       @Override
       public void configure() throws Exception {
   
           from("timer:foo?period=5000")
                   .to("activemq:queue:test.queue?exchangePattern=InOnly&includeSentJMSMessageID=true")
                   .log(LoggingLevel.INFO, "JMSMessageID: ${headers.JMSMessageID}")
           ;
       }
   }
   ```
   console output
   ```
           2022-05-23 16:05:19,668 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 3.16.0 (camel-1) started in 2ms (build:0ms init:1ms start:1ms)
           2022-05-23 16:05:20,695 INFO  [route1] (Camel (camel-1) thread #1 - timer://foo) JMSMessageID: ID:DESKTOP-J239TEE-60552-1653303787678-1:1:1:1:1
           2022-05-23 16:05:25,698 INFO  [route1] (Camel (camel-1) thread #1 - timer://foo) JMSMessageID: ID:DESKTOP-J239TEE-60552-1653303787678-1:1:1:1:2
           2022-05-23 16:05:27,034 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Shutdown thread) Apache Camel 3.16.0 (camel-1) shutdown in 3ms (uptime:7s367ms)
           2022-05-23 16:05:27,037 INFO  [io.quarkus] (Shutdown thread) code-with-quarkus stopped in 0.009s
   
                   __  ____  __  _____   ___  __ ____  ______
           --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
           -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
           --\___\_\____/_/ |_/_/|_/_/|_|\____/___/
   
           2022-05-23 16:05:33,621 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 3.16.0 (camel-1) started in 1ms (build:0ms init:1ms start:0ms)
           2022-05-23 16:05:34,654 INFO  [route1] (Camel (camel-1) thread #1 - timer://foo) JMSMessageID: ID:DESKTOP-J239TEE-60552-1653303787678-1:1:1:1:1
           2022-05-23 16:05:39,649 INFO  [route1] (Camel (camel-1) thread #1 - timer://foo) JMSMessageID: ID:DESKTOP-J239TEE-60552-1653303787678-1:1:1:1:2
   ```
   


-- 
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.apache.org

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


[GitHub] [camel-quarkus] jamesnetherton closed issue #3807: Duplicate JMSMessageIDs in camel-quarkus-activemq

Posted by GitBox <gi...@apache.org>.
jamesnetherton closed issue #3807: Duplicate JMSMessageIDs in camel-quarkus-activemq
URL: https://github.com/apache/camel-quarkus/issues/3807


-- 
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-quarkus] jamesnetherton commented on issue #3807: Duplicate JMSMessageIDs in camel-quarkus-activemq

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #3807:
URL: https://github.com/apache/camel-quarkus/issues/3807#issuecomment-1135509592

   The problem is likely due to the static initializer in `IdGenerator`.
   
   https://github.com/apache/activemq/blob/main/activemq-client/src/main/java/org/apache/activemq/util/IdGenerator.java#L42-L111
   
   The key parts of the id like host name & current system time will get baked into the native image and reused on every execution of the application.
   
   Maybe there's a way of overriding / reinitializing those parts. 


-- 
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