Skip to content

Adds creation of dlq from resources#183

Open
JeisonJHA wants to merge 2 commits into
CoorpAcademy:masterfrom
JeisonJHA:master
Open

Adds creation of dlq from resources#183
JeisonJHA wants to merge 2 commits into
CoorpAcademy:masterfrom
JeisonJHA:master

Conversation

@JeisonJHA

Copy link
Copy Markdown

It adds support for creation of dlq from resources, but only with one format :(

      RedrivePolicy:
        deadLetterTargetArn: # Support only this format for autoCreate
          Fn::GetAtt:
          - MyFourthQueueDlq
          - Arn
        maxReceiveCount: 6

I think it solves #65 partially

@katesclau

Copy link
Copy Markdown

This CI is failing for

serverless-offline-plugins-integration: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

Code looks good though 👍

@luisdemarchi

Copy link
Copy Markdown

wowww @katesclau @katesclau this feature is valuable, what needs to be approved and merged?

@CodySearsOS

Copy link
Copy Markdown

Running into this issue with version 7.3.2 when I have a DLQ specified. Figured I'd add a comment to bump in case others are seeing it as well

silouone added a commit that referenced this pull request Jun 20, 2026
…,source) coverage

The old tests counted serverless-offline's `Billed Duration` log line (format-dependent) and read the readiness banner from stderr — fragile and prone to hangs/false-greens. Rewritten around a shared runOfflineTest helper that:
- merges stdout+stderr, waits for readiness, then sends events,
- detects invocations via a handler-emitted '__INVOKED__ <fn> <source>' marker keyed by function + event source (S3 bucket/key, or the queue/stream/table name) — STABLE per (handler, source) so retries/split-batches dedupe,
- asserts EXACT COVERAGE of the expected (handler, source) set (a count threshold let surplus markers mask a handler that never fired) and hard-fails on forbidden keys (catches the S3 prefix/suffix rule over-matching),
- gives each config a distinct lambdaPort and kills the process group on exit (no port races), with a hard timeout so it never hangs.
Also converts the EOL python3.7 handlers to JS (runtime-agnostic plugins) and removes the autoCreate DLQ/Policy intrinsic fixture (the deferred #183 feature — autoCreate doesn't implement DLQ-from-RedrivePolicy against ElasticMQ).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
silouone added a commit that referenced this pull request Jun 20, 2026
…+ batch/forbidden assertions

Rewritten around a shared runOfflineTest helper: merge stdout+stderr, wait for readiness, detached process-group kill, distinct lambdaPort AND httpPort per config (no port races), hard timeout, and onReady rejection fails fast. Invocations are detected via a handler marker '__INVOKED__ <fn> <source> <count>' with a source id STABLE per (handler, source) so retries/splits dedupe. The helper asserts EXACT coverage of expectedKeys (a count threshold could let surplus markers mask a non-firing handler), hard-fails on forbiddenKeys with a drain window (catches the S3 prefix/suffix rule over-matching), and asserts expectBatch (the 70-message SQS batch is delivered batched, not one-per-invocation). EOL python3.7 handlers converted to JS and the orphaned handler.py removed (myPythonHandler renamed mySecondCallbackHandler). The autoCreate DLQ/Policy CFN-intrinsic fixture is removed (deferred #183).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@silouone

Copy link
Copy Markdown
Member

Thanks for this @JeisonJHA — auto-creating the DLQ from your resources is a genuinely useful addition to serverless-offline-sqs. We're keeping this open as a tracked follow-up: in #265 (on master now, released shortly) we had to remove the flaky DLQ/intrinsic test fixture because ElasticMQ can't resolve the CloudFormation Fn::GetAtt ARN region, and that fixture comes back together with this implementation. We'll pick it up alongside issue #167. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants