'Camel AWS SQS and concurrentConsumers
Camel version: camel-aws2-sqs-starter: 3.12.0
I am trying to use and understand concurentConsumers with a SQS queue:
from("aws2-sqs://queuexxx?concurrentConsumers=5&amazonSQSClient=#sqsClient&waitTimeSeconds=20")
.process(exchange -> {
System.out.println("Message received...");
})
.process(exchange -> {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}});
With the above queue, if I send 3 messages at the same time, I have to wait 5 seconds to see the second message ("Message received...") and 5 more seconds to see the third one. My understanding of concurentConsumers (also described here) is that with a value of 5 I would see the 3 messages at the same time since 3 threads will consume them. If I add the Thread.sleep in a seda route, I'm having this behavior (= The 3 messages are read at the same time).
Turning on the Camel logs it seems that the next polling is done only after the Delete for the previous message is made (which is with a delay of 5s).
I would understand the above behavior with concurentConsumers=1 but I don't with concurentConsumers=5. Could someone tell me what I've misunderstood ?
Thank you in advance!
Solution 1:[1]
I ran into the same issue. I believe it relates to this defect https://issues.apache.org/jira/browse/CAMEL-17592. According to JIRA it will be fixed in the next camel release.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | David Atkins |
