简体   繁体   中英

AWS SQS with two queues and one consumer

If I have two Amazon SQS simple queues and one consumer, how can the consumer consume the messages from both queues?

I have two producers that produce messages on two different SQS queues. How can one consumer that is listening to both queues consume the messages?

The term "consumer" is applied to code that calls ReceiveMessage() on an Amazon SQS queue (since it consumes messages).

For a consumer to consume messages from multiple queues, it would need to call ReceiveMessage() on both queues (separately). There is no single command that consumes messages on multiple queues.

For a consumer to "listen to both queues", it would need to call ReceiveMessage() on both queues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM