Skip to content

Receive Message options

Yohta Kimura edited this page May 12, 2023 · 7 revisions

If you need to set specific SQS receive_message options, such as wait_time_seconds (Long Polling), you can set them in an initializer as follows:

Shoryuken.sqs_client_receive_message_opts = { 
  wait_time_seconds: 20, 
  max_number_of_messages: 1 
}

this configuration applies to the 'default' group.

For other groups you need to set them per group.

Shoryuken.sqs_client_receive_message_opts['group-name'] = { wait_time_seconds: 20 }

You can also set it per queue.

Shoryuken.sqs_client_receive_message_opts['queue-name'] = { wait_time_seconds: 20 }

See API Reference/ReceiveMessage.