Amazon AWS SQS FIFO 队列 sendMessage 问题
Amazon AWS SQS FIFO queue sendMessage issue
当使用 sendMessage()
函数发送消息时,使用 MessageDeduplicationId
防止重复。
但是,sendMessage 函数始终 return 为真。换句话说,sendMessage
函数总是 return 表示消息已成功发送到 SQS 的值,但实际上该消息不可用。
我根据 sendMessage()
return 值更改数据库中的字段“sent_to_sqs
”。
有人可以帮我吗?
设计假设是,如果您发送的消息具有相同的 deduplication-id,那么这就是您已发送的完全相同的消息(否则,它不应该具有相同的 deduplication-id),所以 SQS 假装再次接受它,假设你这边肯定出了问题,阻止你意识到消息已经第一次提交了。
“the sendMessage
function always returns a value that says message successfully sent to SQS”
是的,因为它早先就已经是。
SQS 不验证该邮件 实际上 是重复的 -- 它假定它是,因为您声称它必须通过提交相同的 deduplication-id 5 分钟内 window。如果消息已被处理,那么根据设计,它在队列中将不可用。
Message Deduplication ID
The token used for deduplication of sent messages. If a message with a particular message deduplication ID is sent successfully, any messages sent with the same message deduplication ID are accepted successfully but aren't delivered during the 5-minute deduplication interval.
当使用 sendMessage()
函数发送消息时,使用 MessageDeduplicationId
防止重复。
但是,sendMessage 函数始终 return 为真。换句话说,sendMessage
函数总是 return 表示消息已成功发送到 SQS 的值,但实际上该消息不可用。
我根据 sendMessage()
return 值更改数据库中的字段“sent_to_sqs
”。
有人可以帮我吗?
设计假设是,如果您发送的消息具有相同的 deduplication-id,那么这就是您已发送的完全相同的消息(否则,它不应该具有相同的 deduplication-id),所以 SQS 假装再次接受它,假设你这边肯定出了问题,阻止你意识到消息已经第一次提交了。
“the
sendMessage
function always returns a value that says message successfully sent to SQS”
是的,因为它早先就已经是。
SQS 不验证该邮件 实际上 是重复的 -- 它假定它是,因为您声称它必须通过提交相同的 deduplication-id 5 分钟内 window。如果消息已被处理,那么根据设计,它在队列中将不可用。
Message Deduplication ID
The token used for deduplication of sent messages. If a message with a particular message deduplication ID is sent successfully, any messages sent with the same message deduplication ID are accepted successfully but aren't delivered during the 5-minute deduplication interval.