SQS long polling provided

  • ReceiveMessageWaitTimeSeconds(1~20 秒)
  • In most cases, you can  ReceiveMessage wait time to 20 seconds. If 20 seconds for your application is too long, you can set a shorter  ReceiveMessage wait time (at least 1 second). If you do not use the AWS SDK access Amazon SQS, or the AWS SDK is configured to have a shorter wait time, you may have to modify the Amazon SQS client, a request to allow longer or shorter to use long-polling the wait time.

  • If you implement long-polling to multiple queues, use a queue for each thread, rather than using a single thread for all queues. If a thread is used for each queue, the application will be able to your message in the queue is available to process the messages; if a single thread to poll the plurality of queues, it may cause the application to wait (up to 20 seconds ) can not be processed in other queues are available without any message available message queue.

Guess you like

Origin www.cnblogs.com/cloudrivers/p/11423911.html