swarrot/swarrot-bundle
Symfony bundle integrating Swarrot message consumers with RabbitMQ. Configure AMQP connections, define consumers as services, and build ordered middleware stacks (signal handling, max messages/time, memory limits, Doctrine integration). Ships a base console command and logger support.
laravel/symfony-bridge). Requires minimal adaptation for Laravel’s service container.Illuminate\Contracts\Container\Container) and Artisan CLI (via Illuminate\Foundation\Console). The bundle’s Symfony Console commands can be adapted for Laravel’s Artisan.Illuminate\Events\Dispatcher) may conflict with Swarrot’s message-driven workflows. Requires explicit message-to-event mapping if hybrid approaches are needed.FactoryInterface). Laravel’s queue system (e.g., database, redis) can coexist but requires separate configurations to avoid overlap.ProcessorInterface implementation.bind()/singleton() may conflict with Symfony’s autowiring. Requires explicit service registration (e.g., via AppServiceProvider)..env vs. Symfony’s config.yml. Requires environment variable parsing (e.g., config('swarrot.connections.rabbitmq.url')).amqplib or PECL for connection reuse.database:queue) or augmenting it (e.g., for complex routing)?FactoryInterface may be needed.retry middleware vs. Laravel’s failed_jobs table.AppServiceProvider:
$this->app->register(Swarrot\SwarrotBundle\SwarrotBundle::class);
Artisan::command('swarrot:consume', function () {
// Proxy to SwarrotBundle's command
});
php-amqplib/php-amqplib (recommended) or PECL (faster but requires server-side installation).FactoryInterface for Redis compatibility (e.g., via predis/predis).doctrine_connection middleware for transaction management.ProcessorInterface to integrate with Laravel’s query builder.orders.processor) and publisher (e.g., invoices).composer require swarrot/swarrot-bundle.config/app.php:
'providers' => [
Swarrot\SwarrotBundle\SwarrotServiceProvider::class,
],
php artisan vendor:publish --provider="Swarrot\SwarrotBundle\SwarrotServiceProvider"..env:
SWARROT_CONNECTIONS_RABBITMQ_URL=amqp://user:pass@rabbitmq:5672/vhost
class OrderProcessor implements ProcessorInterface {
public function process(Message $message, array $options) {
// Process order
}
}
config/swarrot.php:
'consumers' => [
'orders' => [
'processor' => OrderProcessor::class,
'middleware_stack' => [
['configurator' => 'swarrot.processor.retry'],
['configurator' => 'swarrot.processor.ack'],
],
],
],
php artisan swarrot:consume:orders orders_queue.retry middleware.eloquent_processor).ProcessorInterface.BlackholePublisher in tests to avoid real broker calls.ProcessorInterface for unit tests..env + config/swarrot.php.config() helper to override settings at runtime.swarrot/swarrot-bundle to a specific version (e.g., ^2.7) to avoid breaking changes.monolog package to log Swarrot events to a centralized system (e.g., ELK, Datadog).swarrot:consume with --requeue-on-error..env credentials and broker health.How can I help you explore Laravel packages today?