php-amqplib (v2.x+), which may need PHP extensions (pcre, sockets) or PECL (rabbitmq). Docker/Kubernetes deployments can abstract this.ContainerAware vs. modern DI).Connection is not thread-safe).serialize(), which can fail on complex objects (e.g., closures, resources). JSON/MessagePack may be safer.ContainerAware).php-amqplib v3.x. PHP 8.x may require non-breaking changes (e.g., typed properties).laravel/queue-rabbitmq.user_created event).config/packages/old_sound_rabbit_mq.yaml:
old_sound_rabbit_mq:
connections:
default:
host: '%env(RABBITMQ_HOST)%'
port: '%env(int:RABBITMQ_PORT)%'
user: '%env(RABBITMQ_USER)%'
password: '%env(RABBITMQ_PASSWORD)%'
vhost: '%env(RABBITMQ_VHOST)%'
lazy: true
producers:
upload_picture_producer:
connection: default
exchange_options: {name: 'uploads', type: direct}
consumers:
upload_picture_consumer:
connection: default
exchange_options: {name: 'uploads', type: direct}
queue_options: {name: 'upload_pictures'}
callback: service: app.upload_picture_handler
EntityManager::flush() with $producer->publish(serialize($data)).kernel.terminate for cleanup tasks).php bin/console rabbitmq:consumer upload_picture_consumer -m 10 --limit=100
php-amqplib is installed:
pecl install rabbitmq
composer require php-amqplib/rabbitmq-bundle.php-amqplib for breaking changes (e.g., v2 → v3 API shifts).rabbitmq:consumer --debug to inspect messages.rabbitmqctl.php-amqplib is mature but less active than alternatives (e.g., Enqueue).prefetch_count to balance throughput and memory usage.| Failure | Impact | Mitigation |
|---|---|---|
| RabbitMQ downtime | Producers block; consumers stall | Retry with exponential backoff; use local task queue fallback. |
| Poison pill messages | Consumer crashes | DLQ + manual review workflow. |
| Network partitions | Producers/consumers disconnect | Heartbeat checks; reconnect logic. |
| Schema changes | Consumer deserialization fails | Versioned messages (e.g., v1/ prefix). |
| Resource exhaustion | OOM in consumers | Memory limits in Supervisor; batch processing. |
rabbitmqctl and management UI usage.How can I help you explore Laravel packages today?