Hi Arnaud, Is your AWS queue type fifo or standard?
On Mon, 31 Jan, 2022, 17:31 Arnaud Level, <arn...@toro-intl.com> wrote: > Hi, > > (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 is > that with a value of 5 I would see the 3 messages at the same time since 3 > threads will consume them in parallel. 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 sent (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! > Arnaud >