return FALSE; $r = well_tag_thread__update(array('id' => $id), $update); return $r; } function well_tag_thread_find($tagid, $page, $pagesize) { $arr = well_tag_thread__find(array('tagid' => $tagid), array('id' => -1), $page, $pagesize); return $arr; } function well_tag_thread_find_by_tid($tid, $page, $pagesize) { $arr = well_tag_thread__find(array('tid' => $tid), array(), $page, $pagesize); return $arr; } ?>AWS SQS and Spring pollTimeoutSeconds difference - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

AWS SQS and Spring pollTimeoutSeconds difference - Stack Overflow

programmeradmin0浏览0评论

I hava been reading about using pollTimeoutSeconds in @SqsListener from Spring Cloud AWS.

Look at this configuration:

@SqsListener(value = "my-queue", pollTimeoutSeconds = "10", maxMessagesPerPoll = "1", maxConcurrentMessages = "1")

Reading the documentation I understood that: If a message arrives within 10 seconds, it's immediately processed. I did the test and confirmed this.

I understood that for every 10 seconds, a new pool will be started again. I could see that on CloudWatch Graphic.

The only difference is that using 1s a request will be fired every 1s, with 10s the request will wait for 10s. (more requests, more costs)

My question is: in terms of receiving messages there is no difference between 10 or 1 second, messages will always be processed immediately when they become visible in SQS, is that correct?

I hava been reading about using pollTimeoutSeconds in @SqsListener from Spring Cloud AWS.

Look at this configuration:

@SqsListener(value = "my-queue", pollTimeoutSeconds = "10", maxMessagesPerPoll = "1", maxConcurrentMessages = "1")

Reading the documentation I understood that: If a message arrives within 10 seconds, it's immediately processed. I did the test and confirmed this.

I understood that for every 10 seconds, a new pool will be started again. I could see that on CloudWatch Graphic.

The only difference is that using 1s a request will be fired every 1s, with 10s the request will wait for 10s. (more requests, more costs)

My question is: in terms of receiving messages there is no difference between 10 or 1 second, messages will always be processed immediately when they become visible in SQS, is that correct?

Share Improve this question edited Jan 31 at 14:12 spencergibb 25.2k7 gold badges73 silver badges76 bronze badges asked Jan 31 at 13:11 javaTryjavaTry 1,3233 gold badges20 silver badges34 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

messages will always be processed immediately when they become visible in SQS, is that correct?

Immediately is a strong word, but for simplicity, I would say yes.

If a client has started polling and a message enters the queue, SQS will send a response back to client with this message. pollTimeoutSeconds does not affect response time. If a message is available, the call returns sooner than pollTimeoutSeconds

pollTimeoutSeconds is a same thing as WaitTimeSeconds parameter of ReceiveMessage request. About them you could read here: https://docs.aws.amazon/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html

发布评论

评论列表(0)

  1. 暂无评论