Skip to content

Commit 2817286

Browse files
authored
Merge pull request vyuldashev#158 from formapro-forks/upd-doc
[doc] add instruction on how to change the transport.
2 parents 4f46e70 + 0c8f2d0 commit 2817286

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@ composer require vladimir-yuldashev/laravel-queue-rabbitmq
1818

1919
```
2020
QUEUE_DRIVER=rabbitmq
21+
RABBITMQ_QUEUE=queue_name
2122
22-
RABBITMQ_DSN=amqp://guest:guest@127.0.0.1:5672/%2F
23+
RABBITMQ_DSN=amqp: # same as amqp://guest:guest@127.0.0.1:5672/%2F
24+
# or
25+
RABBITMQ_HOST=127.0.0.1
26+
RABBITMQ_PORT=5672
27+
RABBITMQ_VHOST=/
28+
RABBITMQ_LOGIN=guest
29+
RABBITMQ_PASSWORD=guest
2330
RABBITMQ_QUEUE=queue_name
2431
```
2532

@@ -34,6 +41,34 @@ RABBITMQ_SSL_KEY=
3441

3542
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
3643

44+
4. Other AMQP transports
45+
46+
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).
47+
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`.
48+
Here's an example on how one can change the transport to `enqueue/amqp-bunny`.
49+
50+
First, install the package:
51+
52+
```bash
53+
$ composer require enqueue/amqp-bunny:^0.8
54+
```
55+
56+
and change the factory class:
57+
58+
```php
59+
<?php
60+
// config/queue.php
61+
62+
return [
63+
'connections' => [
64+
'rabbitmq' => [
65+
'driver' => 'rabbitmq',
66+
'factory_class' => \Enqueue\AmqpBunny\AmqpConnectionFactory::class,
67+
],
68+
],
69+
];
70+
```
71+
3772
#### Usage
3873

3974
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

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"illuminate/database": "5.5.*",
1414
"illuminate/support": "5.5.*",
1515
"illuminate/queue": "5.5.*",
16-
"enqueue/amqp-lib": "0.8.5"
16+
"enqueue/amqp-lib": "0.8.5",
17+
"queue-interop/amqp-interop": "^0.7"
1718
},
1819
"require-dev": {
1920
"phpunit/phpunit": "~6.0",

0 commit comments

Comments
 (0)