【发布时间】:2019-11-15 13:54:40
【问题描述】:
我的申请包括:
- 1 个 Amazon SQS 消息队列
- n 个工人
工人有以下逻辑:
1. Wait for message from SQS queue
2. Perform task described in message
3. Delete the message from the SQS queue
4. Go to (1)
我希望每条消息仅由一名工作人员接收,以避免多余的工作。
是否有一种机制可以使用 SQS 将消息标记为“正在进行中”,以便其他轮询器不会收到它?
或者,是否适合在收到消息后立即删除?
1. Wait for message from SQS queue
2. Delete the message from the SQS queue
3. Perform task described in message
4. Go to (1)
如果我采用这种方法,有没有办法恢复收到但未处理的消息,以防工作人员崩溃(步骤 (3) 失败)?
This question 是 Spring 特有的,它包含各种魔法。
【问题讨论】:
标签: amazon-web-services amazon-sqs