[ https://issues.apache.org/jira/browse/CAMEL-21031 ]
Claus Ibsen deleted comment on CAMEL-21031:
-------------------------------------
was (Author: davsclaus):
This code seems a bit wrong, it causes 1 messages to be polled only, and the
logic to calculate more polls seems wrong.
> camel-aws-sqs: support for polling more than 10 messages from AWS SQS
> ----------------------------------------------------------------------
>
> Key: CAMEL-21031
> URL: https://issues.apache.org/jira/browse/CAMEL-21031
> Project: Camel
> Issue Type: Improvement
> Components: camel-aws2-sqs
> Affects Versions: 4.7.0
> Reporter: Otavio Rodolfo Piske
> Assignee: Otavio Rodolfo Piske
> Priority: Major
> Fix For: 4.8.0
>
>
> Quoting Jakub [from the PR:|https://github.com/apache/camel/pull/14926]
> ??Hi,
> I'm using camel-aws-sqs-source-kafka-connector, and recently I've found that
> I'm unable to poll all the messages from SQS queue in time.
> At first I wanted to increase the maximum number of messages polled in a
> single request.
> By default the client is configured to receive only 1 message and the maximum
> messages allowed by AWS is 10.
> Here I had to add maxMessagesPerPoll parameter to the Kamelet in order to
> configure it for the connector.
> I'm mentioning the Kamelet because the parameter there has maximum: 10 but
> this change renders that constraint obsolete.
> Without the Kamelet there is a workaround to configure the queueNameOrArn
> with ?maxMessagesPerPoll=10& suffix, to sneak in the parameter to the
> endpoint.
> But even with that and enabled greedy polling I was unable to keep up, and
> poll all messages in time.
> Increasing the number of concurrent polling threads is an option here, but
> I'm interested in processing the messages in the correct order.
> Looking at the Spring implementation, I've found that they are invoking
> receive requests with multiple threads and then merging the results together:
> https://github.com/awspring/spring-cloud-aws/blob/a81b879d1a6b46f8a26794b98a601f7450d84907/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/source/AbstractSqsMessageSource.java#L194-L198
> I think a similar approach could be applied in Apache Camel, where the number
> of concurrent requests is calculated from ceil(maxMessagesPerPoll / 10D)
> formula.??
--
This message was sent by Atlassian Jira
(v8.20.10#820010)