How to control the frequency of poll requests and the number of SQS API calls #447
-
SummaryI am trying to find a way how I can control how often the poll API calls are made. Everything works good, but I have about 20 queues, processed by multiple workers at the same time. By the design the messages do not exist pretty often. So in fact we process not a lot of messages per month, but, since the module (as I understand) does API call every 20 seconds even if the SQS is empty, we have the millions of the calls per month. Is it possible to let's say control to not do the poll API calls every 20 seconds? For example it would be good if the frequency will be reduced if the queue is empty. Any thoughts? ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The option waitTimeSeconds configures the AWS SQS option. More details on short and long polling here. pollingWaitTimeMs configures how long the consumer should wait before triggering SQS again, after that polling has completed, which defaults to 0, but actually works out to that plus the waitTimeSeconds configured against SQS and the time it takes to actually process the messages. updateOption can be used to programatically set both of these values. |
Beta Was this translation helpful? Give feedback.
The option waitTimeSeconds configures the AWS SQS option.
More details on short and long polling here.
pollingWaitTimeMs configures how long the consumer should wait before triggering SQS again, after that polling has completed, which defaults to 0, but actually works out to that plus the waitTimeSeconds configured against SQS and the time it takes to actually process the messages.
updateOption can be used to programatically set both of these values.