Skip to content

Commit 9c9817e

Browse files
committed
docs (readme): update to reflect bundle version 3 and symfony 4
1 parent 59e7130 commit 9c9817e

File tree

1 file changed

+30
-43
lines changed

1 file changed

+30
-43
lines changed

README.md

+30-43
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ When your worker configuration or your code changes, run the command again and a
1818

1919
Install [supervisor](http://supervisord.org/). e. g. on debian based distributions via `apt-get`:
2020
```sh
21-
$ apt-get install supervisor
21+
# apt-get install supervisor
2222
```
2323

2424
Add bundle via composer
@@ -27,9 +27,8 @@ $ php composer require phobetor/rabbitmq-supervisor-bundle
2727
```
2828
This will install the bundle to your project’s `vendor` directory.
2929

30-
Add the bundle to your project’s `AppKernel`:
30+
If your are not using Symfony Flex, also add the bundle to your project’s `AppKernel`:
3131
```php
32-
<?php
3332
// app/AppKernel.php
3433

3534
public function registerBundles()
@@ -46,7 +45,7 @@ public function registerBundles()
4645
RabbitMQ supervisor bundle works out of the box with a predefined configuration. If you leave it this way you will end
4746
up with this directory structure:
4847
```sh
49-
app/supervisor/
48+
supervisor/
5049
└── dev
5150
├── logs
5251
│   ├── stderr.log
@@ -61,61 +60,49 @@ app/supervisor/
6160
├── queue3.conf
6261
└── queue4.conf
6362
```
63+
In symfony 2 and 3 this will be placed inside your `app/` directory.
6464

65-
## Advanced configuration
66-
67-
You can use the following configuration options in your `app/config/config.yml`:
65+
Caution with symfony 4: to not have this inside of your `src/` directory you need to set the paths to suit your needs.
66+
E. g. to use the standard structure inside of the `var/` directory, use this:
6867
```yml
6968
rabbit_mq_supervisor:
70-
supervisor_instance_identifier: instance_name
7169
paths:
72-
workspace_directory: /path/to/workspace/
73-
configuration_file: /path/to/workspace/supervisord.conf
74-
pid_file: /path/to/workspace/supervisord.pid
75-
sock_file: /path/to/workspace/supervisord.sock
76-
log_file: /path/to/workspace/supervisord.log
77-
worker_configuration_directory: /path/to/workspace/worker/
78-
worker_output_log_file: /path/to/workspace/logs/%kernel.environment%.log
79-
worker_error_log_file: /path/to/workspace/logs/%kernel.environment%.log
80-
commands:
81-
rabbitmq_consumer: user-specific-command:consumer
82-
rabbitmq_multiple_consumer: user-specific-command:multiple-consumer
83-
consumer:
84-
general:
85-
messages: 250 # consumer command option: messages to consume
86-
memory-limit: 32 # consumer command option: allowed memory for this process
87-
debug: true # consumer command option: enable debugging
88-
without-signals: true # consumer command option: disable catching of system signals
89-
worker:
90-
count: 1 # number of workers per consumer
91-
startsecs: 2 # supervisord worker option: seconds to consider program running
92-
autorestart: true # supervisord worker option: if supervisord should restarted program automatically
93-
stopsignal: INT # supervisord worker option: the signal used to kill the program
94-
stopasgroup: true # supervisord worker option: if whole process group should be stopped
95-
stopwaitsecs: 60 # supervisord worker option: seconds to wait after stop signal before sending kill signal
96-
individual:
97-
# override options for specific consumers. you can use the same options for any consumer as in consumer.general
98-
consumer_name_1:
99-
# […]
100-
consumer_name_2:
101-
# […]
70+
workspace_directory: "%kernel.project_dir%/var/supervisor/%kernel.environment%/"
71+
configuration_file: "%kernel.project_dir%/var/supervisor/%kernel.environment%/supervisord.conf"
72+
pid_file: "%kernel.project_dir%/var/supervisor/%kernel.environment%/supervisor.pid"
73+
sock_file: "%kernel.project_dir%/var/supervisor/%kernel.environment%/supervisor.sock"
74+
log_file: "%kernel.project_dir%/var/supervisor/%kernel.environment%/supervisord.log"
75+
worker_configuration_directory: "%kernel.project_dir%/var/supervisor/%kernel.environment%/worker/"
76+
worker_output_log_file: "%kernel.project_dir%/var/supervisor/%kernel.environment%/logs/stdout.log"
77+
worker_error_log_file: "%kernel.project_dir%/var/supervisor/%kernel.environment%/logs/stderr.log"
78+
```
79+
80+
## Advanced configuration
81+
82+
To see all configuration options run
83+
```sh
84+
$ console config:dump-reference RabbitMqSupervisorBundle
10285
```
10386

10487
### BC break when updating from v1.* to v2.*
10588
If you used custom commands before version 2.0, you need to update them. In most case you can just remove everything
10689
after the command name.
10790

91+
### BC break when updating from v2.* to v3.*
92+
Commands will by default no longer wait for `supervisord` to complete. If you need this (e. g. to get feedback on
93+
errors) use the `--wait-for-supervisord` option.
94+
10895
## Usage
10996

11097
Build or rebuild the supervisor and worker configuration and start the daemon:
11198
```sh
112-
$ app/console rabbitmq-supervisor:rebuild
99+
$ console rabbitmq-supervisor:rebuild
113100
```
114101

115102
Control the supervisord daemon:
116103
```sh
117-
$ app/console rabbitmq-supervisor:control stop
118-
$ app/console rabbitmq-supervisor:control start
119-
$ app/console rabbitmq-supervisor:control restart
120-
$ app/console rabbitmq-supervisor:control hup
104+
$ console rabbitmq-supervisor:control stop
105+
$ console rabbitmq-supervisor:control start
106+
$ console rabbitmq-supervisor:control restart
107+
$ console rabbitmq-supervisor:control hup
121108
```

0 commit comments

Comments
 (0)