Files
floci/src/main/java/io
Stuart Lang dba23bf7e2 fix(lambda): redrive failed SQS ESM messages to the DLQ (#1419)
* fix(lambda): redrive failed SQS ESM messages to the DLQ

When an SQS event source mapping invocation failed, the poller left the
message in-flight for the full execution-cover visibility window
(fn.timeout + 30s) instead of returning it to the queue. The message was
therefore never re-received, so ApproximateReceiveCount never crossed
maxReceiveCount and the queue's RedrivePolicy never moved it to the DLQ.

On a failed invocation (and for reported partial-batch failures) reset the
affected messages' visibility to 0 so the next poll re-receives them,
letting the existing redrive machinery move them to the DLQ.

Closes #1416

* fix(lambda): return failed ESM messages using the queue visibility timeout

Address PR review: resetting a failed message's visibility to 0 made it
immediately eligible for redelivery, which spins a tight retry loop for a
persistently failing function (far more aggressive than AWS). Reset to the
queue's configured VisibilityTimeout instead (falling back to the AWS
default of 30s when unset), matching AWS's redelivery cadence while still
letting ApproximateReceiveCount climb so the RedrivePolicy moves the
message to the DLQ.

Also document pollAndInvoke's package-private visibility as test-only.
2026-06-19 00:47:37 -05:00
..