0
votes

I'm using the https://github.com/bbc/sqs-consumer/ SQS Consumer plugin to poll an SQS queue.

At times, the consumer does not receive any message from the queue even though messages are being added to the queue.

Questions

  • What settings do you suggest I set on the AWS SQS Queue to ensure that the consumer gets every message added to the Queue?

  • Under what conditions does the Consumer not receive messages added to the Queue? In my case, messages are being added to the queue but the Consumer does not receive them.

1
To ensure that you never have an empty receive while messages are in the queue, WaitTimeInSeconds must be > 0 and should be 20 unless you have a specific reason to do otherwise. What value are you using now?Michael - sqlbot

1 Answers

0
votes

Feels like you are getting confused with some terminology here.

  • The VisibilityTimeout is basically a timeout that says how long a message on that queue will take to be successfully processed and deleted by a consumer. We have thousands of queues on our production environment, depending on what the queue consumer does the VisibilityTimeout is set appropriately. We expect some consumers to take up to a minute to successfully process and delete a message. Other consumers should take no longer than five seconds.
  • ReceiveMessageWaitTimeSeconds and WaitTimeSeconds refer to the same thing. ReceiveMessageWaitTimeSeconds is set on the queue level, whereas WaitTimeSeconds is set on the ReceiveMessage call. WaitTimeSeconds has priority over ReceiveMessageWaitTimeSeconds. Both of these options control how long AWS waits until it returns an empty response, I'd highly suggest leaving that to the default; which if I recall correctly is 20 seconds.

Hope that helps!