symfony/redis-messenger
Redis transport integration for Symfony Messenger, enabling queueing and async message handling backed by Redis. Part of the Symfony ecosystem, with links to contributing, issue reporting, and pull requests in the main Symfony repository.
symfony/messenger, symfony/redis). This alignment reduces friction for teams already using Symfony components in Laravel (e.g., HTTP Client, UX, or Messenger).Queue adapter (e.g., RedisQueue) or used alongside Laravel’s native queues for hybrid workflows.symfony/messenger) as a dependency, which may necessitate a partial Symfony adoption in Laravel. However, the bridge is lightweight and focused on Redis transport.Illuminate\Queue\Queue interface for drop-in replacement of database or redis queues. Example:
// app/Providers/AppServiceProvider.php
Queue::extend('symfony_redis', function ($app) {
return new SymfonyRedisQueue(
$app->make('symfony.messenger.transport.redis')
);
});
Queueable jobs (e.g., converting Illuminate\Bus\Queueable to Symfony Message interface).Transport/Handler concepts). Mitigate with:
job:failed, job:released events won’t work out-of-the-box. Requires custom event listeners.messenger:consume CLI differs from Laravel’s queue:work. May need wrapper scripts or custom processes.Queueable vs. Message)?symfony/messenger:^6.4).ext-redis).symfony/redis, symfony/options-resolver) for advanced configs.redis driver) or third-party adapters (e.g., predis/predis).queue:table) or RabbitMQ (php-amqplib).symfony_messenger_messages_sent_total).messenger:consume for workers (replace Laravel’s queue:work).database queue for a high-volume endpoint (e.g., order processing).// benchmark.php
$messages = range(1, 1000);
$start = microtime(true);
foreach ($messages as $msg) {
$this->messenger->dispatch(new ProcessOrder($msg));
}
$dispatchTime = microtime(true) - $start;
// Consume in background
$this->messenger->consume();
// app/Queue/SymfonyRedisQueue.php
class SymfonyRedisQueue implements QueueInterface {
public function __construct(private TransportInterface $transport) {}
public function push($job, $data, $delay = 0) {
$this->transport->send(new SymfonyMessage($data));
}
// Implement other QueueInterface methods...
}
queue:work with Symfony’s messenger:consume for critical paths.Message interface.| Feature | Symfony Redis Messenger | Laravel Queues | Notes |
|---|---|---|---|
| Job Serialization | Symfony Message |
Illuminate\Bus\Queueable |
Requires adapter or manual conversion. |
| Retry Logic | Built-in (exponential backoff) | queue:retry table |
Symfony’s retries may need customization. |
| Dead-Letter Queues | Yes (configurable) | Yes (failed_jobs table) |
Use Redis keyspaces for isolation. |
| Delay Queues | Yes | Yes | Symfony uses delay stamp. |
| Horizontal Scaling | Yes (worker-based) | Yes | Both support multiple workers. |
| Monitoring | Prometheus metrics | Horizon/Laravel Telescope | Custom integration needed. |
| Redis Persistence | No ( |
How can I help you explore Laravel packages today?