Skip to content

Commit d556a87

Browse files
committed
[doc] yii2-queue amqp driver
1 parent fe9a816 commit d556a87

2 files changed

Lines changed: 80 additions & 8 deletions

File tree

‎README.md‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,22 @@ Features:
6363
[![Build Status](https://travis-ci.org/php-enqueue/null.png?branch=master)](https://travis-ci.org/php-enqueue/null)
6464
[![Total Downloads](https://poser.pugx.org/enqueue/null/d/total.png)](https://packagist.org/packages/enqueue/null)
6565
[![Latest Stable Version](https://poser.pugx.org/enqueue/null/version.png)](https://packagist.org/packages/enqueue/null)
66-
* [Symfony bundle](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/bundle/quick_tour.md)
67-
* [Magento1 extension](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/magento/quick_tour.md)
68-
* [Laravel extension](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/laravel/quick_tour.md)
69-
* [Message bus](http://www.enterpriseintegrationpatterns.com/patterns/messaging/MessageBus.html) support.
70-
* [RPC over MQ](https://www.rabbitmq.com/tutorials/tutorial-one-php.html) support.
66+
* [Symfony bundle](docs/bundle/quick_tour.md)
67+
* [Magento1 extension](docs/magento/quick_tour.md)
68+
* [Laravel extension](docs/laravel/quick_tour.md)
69+
* [Yii2. Amqp driver](docs/yii/amqp_driver.md)
70+
* [Message bus](docs/quick_tour.md#client) support.
71+
* [RPC over MQ](docs/quick_tour.md#remote-procedure-call-rpc) support.
7172
* Temporary queues support.
7273
* Well designed components decoupled and reusable.
7374
* Carefully tested including unit and functional tests.
7475
* For more visit [quick tour](docs/quick_tour.md).
7576

7677
## Resources
7778

78-
* [Quick tour](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/quick_tour.md)
79-
* [Documentation](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/index.md)
80-
* [Blog](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/index.md#blogs)
79+
* [Quick tour](docs/quick_tour.md)
80+
* [Documentation](docs/index.md)
81+
* [Blog](docs/index.md#blogs)
8182
* [Questions](https://gitter.im/php-enqueue/Lobby)
8283
* [Issue Tracker](https://github.com/php-enqueue/enqueue-dev/issues)
8384

‎docs/yii/amqp_driver.md‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Yii2Queue. AMQP Interop driver
2+
3+
_**Note: ** This a copy of [AMQP Interop doc](https://github.com/yiisoft/yii2-queue/blob/master/docs/guide/driver-amqp-interop.md) from the yiisoft/yii2-queue [repository](https://github.com/yiisoft/yii2-queue)._
4+
5+
6+
The driver works with RabbitMQ queues.
7+
8+
In order for it to work you should add any [amqp interop](https://github.com/queue-interop/queue-interop#amqp-interop) compatible transport to your project, for example `enqueue/amqp-lib` package.
9+
10+
Advantages:
11+
12+
* It would work with any amqp interop compatible transports, such as
13+
14+
* [enqueue/amqp-ext](https://github.com/php-enqueue/amqp-ext) based on [PHP amqp extension](https://github.com/pdezwart/php-amqp)
15+
* [enqueue/amqp-lib](https://github.com/php-enqueue/amqp-lib) based on [php-amqplib/php-amqplib](https://github.com/php-amqplib/php-amqplib)
16+
* [enqueue/amqp-bunny](https://github.com/php-enqueue/amqp-bunny) based on [bunny](https://github.com/jakubkulhan/bunny)
17+
18+
* Supports priorities
19+
* Supports delays
20+
* Supports ttr
21+
* Supports attempts
22+
* Contains new options like: vhost, connection_timeout, qos_prefetch_count and so on.
23+
* Supports Secure (SSL) AMQP connections.
24+
* An ability to set DSN like: amqp:, amqps: or amqp://user:pass@localhost:1000/vhost
25+
26+
Configuration example:
27+
28+
```php
29+
return [
30+
'bootstrap' => [
31+
'queue', // The component registers own console commands
32+
],
33+
'components' => [
34+
'queue' => [
35+
'class' => \yii\queue\amqp_interop\Queue::class,
36+
'port' => 5672,
37+
'user' => 'guest',
38+
'password' => 'guest',
39+
'queueName' => 'queue',
40+
'driver' => yii\queue\amqp_interop\Queue::ENQUEUE_AMQP_LIB,
41+
42+
// or
43+
'dsn' => 'amqp://guest:guest@localhost:5672/%2F',
44+
45+
// or, same as above
46+
'dsn' => 'amqp:',
47+
],
48+
],
49+
];
50+
```
51+
52+
Console
53+
-------
54+
55+
Console is used to listen and process queued tasks.
56+
57+
```sh
58+
yii queue/listen
59+
```
60+
61+
`listen` command launches a daemon which infinitely queries the queue. If there are new tasks
62+
they're immediately obtained and executed. This method is most efficient when command is properly
63+
daemonized via supervisor.
64+
65+
`listen` command has options:
66+
67+
- `--verbose`, `-v`: print executing statuses into console.
68+
- `--isolate`: verbose mode of a job execute. If enabled, execute result of each job will be printed.
69+
- `--color`: highlighting for verbose mode.
70+
71+
[back to index](../index.md)

0 commit comments

Comments
 (0)