2

I'm using Spring Cloud to consume an AWS SQS. I would like to control the number of polls by setting up an interval between these requests, but I can't find any option to do this.

I'm thinking that using the long polling it's not necessary to control the poll interval. It is that true?

Thank you!

2 Answers 2

1

Yes, if you use long polling you are keeping the connection open until you are given the event, and you will be getting it to near when it was published.

Sign up to request clarification or add additional context in comments.

1 Comment

When using long-polling, the request maxed at 20 seconds by AWS. If no messages have been put on the queue, the connection is closed and spring starts polling again.
0

You can use WaitTimeSeconds to achieve what you want. Here is AWS documentation - http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html

The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than WaitTimeSeconds.

This one is an optional parameter, so if you don't pass it then it is 0 seconds

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.