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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]