diff --git a/README.md b/README.md index b339a19e..18973cb0 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,15 @@ composer require vladimir-yuldashev/laravel-queue-rabbitmq ``` QUEUE_DRIVER=rabbitmq +RABBITMQ_QUEUE=queue_name -RABBITMQ_DSN=amqp://guest:guest@127.0.0.1:5672/%2F +RABBITMQ_DSN=amqp: # same as amqp://guest:guest@127.0.0.1:5672/%2F +# or +RABBITMQ_HOST=127.0.0.1 +RABBITMQ_PORT=5672 +RABBITMQ_VHOST=/ +RABBITMQ_LOGIN=guest +RABBITMQ_PASSWORD=guest RABBITMQ_QUEUE=queue_name ``` @@ -34,6 +41,34 @@ RABBITMQ_SSL_KEY= Using an SSL connection will also require to configure your RabbitMQ to enable SSL. More details can be founds here: https://www.rabbitmq.com/ssl.html +4. Other AMQP transports + +The package uses [enqueue/amqp-lib](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/transport/amqp_lib.md) transport which is based on [php-amqplib](https://github.com/php-amqplib/php-amqplib). +There is possibility to use any [amqp interop](https://github.com/queue-interop/queue-interop#amqp-interop) compatible transport, for example `enqueue/amqp-ext` or `enqueue/amqp-bunny`. +Here's an example on how one can change the transport to `enqueue/amqp-bunny`. + +First, install the package: + +```bash +$ composer require enqueue/amqp-bunny:^0.8 +``` + +and change the factory class: + +```php + [ + 'rabbitmq' => [ + 'driver' => 'rabbitmq', + 'factory_class' => \Enqueue\AmqpBunny\AmqpConnectionFactory::class, + ], + ], +]; +``` + #### Usage Once you completed the configuration you can use Laravel Queue API. If you used other queue drivers you do not need to change anything else. If you do not know how to use Queue API, please refer to the official Laravel documentation: http://laravel.com/docs/queues diff --git a/composer.json b/composer.json index 0a5c5356..06b8376f 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,8 @@ "illuminate/database": "5.5.*", "illuminate/support": "5.5.*", "illuminate/queue": "5.5.*", - "enqueue/amqp-lib": "0.8.5" + "enqueue/amqp-lib": "0.8.5", + "queue-interop/amqp-interop": "^0.7" }, "require-dev": { "phpunit/phpunit": "~6.0",