This is an automated email from the ASF dual-hosted git repository.
acosentino 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 3a019a0f743 CAMEL-16287 - camel-aws2-sqs should use pagination for
deciding which aws sqs queues it should create
3a019a0f743 is described below
commit 3a019a0f7433bc46fccfe44e1bfdaaca7a460c00
Author: Andrea Cosentino <[email protected]>
AuthorDate: Mon May 30 14:03:12 2022 +0200
CAMEL-16287 - camel-aws2-sqs should use pagination for deciding which aws
sqs queues it should create
---
.../main/java/org/apache/camel/component/aws2/sqs/Sqs2Endpoint.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
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 4d1aafc1123..c93d3ac84f4 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
@@ -171,7 +171,6 @@ public class Sqs2Endpoint extends ScheduledPollEndpoint
implements HeaderFilterS
while (!done) {
ListQueuesResponse listQueuesResult
=
client.listQueues(ListQueuesRequest.builder().maxResults(1000).build());
-
for (String url : listQueuesResult.queueUrls()) {
if (url.endsWith("/" + configuration.getQueueName())) {
queueUrl = url;
@@ -179,11 +178,10 @@ public class Sqs2Endpoint extends ScheduledPollEndpoint
implements HeaderFilterS
break;
}
}
-
if (listQueuesResult.nextToken() == null) {
done = true;
+ continue;
}
-
String token = listQueuesResult.nextToken();
listQueuesResult =
client.listQueues(ListQueuesRequest.builder().nextToken(token).build());
}