mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(lambda): propagate SQS FIFO system attributes to ESM event (#1527)
When an SQS event source mapping invokes a Lambda from a FIFO queue, copy MessageGroupId, SequenceNumber, and MessageDeduplicationId into each record's attributes map, matching the values ReceiveMessage already returns. Standard-queue messages are unaffected. Closes #1526
This commit is contained in:
1 parent
0a806f7382
commit
21a7939e46
2 files changed
+49
No files matched your search
@@ -285,6 +285,15 @@ public class SqsEventSourcePoller {
|
||||
attrs.put("SentTimestamp", String.valueOf(msg.getSentTimestamp().toEpochMilli()));
|
||||
attrs.put("SenderId", AwsArnUtils.accountOrDefault(esm.getEventSourceArn(), "000000000000"));
|
||||
attrs.put("ApproximateFirstReceiveTimestamp", String.valueOf(System.currentTimeMillis()));
|
||||
if (msg.getSequenceNumber() > 0) {
|
||||
attrs.put("SequenceNumber", String.valueOf(msg.getSequenceNumber()));
|
||||
}
|
||||
if (msg.getMessageGroupId() != null) {
|
||||
attrs.put("MessageGroupId", msg.getMessageGroupId());
|
||||
}
|
||||
if (msg.getMessageDeduplicationId() != null) {
|
||||
attrs.put("MessageDeduplicationId", msg.getMessageDeduplicationId());
|
||||
}
|
||||
// Populate messageAttributes from the message model
|
||||
ObjectNode msgAttrs = record.putObject("messageAttributes");
|
||||
if (msg.getMessageAttributes() != null) {
|
||||
|
||||
Reference in new issue
Block a user