@@ -18,7 +18,7 @@ When your worker configuration or your code changes, run the command again and a
18
18
19
19
Install [ supervisor] ( http://supervisord.org/ ) . e. g. on debian based distributions via ` apt-get ` :
20
20
``` sh
21
- $ apt-get install supervisor
21
+ # apt-get install supervisor
22
22
```
23
23
24
24
Add bundle via composer
@@ -27,9 +27,8 @@ $ php composer require phobetor/rabbitmq-supervisor-bundle
27
27
```
28
28
This will install the bundle to your project’s ` vendor ` directory.
29
29
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 ` :
31
31
``` php
32
- <?php
33
32
// app/AppKernel.php
34
33
35
34
public function registerBundles()
@@ -46,7 +45,7 @@ public function registerBundles()
46
45
RabbitMQ supervisor bundle works out of the box with a predefined configuration. If you leave it this way you will end
47
46
up with this directory structure:
48
47
``` sh
49
- app/ supervisor/
48
+ supervisor/
50
49
└── dev
51
50
├── logs
52
51
│ ├── stderr.log
@@ -61,61 +60,49 @@ app/supervisor/
61
60
├── queue3.conf
62
61
└── queue4.conf
63
62
```
63
+ In symfony 2 and 3 this will be placed inside your ` app/ ` directory.
64
64
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:
68
67
``` yml
69
68
rabbit_mq_supervisor :
70
- supervisor_instance_identifier : instance_name
71
69
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
102
85
```
103
86
104
87
### BC break when updating from v1.* to v2.*
105
88
If you used custom commands before version 2.0, you need to update them. In most case you can just remove everything
106
89
after the command name.
107
90
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
+
108
95
## Usage
109
96
110
97
Build or rebuild the supervisor and worker configuration and start the daemon:
111
98
``` sh
112
- $ app/ console rabbitmq-supervisor:rebuild
99
+ $ console rabbitmq-supervisor:rebuild
113
100
```
114
101
115
102
Control the supervisord daemon:
116
103
``` 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
121
108
```
0 commit comments