recranet / messenger-amqp-decorated
Transport decorator that removes ErrorDetailsStamp before sending messages to AMQP
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
pkg:composer/recranet/messenger-amqp-decorated
Requires
- php: >=8.2
- symfony/dependency-injection: ^7.0
- symfony/http-kernel: ^7.0
- symfony/messenger: ^7.0
This package is not auto-updated.
Last update: 2026-01-06 14:10:49 UTC
README
Transport decorator that removes ErrorDetailsStamp and RedeliveryStamp before sending messages to AMQP.
Problem Solved
When Symfony Messenger retries failed messages, it adds stamps containing:
ErrorDetailsStamp: Exception class name, message, and full stack traceRedeliveryStamp: Retry metadata with exception details
On each retry, new stamps are added, causing accumulation. After several retries, the AMQP headers become too large, resulting in:
- "Invalid AMQP data" errors
- "table too large for buffer" errors
Solution
This decorator wraps AMQP transports and strips ErrorDetailsStamp and RedeliveryStamp before send(), keeping messages within AMQP header limits.
Are Failed Messages Still Retried?
Yes. Both ErrorDetailsStamp and RedeliveryStamp are purely informational/diagnostic - they don't control retry behavior.
The retry mechanism is controlled by:
DelayStamp- controls retry delay timing- Retry count and strategy from
messenger.yamlconfig
These are not removed by this decorator.
Flow
- Message fails ->
ErrorDetailsStampandRedeliveryStampadded (in memory) - Retry logic kicks in (based on retry strategy)
send()called -> stamps removed by this decorator- Message sent to AMQP without large headers
- Worker picks it up, retries execution
- If fails again -> new stamps added -> cycle repeats
Trade-off
You lose error details history in the message headers, but the messages continue to retry correctly.
Installation
composer require recranet/messenger-amqp-decorated
If you're using Symfony Flex, the bundle is registered automatically.
Otherwise, add it to config/bundles.php:
return [ // ... Recranet\MessengerAmqpDecorated\MessengerAmqpDecoratedBundle::class => ['all' => true], ];
Usage
No configuration needed. The bundle automatically decorates messenger.transport.amqp.factory, wrapping all AMQP transports.