暴趣科技网
您的当前位置:首页49. Amazon Simple Queue Service

49. Amazon Simple Queue Service

来源:暴趣科技网

Overview

  • Amazon Simple Queue Service (Amazon SQS) is a fully managed message queuing service that makes it easy to decouple and scale microservices, distributed systems, and serverless applications.
  • Amazon SQS moves data between distributed application components and helps you decouple these components.
  • Amazon Simple Queue Service (Amazon SQS) offers a secure, durable, and available hosted queue that lets you integrate and decouple distributed software systems and components.

Queue types

  •  Amazon SQS supports both  and 
Standard queue FIFO queue

Unlimited Throughput – Standard queues support a nearly unlimited number of API calls per second, per API action (SendMessageReceiveMessage, or DeleteMessage).

At-Least-Once Delivery – A message is delivered at least once, but occasionally more than one copy of a message is delivered.

Best-Effort Ordering – Occasionally, messages are delivered in an order different from which they were sent.

High Throughput – If you use , FIFO queues support up to 3,000 messages per second, per API method (SendMessageBatchReceiveMessage, or DeleteMessageBatch). The 3000 messages per second represent 300 API calls, each with a batch of 10 messages. To request a quota increase, . Without batching, FIFO queues support up to 300 API calls per second, per API method (SendMessageReceiveMessage, or DeleteMessage).

Exactly-Once Processing – A message is delivered once and remains available until a consumer processes and deletes it. Duplicates aren't introduced into the queue.

First-In-First-Out Delivery – The order in which messages are sent and received is strictly preserved.

Send data between applications when the throughput is important, for example:

  • Decouple live user requests from intensive background work: let users upload media while resizing or encoding it.

  • Allocate tasks to multiple worker nodes: process a high number of credit card validation requests.

  • Batch messages for future processing: schedule multiple entries to be added to a database.

Send data between applications when the order of events is important, for example:

  • Make sure that user-entered commands are run in the right order.

  • Display the correct product price by sending price modifications in the right order.

  • Prevent a student from enrolling in a course before registering for an account.

Queue Configuration

  • Visibility timeout – The length of time that a message received from a queue (by one consumer) won't be visible to the other message consumers.
    • The range is from 0 seconds to 12 hours.
    • The default value is 30 seconds.
  • Message retention period – The amount of time that Amazon SQS retains messages that remain in the queue. 
    • The range is from 1 minute to 14 days.
    • The default value is 4 days.
  • Delivery delay – The amount of time that Amazon SQS will delay before delivering a message that is added to the queue. 
    • The range is from 0 seconds to 15 minutes.
    • The default value is 0 seconds.
  • Maximum message size – The maximum message size for this queue.
    • The range is from 1 KB to 256 KB.
    • The default value is 256 KB.
  • Receive message wait time – The maximum amount of time that Amazon SQS waits for messages to become available after the queue gets a receive request.
    • The range is from 0 to 20 seconds.
    • The default value is 0 seconds, which sets .
    • Any non-zero value sets long polling.
  • Enable content-based

因篇幅问题不能全部显示,请点此查看更多更全内容