S3 通知发生或 SQS 接收定序器排序
S3 Notification Occurrence or SQS Reception Sequencer Ordering
来自Amazon S3 Event Notifications documentation
In your notification configuration you can request that Amazon S3 publish events to an SQS queue. Currently, Standard SQS queue is only allowed as an Amazon S3 event notification destination, whereas FIFO SQS queue is not allowed. For more information about SQS, see Amazon SQS product detail page.
SQS 事件队列的对象事件上的排序器会反映 S3 操作发生的顺序,还是 SQS 队列(非 fifo)接收事件的顺序?
如documentation for Standard queues所述:
Standard queues provide best-effort ordering which ensures that messages are generally delivered in the same order as they're sent.
因此不能保证事件的顺序,但会大致反映它们从 S3 发送的顺序。
编辑:您可以使用 SentTimestamp in the message attributes 查看消息发送到队列的时间,并以此为准。
在 event.Records[0].s3.object.sequencer
找到的 sequencer 仅用于消除单个存储桶中单个对象键的事件排序的歧义。
它允许您确定影响单个对象的事件的顺序,例如一个对象的多个覆盖或创建一个对象的多个版本。
对于不同桶或桶内对象的事件,排序器值不应被视为对排序比较有用。
相反,使用 event.Records[0].eventTime
比较影响不同对象的事件的顺序。
事实上,您通常可以只使用这个值,即使是对于单个对象,除非事件在时间上很接近。
https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html
注意,在比较一个对象的sequencer值时,必须先确定最长sequencer值的最大长度,然后用0
左填充所有其他的相同长度,然后进行词法比较,作为字符串,而不是数字(它们是十六进制字符串)...所以如果你有音序器值 21
和 1f38
theb 你需要填充 21
到 0021
point 它被正确地确定为小于 1f37
。这些只是例子,真正的音序器要长得多。不要期望定序器是单调的——只是对于一个对象来说,后面的值总是大于前面的值。
来自Amazon S3 Event Notifications documentation
In your notification configuration you can request that Amazon S3 publish events to an SQS queue. Currently, Standard SQS queue is only allowed as an Amazon S3 event notification destination, whereas FIFO SQS queue is not allowed. For more information about SQS, see Amazon SQS product detail page.
SQS 事件队列的对象事件上的排序器会反映 S3 操作发生的顺序,还是 SQS 队列(非 fifo)接收事件的顺序?
如documentation for Standard queues所述:
Standard queues provide best-effort ordering which ensures that messages are generally delivered in the same order as they're sent.
因此不能保证事件的顺序,但会大致反映它们从 S3 发送的顺序。
编辑:您可以使用 SentTimestamp in the message attributes 查看消息发送到队列的时间,并以此为准。
在 event.Records[0].s3.object.sequencer
找到的 sequencer 仅用于消除单个存储桶中单个对象键的事件排序的歧义。
它允许您确定影响单个对象的事件的顺序,例如一个对象的多个覆盖或创建一个对象的多个版本。
对于不同桶或桶内对象的事件,排序器值不应被视为对排序比较有用。
相反,使用 event.Records[0].eventTime
比较影响不同对象的事件的顺序。
事实上,您通常可以只使用这个值,即使是对于单个对象,除非事件在时间上很接近。
https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html
注意,在比较一个对象的sequencer值时,必须先确定最长sequencer值的最大长度,然后用0
左填充所有其他的相同长度,然后进行词法比较,作为字符串,而不是数字(它们是十六进制字符串)...所以如果你有音序器值 21
和 1f38
theb 你需要填充 21
到 0021
point 它被正确地确定为小于 1f37
。这些只是例子,真正的音序器要长得多。不要期望定序器是单调的——只是对于一个对象来说,后面的值总是大于前面的值。