npo/amazon-sqs-messenger-bundle

Symfony Amazon SQS extension Messenger Bridge

2.5 2024-01-31 12:31 UTC

This package is not auto-updated.

Last update: 2024-12-20 13:11:27 UTC


README

This bundle can be used to take more control on how to handle messages upon rejection or sending (for example to enable server side rejection, lookup the following page https://symfony.com/doc/current/messenger.html#retries-failures for more information). By default all UnrecoverableMessageHandlingException will not be sent and rejected. The behavior is controlled by the IMessageReceiverEvaluator and IMessageSenderEvaluator services which can be overridden if needed.

Instal

composer require npo/amazon-sqs-messenger-bundle

Usage

Add to config/bundles.php:

AsyncAws\Symfony\Bundle\AsyncAwsBundle::class => ['all' => true],
NpoMessage\AmazonSqsMessenger\AmazonSqsMessengerBundle::class => ['all' => true],

MoveSqsMessagesCommand

Command can be used to move messages from one queue to another queue (eg. to redrive messages from a fifo DLQ)

Usage

bin/console npo-amazon-sqs-messenger:sqs:move-messages --from "https://from-queue-url" --to "https://to-queue-url"

IMoveSqsMessagesMiddleWare

By default the MoveSqsMessagesMiddleWare filters all messages without a receipt handle, as this is needed to remove messages from a queue. If you want to do some additional business logic before messages are moved, you can overwrite the IMoveSqsMessagesMiddleWare and manually inject it.