Mr. Black
Mr. Black

Reputation: 21

Spring Cloud SQS polling

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!

Upvotes: 2

Views: 1981

Answers (2)

user2047665
user2047665

Reputation: 81

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

Upvotes: 0

Craig Allen
Craig Allen

Reputation: 91

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.

Upvotes: 1

Related Questions