aescarcha/async
Symfony bundle that listens to Doctrine entity lifecycle events (persist/update/remove) and publishes RabbitMQ jobs so heavy processing runs asynchronously. Configure via OldSoundRabbitMq and register the persist listener as consumer/event subscriber.
prePersist, preRemove) to offload heavy operations (e.g., entity serialization/deserialization, post-save logic) to a RabbitMQ (RMQ) queue. This aligns well with architectures requiring decoupled, scalable background tasks (e.g., data sync, notifications, or resource-intensive computations).SerializerComponent, ensuring consistency in entity serialization/deserialization. Useful for APIs or systems where entities must persist in a normalized format (e.g., Elasticsearch, caches).old_sound_rabbit_mq). Non-Symfony PHP/Laravel projects will require significant abstraction (e.g., rewriting listeners or using a bridge like php-amqplib directly).eloquent.saving → prePersist).php artisan queue:work) can consume RMQ messages if configured via php-amqplib or a bridge like vladimir-yuldashev/laravel-queue-rabbitmq.Illuminate\Support\Facades\Serializer or spatie/laravel-serializable-traits can replace Symfony’s Serializer with minimal effort.retrieved, saved).process queue driver instead.observers, model events, or spatie/laravel-activitylog achieve similar goals with less overhead?ModelObserver or EventServiceProvider.vladimir-yuldashev/laravel-queue-rabbitmq to bridge RMQ with Laravel’s queue workers.Serializer facade or spatie/laravel-serializable-traits.prePersist).// app/Observers/EntityObserver.php
class EntityObserver {
public function saving($model) {
// Push to RMQ via custom queue job
AsyncJob::dispatch($model)->onConnection('rabbitmq');
}
}
vladimir-yuldashev/laravel-queue-rabbitmq to use the same exchange/queue as the bundle.deleting, updating) to async jobs.old_sound_rabbit_mq.php-amqplib v2.4.1). Laravel 8+ supports this.old_sound_rabbit_mq or laravel-queue-rabbitmq.composer.json.old_sound_rabbit_mq is unmaintained (last commit 2017). Consider php-amqplib directly or enqueue/rabbitmq.queue:work --daemon).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| RMQ Broker Down | Async jobs fail silently; entities may appear "stuck" in transition. | Implement retry logic in jobs; use dead-letter queues. |
| Consumer Crashes | Unprocessed messages pile up; eventual consistency breaks. | Monitor consumer health; use supervisor to auto-restart workers. |
| Serialization Errors | Invalid data written to storage or downstream systems. | Validate serialized data before processing; log failures. |
| Network Partition (RMQ ↔ Workers) | Workers unable to pull messages; delayed processing. | Use persistent connections; implement local retries. |
| Laravel Queue Worker Fails | Jobs accumulate; system slows down. | Use queue:failed table; implement job backoff. |
How can I help you explore Laravel packages today?