Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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
<?php
// config/queue.php

return [
'connections' => [
'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
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down