This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 136340e24577 CAMEL-26649: camel-aws2-sqs - the consumer receives up to
10 messages per poll by default (#29271)
136340e24577 is described below
commit 136340e24577f8a5cda6890324f6d29ae8b916bb
Author: Federico Mariani <[email protected]>
AuthorDate: Thu Nov 5 20:50:26 2026 +0100
CAMEL-26649: camel-aws2-sqs - the consumer receives up to 10 messages per
poll by default (#29271)
maxMessagesPerPoll had no default (0), which the consumer turns into a
receive request for one message, so each poll took one message, although the
option was documented as unlimited by default. It now defaults to 10, the
most that
SQS returns to one receive request.
The consumer code is unchanged: a value above 10 is still split into receive
requests of at most 10 messages (CAMEL-21031), and 0 or a negative value
still
receives one message per poll. The option description, the component doc and
the 4.24 upgrade guide now say so, together with the visibility timeout of
the messages that wait in a batch, long polling, and FIFO message groups.
maxMessagesPerPoll=1 keeps the previous behaviour.
Co-Authored-By: Claude <[email protected]>
---
.../apache/camel/catalog/components/aws2-sqs.json | 2 +-
.../camel/catalog/docs/aws2-sqs-component.adoc | 17 ++++
.../apache/camel/component/aws2/sqs/aws2-sqs.json | 2 +-
.../src/main/docs/aws2-sqs-component.adoc | 17 ++++
.../camel/component/aws2/sqs/Sqs2Endpoint.java | 12 ++-
.../aws2/sqs/SqsComponentConfigurationTest.java | 14 +++
.../sqs/SqsConsumerMaxMessagesPerPollTest.java | 111 +++++++++++++++++++++
.../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 18 ++++
.../endpoint/dsl/Sqs2EndpointBuilderFactory.java | 24 +++--
9 files changed, 205 insertions(+), 12 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-sqs.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-sqs.json
index f13e3f148eb7..b68a49b6229a 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-sqs.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-sqs.json
@@ -118,7 +118,7 @@
"extendMessageVisibility": { "index": 15, "kind": "parameter",
"displayName": "Extend Message Visibility", "group": "consumer", "label":
"consumer", "required": false, "type": "boolean", "javaType": "boolean",
"deprecated": false, "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "If enabled, then a scheduled background task
will keep extendin [...]
"kmsDataKeyReusePeriodSeconds": { "index": 16, "kind": "parameter",
"displayName": "Kms Data Key Reuse Period Seconds", "group": "consumer",
"label": "consumer", "required": false, "type": "integer", "javaType":
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "The length of time, in
seconds, for which Amazon SQS can reuse [...]
"kmsMasterKeyId": { "index": 17, "kind": "parameter", "displayName": "Kms
Master Key Id", "group": "consumer", "label": "consumer", "required": false,
"type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "The ID of an AWS-managed customer master key
(CMK) for Amazon SQS or a custom CMK." },
- "maxMessagesPerPoll": { "index": 18, "kind": "parameter", "displayName":
"Max Messages Per Poll", "group": "consumer", "label": "consumer", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "description": "Gets the maximum number of messages as
a limit to poll at each polling. Is default unlimited, but use 0 or negative
number to disable it as unlimited." },
+ "maxMessagesPerPoll": { "index": 18, "kind": "parameter", "displayName":
"Max Messages Per Poll", "group": "consumer", "label": "consumer", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 10, "description": "The maximum number
of messages to receive in each poll. A receive request returns at most 10
messages, so a value above 10 is split into several receive requests of at most
10 messages each, and 0 [...]
"messageAttributeNames": { "index": 19, "kind": "parameter",
"displayName": "Message Attribute Names", "group": "consumer", "label":
"consumer", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "A list of message
attribute names to receive when consuming. Multiple names can be [...]
"sendEmptyMessageWhenIdle": { "index": 20, "kind": "parameter",
"displayName": "Send Empty Message When Idle", "group": "consumer", "label":
"consumer", "required": false, "type": "boolean", "javaType": "boolean",
"deprecated": false, "autowired": false, "secret": false, "defaultValue":
false, "description": "If the polling consumer did not poll any files, you can
enable this option to send an empty message (no body) instead." },
"serverSideEncryptionEnabled": { "index": 21, "kind": "parameter",
"displayName": "Server Side Encryption Enabled", "group": "consumer", "label":
"consumer", "required": false, "type": "boolean", "javaType": "boolean",
"deprecated": false, "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Define if Server Side Encryption is enabled or
not on [...]
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sqs-component.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sqs-component.adoc
index 15bb3b088609..cd3fc132b2e0 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sqs-component.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sqs-component.adoc
@@ -59,6 +59,23 @@ This allows you, for instance, to know how many messages
exist in this
batch and for instance, let the Aggregator
aggregate this number of messages.
+Each poll receives up to `maxMessagesPerPoll` messages, 10 by default, which
is the most that SQS returns to one
+receive request. With a higher value, each poll sends several receive requests
of at most 10 messages, up to
+`concurrentRequestLimit` of them at the same time. With 0 or a negative value,
each poll receives one message.
+
+Without long polling, SQS answers a receive request from a sample of its
servers, so it often returns fewer messages
+than asked for, or none, while more are in the queue. Set `waitTimeSeconds`
(up to 20 seconds), or give the queue a
+`ReceiveMessageWaitTimeSeconds` attribute above 0, so that a receive request
waits for messages.
+
+The messages of a poll are routed one after the other, and the visibility
timeout of each one runs from its receive. If
+the route is slow, the last messages of a poll can become visible again before
their turn comes, and SQS then delivers
+them a second time. Enable `extendMessageVisibility` together with
`visibilityTimeout`, which keeps every message of
+the poll invisible until it is processed, or use a visibility timeout that
covers the processing of a whole poll.
+
+With a FIFO queue, a poll can receive several messages of the same message
group. A message that fails is not deleted,
+but the next messages of its group in the same poll are still routed and
deleted, so the failed message is delivered
+again after them. Set `maxMessagesPerPoll=1` if the messages of a group must
keep their order when one of them fails.
+
=== Static credentials, Default Credential Provider and Profile Credentials
Provider
You have the possibility of avoiding the usage of explicit static credentials
by specifying the useDefaultCredentialsProvider option and set it to true.
diff --git
a/components/camel-aws/camel-aws2-sqs/src/generated/resources/META-INF/org/apache/camel/component/aws2/sqs/aws2-sqs.json
b/components/camel-aws/camel-aws2-sqs/src/generated/resources/META-INF/org/apache/camel/component/aws2/sqs/aws2-sqs.json
index f13e3f148eb7..b68a49b6229a 100644
---
a/components/camel-aws/camel-aws2-sqs/src/generated/resources/META-INF/org/apache/camel/component/aws2/sqs/aws2-sqs.json
+++
b/components/camel-aws/camel-aws2-sqs/src/generated/resources/META-INF/org/apache/camel/component/aws2/sqs/aws2-sqs.json
@@ -118,7 +118,7 @@
"extendMessageVisibility": { "index": 15, "kind": "parameter",
"displayName": "Extend Message Visibility", "group": "consumer", "label":
"consumer", "required": false, "type": "boolean", "javaType": "boolean",
"deprecated": false, "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "If enabled, then a scheduled background task
will keep extendin [...]
"kmsDataKeyReusePeriodSeconds": { "index": 16, "kind": "parameter",
"displayName": "Kms Data Key Reuse Period Seconds", "group": "consumer",
"label": "consumer", "required": false, "type": "integer", "javaType":
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "The length of time, in
seconds, for which Amazon SQS can reuse [...]
"kmsMasterKeyId": { "index": 17, "kind": "parameter", "displayName": "Kms
Master Key Id", "group": "consumer", "label": "consumer", "required": false,
"type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "The ID of an AWS-managed customer master key
(CMK) for Amazon SQS or a custom CMK." },
- "maxMessagesPerPoll": { "index": 18, "kind": "parameter", "displayName":
"Max Messages Per Poll", "group": "consumer", "label": "consumer", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "description": "Gets the maximum number of messages as
a limit to poll at each polling. Is default unlimited, but use 0 or negative
number to disable it as unlimited." },
+ "maxMessagesPerPoll": { "index": 18, "kind": "parameter", "displayName":
"Max Messages Per Poll", "group": "consumer", "label": "consumer", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 10, "description": "The maximum number
of messages to receive in each poll. A receive request returns at most 10
messages, so a value above 10 is split into several receive requests of at most
10 messages each, and 0 [...]
"messageAttributeNames": { "index": 19, "kind": "parameter",
"displayName": "Message Attribute Names", "group": "consumer", "label":
"consumer", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "A list of message
attribute names to receive when consuming. Multiple names can be [...]
"sendEmptyMessageWhenIdle": { "index": 20, "kind": "parameter",
"displayName": "Send Empty Message When Idle", "group": "consumer", "label":
"consumer", "required": false, "type": "boolean", "javaType": "boolean",
"deprecated": false, "autowired": false, "secret": false, "defaultValue":
false, "description": "If the polling consumer did not poll any files, you can
enable this option to send an empty message (no body) instead." },
"serverSideEncryptionEnabled": { "index": 21, "kind": "parameter",
"displayName": "Server Side Encryption Enabled", "group": "consumer", "label":
"consumer", "required": false, "type": "boolean", "javaType": "boolean",
"deprecated": false, "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Define if Server Side Encryption is enabled or
not on [...]
diff --git
a/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc
b/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc
index 15bb3b088609..cd3fc132b2e0 100644
--- a/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc
+++ b/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc
@@ -59,6 +59,23 @@ This allows you, for instance, to know how many messages
exist in this
batch and for instance, let the Aggregator
aggregate this number of messages.
+Each poll receives up to `maxMessagesPerPoll` messages, 10 by default, which
is the most that SQS returns to one
+receive request. With a higher value, each poll sends several receive requests
of at most 10 messages, up to
+`concurrentRequestLimit` of them at the same time. With 0 or a negative value,
each poll receives one message.
+
+Without long polling, SQS answers a receive request from a sample of its
servers, so it often returns fewer messages
+than asked for, or none, while more are in the queue. Set `waitTimeSeconds`
(up to 20 seconds), or give the queue a
+`ReceiveMessageWaitTimeSeconds` attribute above 0, so that a receive request
waits for messages.
+
+The messages of a poll are routed one after the other, and the visibility
timeout of each one runs from its receive. If
+the route is slow, the last messages of a poll can become visible again before
their turn comes, and SQS then delivers
+them a second time. Enable `extendMessageVisibility` together with
`visibilityTimeout`, which keeps every message of
+the poll invisible until it is processed, or use a visibility timeout that
covers the processing of a whole poll.
+
+With a FIFO queue, a poll can receive several messages of the same message
group. A message that fails is not deleted,
+but the next messages of its group in the same poll are still routed and
deleted, so the failed message is delivered
+again after them. Set `maxMessagesPerPoll=1` if the messages of a group must
keep their order when one of them fails.
+
=== Static credentials, Default Credential Provider and Profile Credentials
Provider
You have the possibility of avoiding the usage of explicit static credentials
by specifying the useDefaultCredentialsProvider option and set it to true.
diff --git
a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Endpoint.java
b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Endpoint.java
index 680fc3ecae45..a106e8eb472a 100644
---
a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Endpoint.java
+++
b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Endpoint.java
@@ -100,8 +100,8 @@ public class Sqs2Endpoint extends ScheduledPollEndpoint
implements HeaderFilterS
private String queueNameOrArn; // to support component docs
@UriParam
private Sqs2Configuration configuration;
- @UriParam(label = "consumer")
- private int maxMessagesPerPoll;
+ @UriParam(label = "consumer", defaultValue = "10")
+ private int maxMessagesPerPoll = 10;
@UriParam
private HeaderFilterStrategy headerFilterStrategy;
@@ -432,9 +432,13 @@ public class Sqs2Endpoint extends ScheduledPollEndpoint
implements HeaderFilterS
}
/**
- * Gets the maximum number of messages as a limit to poll at each polling.
+ * The maximum number of messages to receive in each poll. A receive
request returns at most 10 messages, so a value
+ * above 10 is split into several receive requests of at most 10 messages
each, and 0 or a negative value receives
+ * one message per poll.
* <p/>
- * Is default unlimited, but use 0 or negative number to disable it as
unlimited.
+ * The messages of a poll are routed one after the other, and the
visibility timeout of each one runs from its
+ * receive: with a slow route, enable extendMessageVisibility together
with visibilityTimeout, or use a visibility
+ * timeout that covers the whole batch.
*/
public void setMaxMessagesPerPoll(int maxMessagesPerPoll) {
this.maxMessagesPerPoll = maxMessagesPerPoll;
diff --git
a/components/camel-aws/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsComponentConfigurationTest.java
b/components/camel-aws/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsComponentConfigurationTest.java
index e0c2a2841eb2..a68426ee7d48 100644
---
a/components/camel-aws/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsComponentConfigurationTest.java
+++
b/components/camel-aws/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsComponentConfigurationTest.java
@@ -209,6 +209,20 @@ public class SqsComponentConfigurationTest extends
CamelTestSupport {
assertEquals(50, consumer.getMaxMessagesPerPoll());
}
+ @Test
+ public void createEndpointWithDefaultMaxMessagesPerPoll() throws Exception
{
+ AmazonSQSClientMock mock = new AmazonSQSClientMock();
+
+ context.getRegistry().bind("amazonSQSClient", mock);
+ Sqs2Component component = context.getComponent("aws2-sqs",
Sqs2Component.class);
+ Sqs2Endpoint endpoint = (Sqs2Endpoint) component
+
.createEndpoint("aws2-sqs://MyQueue?amazonSQSClient=#amazonSQSClient&accessKey=xxx&secretKey=yyy");
+ Sqs2Consumer consumer = (Sqs2Consumer) endpoint.createConsumer(null);
+
+ assertEquals(10, endpoint.getMaxMessagesPerPoll());
+ assertEquals(10, consumer.getMaxMessagesPerPoll());
+ }
+
@Test
public void createEndpointWithoutAccessKeyConfiguration() {
Sqs2Component component = context.getComponent("aws2-sqs",
Sqs2Component.class);
diff --git
a/components/camel-aws/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsConsumerMaxMessagesPerPollTest.java
b/components/camel-aws/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsConsumerMaxMessagesPerPollTest.java
new file mode 100644
index 000000000000..6e212d94816d
--- /dev/null
+++
b/components/camel-aws/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsConsumerMaxMessagesPerPollTest.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.sqs;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+import software.amazon.awssdk.services.sqs.model.Message;
+import software.amazon.awssdk.services.sqs.model.ReceiveMessageRequest;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * The number of messages a poll asks SQS for: 10 by default, which is the
most a receive request returns, and one with
+ * {@code maxMessagesPerPoll} set to 1, 0 or a negative value.
+ */
+class SqsConsumerMaxMessagesPerPollTest extends CamelTestSupport {
+
+ private static final int QUEUED = 25;
+
+ @BindToRegistry("defaultClient")
+ private final AmazonSQSClientMock defaultClient =
clientWithQueuedMessages();
+ @BindToRegistry("oneClient")
+ private final AmazonSQSClientMock oneClient = clientWithQueuedMessages();
+ @BindToRegistry("zeroClient")
+ private final AmazonSQSClientMock zeroClient = clientWithQueuedMessages();
+ @BindToRegistry("negativeClient")
+ private final AmazonSQSClientMock negativeClient =
clientWithQueuedMessages();
+
+ private final Map<String, AmazonSQSClientMock> clients = Map.of(
+ "default", defaultClient, "one", oneClient, "zero", zeroClient,
"negative", negativeClient);
+
+ @Test
+ void defaultPollReceivesTenMessagesWithOneRequest() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:default");
+ mock.expectedMessageCount(10);
+ mock.expectedPropertyReceived(Exchange.BATCH_SIZE, 10);
+
+ context.getRouteController().startRoute("default");
+
+ MockEndpoint.assertIsSatisfied(context);
+ List<ReceiveMessageRequest> receives =
defaultClient.getReceiveRequests();
+ assertEquals(1, receives.size(), "one receive request in the poll");
+ assertEquals(10, receives.get(0).maxNumberOfMessages(), "the receive
request asks for 10 messages");
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = { "one", "zero", "negative" })
+ void pollReceivesOneMessage(String routeId) throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:" + routeId);
+ mock.expectedMessageCount(1);
+ mock.expectedPropertyReceived(Exchange.BATCH_SIZE, 1);
+
+ context.getRouteController().startRoute(routeId);
+
+ MockEndpoint.assertIsSatisfied(context);
+ List<ReceiveMessageRequest> receives =
clients.get(routeId).getReceiveRequests();
+ assertEquals(1, receives.size(), "one receive request in the poll");
+ assertEquals(1, receives.get(0).maxNumberOfMessages(), "the receive
request asks for 1 message");
+ }
+
+ private static AmazonSQSClientMock clientWithQueuedMessages() {
+ AmazonSQSClientMock client = new AmazonSQSClientMock();
+ for (int i = 0; i < QUEUED; i++) {
+ client.addMessage(Message.builder().body("message " +
i).messageId("id-" + i).receiptHandle("handle-" + i)
+ .build());
+ }
+ return client;
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ // one poll per test: the next poll is an hour later
+ String options = "&initialDelay=0&delay=3600000";
+ from("aws2-sqs://MyQueue?amazonSQSClient=#defaultClient" +
options)
+
.routeId("default").autoStartup(false).to("mock:default");
+
from("aws2-sqs://MyQueue?amazonSQSClient=#oneClient&maxMessagesPerPoll=1" +
options)
+ .routeId("one").autoStartup(false).to("mock:one");
+
from("aws2-sqs://MyQueue?amazonSQSClient=#zeroClient&maxMessagesPerPoll=0" +
options)
+ .routeId("zero").autoStartup(false).to("mock:zero");
+
from("aws2-sqs://MyQueue?amazonSQSClient=#negativeClient&maxMessagesPerPoll=-1"
+ options)
+
.routeId("negative").autoStartup(false).to("mock:negative");
+ }
+ };
+ }
+}
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index 50ee81f51184..c7fa7e136c87 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -5478,6 +5478,24 @@ header, such as one that does not come from the
`aws2-sqs` consumer, gets no Clo
also when it has a `CamelAwsSqsReceiptHandle` header. A route that relies on
the old source can set the
`CamelCloudEventSource` header itself after the transformer.
+=== camel-aws2-sqs - the consumer receives up to 10 messages per poll
+
+The `maxMessagesPerPoll` option of the `aws2-sqs` consumer now defaults to 10,
the most that SQS returns to one receive
+request, so each poll now takes up to 10 messages. Before, it defaulted to 0,
documented as unlimited, which the
+consumer turned into a receive request for one message, so each poll took one
message. As before, a value above 10 is
+split into receive requests of at most 10 messages, and 0 or a negative value
receives one message per poll.
+
+The messages of a poll are routed one after the other, and the visibility
timeout of each one runs from its receive.
+With a slow route and without `extendMessageVisibility`, the last messages of
a poll can become visible again before
+their turn comes, and SQS then delivers them a second time. Enable
`extendMessageVisibility` together with
+`visibilityTimeout`, which keeps every message of the poll invisible until it
is processed, or use a visibility timeout
+that covers the processing of 10 messages.
+
+With a FIFO queue, a poll can now receive several messages of the same message
group: when one of them fails, the next
+ones of its group in the same poll are still routed and deleted, and the
failed message is delivered again after them.
+
+Set `maxMessagesPerPoll=1` to keep the previous behaviour.
+
=== camel-aws2-ddb - the x-struct transformer reads bytes as JSON text
The `aws2-ddb:application-x-struct` data type transformer now reads a `byte[]`
body as JSON text, with the charset of
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sqs2EndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sqs2EndpointBuilderFactory.java
index 6ec020a48143..1fbdccdde14d 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sqs2EndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sqs2EndpointBuilderFactory.java
@@ -471,12 +471,18 @@ public interface Sqs2EndpointBuilderFactory {
return this;
}
/**
- * Gets the maximum number of messages as a limit to poll at each
- * polling. Is default unlimited, but use 0 or negative number to
- * disable it as unlimited.
+ * The maximum number of messages to receive in each poll. A receive
+ * request returns at most 10 messages, so a value above 10 is split
+ * into several receive requests of at most 10 messages each, and 0 or
a
+ * negative value receives one message per poll. The messages of a poll
+ * are routed one after the other, and the visibility timeout of each
+ * one runs from its receive: with a slow route, enable
+ * extendMessageVisibility together with visibilityTimeout, or use a
+ * visibility timeout that covers the whole batch.
*
* The option is a: <code>int</code> type.
*
+ * Default: 10
* Group: consumer
*
* @param maxMessagesPerPoll the value to set
@@ -487,12 +493,18 @@ public interface Sqs2EndpointBuilderFactory {
return this;
}
/**
- * Gets the maximum number of messages as a limit to poll at each
- * polling. Is default unlimited, but use 0 or negative number to
- * disable it as unlimited.
+ * The maximum number of messages to receive in each poll. A receive
+ * request returns at most 10 messages, so a value above 10 is split
+ * into several receive requests of at most 10 messages each, and 0 or
a
+ * negative value receives one message per poll. The messages of a poll
+ * are routed one after the other, and the visibility timeout of each
+ * one runs from its receive: with a slow route, enable
+ * extendMessageVisibility together with visibilityTimeout, or use a
+ * visibility timeout that covers the whole batch.
*
* The option will be converted to a <code>int</code> type.
*
+ * Default: 10
* Group: consumer
*
* @param maxMessagesPerPoll the value to set