简体   繁体   中英

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!

是的,如果您使用长轮询,您将保持连接打开,直到您收到事件,并且您将在它发布时接近它。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM