|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace OldSound\RabbitMqBundle\DependencyInjection; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
|
6
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
|
7
|
|
|
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* Configuration |
|
11
|
|
|
* |
|
12
|
|
|
* @author Marc Weistroff <[email protected]> |
|
13
|
|
|
*/ |
|
14
|
|
|
class Configuration implements ConfigurationInterface |
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* @var string |
|
18
|
|
|
*/ |
|
19
|
|
|
protected $name; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* Configuration constructor. |
|
23
|
|
|
* |
|
24
|
|
|
* @param string $name |
|
25
|
|
|
*/ |
|
26
|
31 |
|
public function __construct($name) |
|
27
|
|
|
{ |
|
28
|
31 |
|
$this->name = $name; |
|
29
|
31 |
|
} |
|
30
|
|
|
|
|
31
|
31 |
|
public function getConfigTreeBuilder() |
|
32
|
|
|
{ |
|
33
|
31 |
|
$tree = new TreeBuilder($this->name); |
|
34
|
|
|
/** @var ArrayNodeDefinition $rootNode */ |
|
35
|
31 |
|
$rootNode = $tree->getRootNode(); |
|
36
|
|
|
|
|
37
|
|
|
$rootNode |
|
38
|
31 |
|
->children() |
|
39
|
31 |
|
->booleanNode('debug')->defaultValue('%kernel.debug%')->end() |
|
40
|
31 |
|
->booleanNode('enable_collector')->defaultValue(false)->end() |
|
|
|
|
|
|
41
|
31 |
|
->booleanNode('sandbox')->defaultValue(false)->end() |
|
42
|
31 |
|
->end() |
|
43
|
|
|
; |
|
44
|
|
|
|
|
45
|
31 |
|
$this->addConnections($rootNode); |
|
46
|
31 |
|
$this->addBindings($rootNode); |
|
47
|
31 |
|
$this->addProducers($rootNode); |
|
48
|
31 |
|
$this->addConsumers($rootNode); |
|
49
|
31 |
|
$this->addMultipleConsumers($rootNode); |
|
50
|
31 |
|
$this->addDynamicConsumers($rootNode); |
|
51
|
31 |
|
$this->addBatchConsumers($rootNode); |
|
52
|
31 |
|
$this->addGroupConsumers($rootNode); |
|
53
|
31 |
|
$this->addAnonConsumers($rootNode); |
|
54
|
31 |
|
$this->addRpcClients($rootNode); |
|
55
|
|
|
$this->addRpcServers($rootNode); |
|
56
|
31 |
|
|
|
57
|
|
|
return $tree; |
|
58
|
|
|
} |
|
59
|
31 |
|
|
|
60
|
|
|
protected function addConnections(ArrayNodeDefinition $node) |
|
61
|
|
|
{ |
|
62
|
31 |
|
$node |
|
63
|
31 |
|
->fixXmlConfig('connection') |
|
64
|
31 |
|
->children() |
|
65
|
31 |
|
->arrayNode('connections') |
|
66
|
31 |
|
->useAttributeAsKey('key') |
|
67
|
31 |
|
->canBeUnset() |
|
68
|
31 |
|
->prototype('array') |
|
69
|
31 |
|
->children() |
|
70
|
31 |
|
->scalarNode('url')->defaultValue('')->end() |
|
71
|
31 |
|
->scalarNode('host')->defaultValue('localhost')->end() |
|
72
|
31 |
|
->scalarNode('port')->defaultValue(5672)->end() |
|
73
|
31 |
|
->scalarNode('user')->defaultValue('guest')->end() |
|
74
|
31 |
|
->scalarNode('password')->defaultValue('guest')->end() |
|
75
|
31 |
|
->scalarNode('vhost')->defaultValue('/')->end() |
|
76
|
31 |
|
->booleanNode('lazy')->defaultFalse()->end() |
|
77
|
31 |
|
->scalarNode('connection_timeout')->defaultValue(3)->end() |
|
78
|
31 |
|
->scalarNode('read_write_timeout')->defaultValue(3)->end() |
|
79
|
31 |
|
->booleanNode('use_socket')->defaultValue(false)->end() |
|
80
|
31 |
|
->arrayNode('ssl_context') |
|
81
|
31 |
|
->useAttributeAsKey('key') |
|
82
|
31 |
|
->canBeUnset() |
|
83
|
31 |
|
->prototype('variable')->end() |
|
84
|
31 |
|
->end() |
|
85
|
31 |
|
->booleanNode('keepalive')->defaultFalse()->info('requires php-amqplib v2.4.1+ and PHP5.4+')->end() |
|
86
|
31 |
|
->scalarNode('heartbeat')->defaultValue(0)->info('requires php-amqplib v2.4.1+')->end() |
|
87
|
31 |
|
->scalarNode('connection_parameters_provider')->end() |
|
88
|
31 |
|
->end() |
|
89
|
31 |
|
->end() |
|
90
|
31 |
|
->end() |
|
91
|
|
|
->end() |
|
92
|
31 |
|
; |
|
93
|
|
|
} |
|
94
|
31 |
|
|
|
95
|
|
|
protected function addProducers(ArrayNodeDefinition $node) |
|
96
|
|
|
{ |
|
97
|
31 |
|
$node |
|
98
|
31 |
|
->fixXmlConfig('producer') |
|
99
|
31 |
|
->children() |
|
100
|
31 |
|
->arrayNode('producers') |
|
101
|
31 |
|
->canBeUnset() |
|
102
|
31 |
|
->useAttributeAsKey('key') |
|
103
|
31 |
|
->prototype('array') |
|
104
|
31 |
|
->append($this->getExchangeConfiguration()) |
|
|
|
|
|
|
105
|
31 |
|
->append($this->getQueueConfiguration()) |
|
106
|
31 |
|
->children() |
|
107
|
31 |
|
->scalarNode('connection')->defaultValue('default')->end() |
|
108
|
31 |
|
->scalarNode('auto_setup_fabric')->defaultTrue()->end() |
|
109
|
31 |
|
->scalarNode('class')->defaultValue('%old_sound_rabbit_mq.producer.class%')->end() |
|
110
|
31 |
|
->scalarNode('enable_logger')->defaultFalse()->end() |
|
111
|
31 |
|
->scalarNode('service_alias')->defaultValue(null)->end() |
|
112
|
31 |
|
->end() |
|
113
|
31 |
|
->end() |
|
114
|
31 |
|
->end() |
|
115
|
|
|
->end() |
|
116
|
31 |
|
; |
|
117
|
|
|
} |
|
118
|
31 |
|
|
|
119
|
|
|
protected function addBindings(ArrayNodeDefinition $node) |
|
120
|
|
|
{ |
|
121
|
31 |
|
$node |
|
122
|
31 |
|
->fixXmlConfig('binding') |
|
123
|
31 |
|
->children() |
|
124
|
31 |
|
->arrayNode('bindings') |
|
125
|
31 |
|
->canBeUnset() |
|
126
|
31 |
|
->prototype('array') |
|
127
|
31 |
|
->children() |
|
128
|
31 |
|
->scalarNode('connection')->defaultValue('default')->end() |
|
129
|
31 |
|
->scalarNode('exchange')->defaultNull()->end() |
|
130
|
31 |
|
->scalarNode('destination')->defaultNull()->end() |
|
131
|
31 |
|
->scalarNode('routing_key')->defaultNull()->end() |
|
132
|
31 |
|
->booleanNode('nowait')->defaultFalse()->end() |
|
133
|
31 |
|
->booleanNode('destination_is_exchange')->defaultFalse()->end() |
|
134
|
31 |
|
->variableNode('arguments')->defaultNull()->end() |
|
135
|
31 |
|
->scalarNode('class')->defaultValue('%old_sound_rabbit_mq.binding.class%')->end() |
|
136
|
31 |
|
->end() |
|
137
|
31 |
|
->end() |
|
138
|
31 |
|
->end() |
|
139
|
|
|
->end() |
|
140
|
31 |
|
; |
|
141
|
|
|
} |
|
142
|
31 |
|
|
|
143
|
|
|
protected function addConsumers(ArrayNodeDefinition $node) |
|
144
|
|
|
{ |
|
145
|
31 |
|
$node |
|
146
|
31 |
|
->fixXmlConfig('consumer') |
|
147
|
31 |
|
->children() |
|
148
|
31 |
|
->arrayNode('consumers') |
|
149
|
31 |
|
->canBeUnset() |
|
150
|
31 |
|
->useAttributeAsKey('key') |
|
151
|
31 |
|
->prototype('array') |
|
152
|
31 |
|
->append($this->getExchangeConfiguration()) |
|
153
|
31 |
|
->append($this->getQueueConfiguration()) |
|
154
|
31 |
|
->children() |
|
155
|
31 |
|
->scalarNode('connection')->defaultValue('default')->end() |
|
156
|
31 |
|
->arrayNode('groups')->defaultValue(array('default')) |
|
157
|
31 |
|
->prototype('scalar') |
|
158
|
31 |
|
->end() |
|
159
|
31 |
|
->end() |
|
160
|
31 |
|
->scalarNode('callback')->isRequired()->end() |
|
161
|
31 |
|
->scalarNode('idle_timeout')->end() |
|
162
|
31 |
|
->scalarNode('idle_timeout_exit_code')->end() |
|
163
|
31 |
|
->scalarNode('timeout_wait')->end() |
|
164
|
31 |
|
->arrayNode('graceful_max_execution') |
|
165
|
31 |
|
->canBeUnset() |
|
166
|
31 |
|
->children() |
|
167
|
31 |
|
->integerNode('timeout')->end() |
|
168
|
31 |
|
->integerNode('exit_code')->defaultValue(0)->end() |
|
169
|
31 |
|
->end() |
|
170
|
31 |
|
->end() |
|
171
|
31 |
|
->scalarNode('auto_setup_fabric')->defaultTrue()->end() |
|
172
|
31 |
|
->arrayNode('qos_options') |
|
173
|
31 |
|
->canBeUnset() |
|
174
|
31 |
|
->children() |
|
175
|
31 |
|
->scalarNode('prefetch_size')->defaultValue(0)->end() |
|
176
|
31 |
|
->scalarNode('prefetch_count')->defaultValue(0)->end() |
|
177
|
31 |
|
->booleanNode('global')->defaultFalse()->end() |
|
178
|
31 |
|
->end() |
|
179
|
|
|
->end() |
|
180
|
31 |
|
->scalarNode('enable_logger')->defaultFalse()->end() |
|
181
|
|
|
->end() |
|
182
|
31 |
|
->end() |
|
183
|
|
|
->end() |
|
184
|
|
|
->end() |
|
185
|
31 |
|
; |
|
186
|
31 |
|
} |
|
187
|
31 |
|
|
|
188
|
31 |
|
protected function addMultipleConsumers(ArrayNodeDefinition $node) |
|
189
|
31 |
|
{ |
|
190
|
31 |
|
$node |
|
191
|
31 |
|
->fixXmlConfig('multiple_consumer') |
|
192
|
31 |
|
->children() |
|
193
|
31 |
|
->arrayNode('multiple_consumers') |
|
194
|
31 |
|
->canBeUnset() |
|
195
|
31 |
|
->useAttributeAsKey('key') |
|
196
|
31 |
|
->prototype('array') |
|
197
|
31 |
|
->append($this->getExchangeConfiguration()) |
|
198
|
31 |
|
->children() |
|
199
|
31 |
|
->scalarNode('connection')->defaultValue('default')->end() |
|
200
|
31 |
|
->arrayNode('groups')->defaultValue(array('default')) |
|
201
|
31 |
|
->prototype('scalar') |
|
202
|
31 |
|
->end() |
|
203
|
31 |
|
->end() |
|
204
|
31 |
|
->scalarNode('idle_timeout')->end() |
|
205
|
31 |
|
->scalarNode('idle_timeout_exit_code')->end() |
|
206
|
31 |
|
->scalarNode('timeout_wait')->end() |
|
207
|
31 |
|
->scalarNode('auto_setup_fabric')->defaultTrue()->end() |
|
208
|
31 |
|
->arrayNode('graceful_max_execution') |
|
209
|
31 |
|
->canBeUnset() |
|
210
|
31 |
|
->children() |
|
211
|
31 |
|
->integerNode('timeout')->end() |
|
212
|
31 |
|
->integerNode('exit_code')->defaultValue(0)->end() |
|
213
|
31 |
|
->end() |
|
214
|
31 |
|
->end() |
|
215
|
31 |
|
->append($this->getMultipleQueuesConfiguration()) |
|
216
|
31 |
|
->arrayNode('qos_options') |
|
217
|
31 |
|
->canBeUnset() |
|
218
|
|
|
->children() |
|
219
|
31 |
|
->scalarNode('prefetch_size')->defaultValue(0)->end() |
|
220
|
|
|
->scalarNode('prefetch_count')->defaultValue(0)->end() |
|
221
|
31 |
|
->booleanNode('global')->defaultFalse()->end() |
|
222
|
|
|
->end() |
|
223
|
|
|
->end() |
|
224
|
31 |
|
->scalarNode('queues_provider')->defaultNull()->end() |
|
225
|
31 |
|
->scalarNode('enable_logger')->defaultFalse()->end() |
|
226
|
31 |
|
->end() |
|
227
|
31 |
|
->end() |
|
228
|
31 |
|
->end() |
|
229
|
31 |
|
; |
|
230
|
31 |
|
} |
|
231
|
31 |
|
|
|
232
|
31 |
|
protected function addDynamicConsumers(ArrayNodeDefinition $node) |
|
233
|
31 |
|
{ |
|
234
|
31 |
|
$node |
|
235
|
31 |
|
->fixXmlConfig('dynamic_consumer') |
|
236
|
31 |
|
->children() |
|
237
|
31 |
|
->arrayNode('dynamic_consumers') |
|
238
|
31 |
|
->canBeUnset() |
|
239
|
31 |
|
->useAttributeAsKey('key') |
|
240
|
31 |
|
->prototype('array') |
|
241
|
31 |
|
->append($this->getExchangeConfiguration()) |
|
242
|
31 |
|
->children() |
|
243
|
31 |
|
->scalarNode('connection')->defaultValue('default')->end() |
|
244
|
31 |
|
->arrayNode('groups')->defaultValue(array('default')) |
|
245
|
31 |
|
->prototype('scalar') |
|
246
|
31 |
|
->end() |
|
247
|
31 |
|
->end() |
|
248
|
31 |
|
->scalarNode('callback')->isRequired()->end() |
|
249
|
31 |
|
->scalarNode('idle_timeout')->end() |
|
250
|
31 |
|
->scalarNode('idle_timeout_exit_code')->end() |
|
251
|
31 |
|
->scalarNode('timeout_wait')->end() |
|
252
|
31 |
|
->arrayNode('graceful_max_execution') |
|
253
|
31 |
|
->canBeUnset() |
|
254
|
31 |
|
->children() |
|
255
|
31 |
|
->integerNode('timeout')->end() |
|
256
|
31 |
|
->integerNode('exit_code')->defaultValue(0)->end() |
|
257
|
31 |
|
->end() |
|
258
|
|
|
->end() |
|
259
|
31 |
|
->scalarNode('auto_setup_fabric')->defaultTrue()->end() |
|
260
|
|
|
->arrayNode('qos_options') |
|
261
|
|
|
->canBeUnset() |
|
262
|
|
|
->children() |
|
263
|
|
|
->scalarNode('prefetch_size')->defaultValue(0)->end() |
|
264
|
|
|
->scalarNode('prefetch_count')->defaultValue(0)->end() |
|
265
|
|
|
->booleanNode('global')->defaultFalse()->end() |
|
266
|
31 |
|
->end() |
|
267
|
|
|
->end() |
|
268
|
|
|
->scalarNode('queue_options_provider')->isRequired()->end() |
|
269
|
31 |
|
->scalarNode('enable_logger')->defaultFalse()->end() |
|
270
|
31 |
|
->end() |
|
271
|
31 |
|
->end() |
|
272
|
31 |
|
->end() |
|
273
|
31 |
|
->end() |
|
274
|
31 |
|
; |
|
275
|
31 |
|
} |
|
276
|
31 |
|
|
|
277
|
31 |
|
/** |
|
278
|
31 |
|
* @param ArrayNodeDefinition $node |
|
279
|
31 |
|
* |
|
280
|
31 |
|
* @return void |
|
281
|
31 |
|
*/ |
|
282
|
31 |
|
protected function addBatchConsumers(ArrayNodeDefinition $node) |
|
283
|
31 |
|
{ |
|
284
|
31 |
|
$node |
|
285
|
31 |
|
->children() |
|
286
|
31 |
|
->arrayNode('batch_consumers') |
|
287
|
31 |
|
->canBeUnset() |
|
288
|
31 |
|
->useAttributeAsKey('key') |
|
289
|
31 |
|
->prototype('array') |
|
290
|
31 |
|
->append($this->getExchangeConfiguration()) |
|
291
|
31 |
|
->append($this->getQueueConfiguration()) |
|
292
|
31 |
|
->children() |
|
293
|
31 |
|
->scalarNode('connection')->defaultValue('default')->end() |
|
294
|
31 |
|
->arrayNode('groups')->defaultValue(array('default')) |
|
295
|
31 |
|
->prototype('scalar') |
|
296
|
31 |
|
->end() |
|
297
|
31 |
|
->end() |
|
298
|
31 |
|
->scalarNode('callback')->isRequired()->end() |
|
299
|
31 |
|
->scalarNode('idle_timeout')->end() |
|
300
|
31 |
|
->scalarNode('timeout_wait')->defaultValue(3)->end() |
|
301
|
31 |
|
->scalarNode('idle_timeout_exit_code')->end() |
|
302
|
|
|
->scalarNode('keep_alive')->defaultFalse()->end() |
|
303
|
31 |
|
->arrayNode('graceful_max_execution') |
|
304
|
|
|
->canBeUnset() |
|
305
|
31 |
|
->children() |
|
306
|
|
|
->integerNode('timeout')->end() |
|
307
|
|
|
->end() |
|
308
|
31 |
|
->end() |
|
309
|
31 |
|
->scalarNode('auto_setup_fabric')->defaultTrue()->end() |
|
310
|
31 |
|
->arrayNode('qos_options') |
|
311
|
31 |
|
->children() |
|
312
|
31 |
|
->scalarNode('prefetch_size')->defaultValue(0)->end() |
|
313
|
31 |
|
->scalarNode('prefetch_count')->defaultValue(2)->end() |
|
314
|
31 |
|
->booleanNode('global')->defaultFalse()->end() |
|
315
|
31 |
|
->end() |
|
316
|
31 |
|
->end() |
|
317
|
31 |
|
->scalarNode('enable_logger')->defaultFalse()->end() |
|
318
|
31 |
|
->end() |
|
319
|
31 |
|
->end() |
|
320
|
31 |
|
->end() |
|
321
|
31 |
|
->end() |
|
322
|
|
|
; |
|
323
|
31 |
|
} |
|
324
|
|
|
|
|
325
|
31 |
|
protected function addGroupConsumers(ArrayNodeDefinition $node) |
|
326
|
|
|
{ |
|
327
|
|
|
$node |
|
328
|
31 |
|
->children() |
|
329
|
31 |
|
->arrayNode('group_consumers') |
|
330
|
31 |
|
->canBeUnset() |
|
331
|
31 |
|
->useAttributeAsKey('key') |
|
332
|
31 |
|
->prototype('array') |
|
333
|
31 |
|
->children() |
|
334
|
31 |
|
->scalarNode('connection')->defaultValue('default')->end() |
|
335
|
31 |
|
->arrayNode('qos_options') |
|
336
|
31 |
|
->canBeUnset() |
|
337
|
31 |
|
->children() |
|
338
|
31 |
|
->scalarNode('prefetch_size')->defaultValue(0)->end() |
|
339
|
31 |
|
->scalarNode('prefetch_count')->defaultValue(0)->end() |
|
340
|
31 |
|
->booleanNode('global')->defaultFalse()->end() |
|
341
|
31 |
|
->end() |
|
342
|
31 |
|
->end() |
|
343
|
31 |
|
->end() |
|
344
|
|
|
->end(); |
|
345
|
31 |
|
} |
|
346
|
|
|
|
|
347
|
31 |
|
protected function addAnonConsumers(ArrayNodeDefinition $node) |
|
348
|
|
|
{ |
|
349
|
|
|
$node |
|
350
|
31 |
|
->fixXmlConfig('anon_consumer') |
|
351
|
31 |
|
->children() |
|
352
|
31 |
|
->arrayNode('anon_consumers') |
|
353
|
31 |
|
->canBeUnset() |
|
354
|
31 |
|
->useAttributeAsKey('key') |
|
355
|
31 |
|
->prototype('array') |
|
356
|
31 |
|
->append($this->getExchangeConfiguration()) |
|
357
|
31 |
|
->children() |
|
358
|
31 |
|
->scalarNode('connection')->defaultValue('default')->end() |
|
359
|
31 |
|
->arrayNode('groups')->defaultValue(array('default')) |
|
360
|
31 |
|
->prototype('scalar') |
|
361
|
31 |
|
->end() |
|
362
|
31 |
|
->end() |
|
363
|
31 |
|
->scalarNode('callback')->isRequired()->end() |
|
364
|
31 |
|
->end() |
|
365
|
31 |
|
->end() |
|
366
|
31 |
|
->end() |
|
367
|
31 |
|
->end() |
|
368
|
31 |
|
; |
|
369
|
31 |
|
} |
|
370
|
31 |
|
|
|
371
|
31 |
|
protected function addRpcClients(ArrayNodeDefinition $node) |
|
372
|
31 |
|
{ |
|
373
|
31 |
|
$node |
|
374
|
31 |
|
->fixXmlConfig('rpc_client') |
|
375
|
|
|
->children() |
|
376
|
31 |
|
->arrayNode('rpc_clients') |
|
377
|
|
|
->canBeUnset() |
|
378
|
31 |
|
->useAttributeAsKey('key') |
|
379
|
|
|
->prototype('array') |
|
380
|
31 |
|
->children() |
|
381
|
|
|
->scalarNode('connection')->defaultValue('default')->end() |
|
382
|
|
|
->booleanNode('expect_serialized_response')->defaultTrue()->end() |
|
383
|
31 |
|
->scalarNode('unserializer')->defaultValue('unserialize')->end() |
|
384
|
31 |
|
->booleanNode('lazy')->defaultFalse()->end() |
|
385
|
31 |
|
->booleanNode('direct_reply_to')->defaultFalse()->end() |
|
386
|
31 |
|
->end() |
|
387
|
31 |
|
->end() |
|
388
|
31 |
|
->end() |
|
389
|
31 |
|
->end() |
|
390
|
31 |
|
; |
|
391
|
31 |
|
} |
|
392
|
31 |
|
|
|
393
|
31 |
|
protected function addRpcServers(ArrayNodeDefinition $node) |
|
394
|
31 |
|
{ |
|
395
|
|
|
$node |
|
396
|
|
|
->fixXmlConfig('rpc_server') |
|
397
|
|
|
->children() |
|
398
|
31 |
|
->arrayNode('rpc_servers') |
|
399
|
|
|
->canBeUnset() |
|
400
|
31 |
|
->useAttributeAsKey('key') |
|
401
|
|
|
->prototype('array') |
|
402
|
31 |
|
->append($this->getExchangeConfiguration()) |
|
403
|
|
|
->append($this->getQueueConfiguration()) |
|
404
|
31 |
|
->children() |
|
405
|
|
|
->scalarNode('connection')->defaultValue('default')->end() |
|
406
|
|
|
->scalarNode('callback')->isRequired()->end() |
|
407
|
31 |
|
->arrayNode('qos_options') |
|
408
|
|
|
->canBeUnset() |
|
409
|
31 |
|
->children() |
|
410
|
31 |
|
->scalarNode('prefetch_size')->defaultValue(0)->end() |
|
411
|
|
|
->scalarNode('prefetch_count')->defaultValue(0)->end() |
|
412
|
31 |
|
->booleanNode('global')->defaultFalse()->end() |
|
413
|
|
|
->end() |
|
414
|
31 |
|
->end() |
|
415
|
31 |
|
->scalarNode('serializer')->defaultValue('serialize')->end() |
|
416
|
31 |
|
->scalarNode('enable_logger')->defaultFalse()->end() |
|
417
|
|
|
->end() |
|
418
|
31 |
|
->end() |
|
419
|
|
|
->end() |
|
420
|
31 |
|
->end() |
|
421
|
|
|
; |
|
422
|
|
|
} |
|
423
|
31 |
|
|
|
424
|
|
|
protected function getExchangeConfiguration() |
|
425
|
|
|
{ |
|
426
|
31 |
|
$node = new ArrayNodeDefinition('exchange_options'); |
|
427
|
31 |
|
|
|
428
|
31 |
|
return $node |
|
429
|
31 |
|
->children() |
|
430
|
31 |
|
->scalarNode('name')->isRequired()->end() |
|
431
|
31 |
|
->scalarNode('type')->isRequired()->end() |
|
|
|
|
|
|
432
|
31 |
|
->booleanNode('passive')->defaultValue(false)->end() |
|
433
|
31 |
|
->booleanNode('durable')->defaultValue(true)->end() |
|
434
|
31 |
|
->booleanNode('auto_delete')->defaultValue(false)->end() |
|
435
|
31 |
|
->booleanNode('internal')->defaultValue(false)->end() |
|
436
|
31 |
|
->booleanNode('nowait')->defaultValue(false)->end() |
|
437
|
31 |
|
->booleanNode('declare')->defaultValue(true)->end() |
|
438
|
31 |
|
->variableNode('arguments')->defaultNull()->end() |
|
439
|
31 |
|
->scalarNode('ticket')->defaultNull()->end() |
|
440
|
31 |
|
->end() |
|
441
|
31 |
|
; |
|
442
|
|
|
} |
|
443
|
31 |
|
|
|
444
|
|
|
protected function getQueueConfiguration() |
|
445
|
|
|
{ |
|
446
|
|
|
$node = new ArrayNodeDefinition('queue_options'); |
|
447
|
|
|
|
|
448
|
|
|
$this->addQueueNodeConfiguration($node); |
|
449
|
|
|
|
|
450
|
|
|
return $node; |
|
451
|
|
|
} |
|
452
|
|
|
|
|
453
|
|
|
protected function getMultipleQueuesConfiguration() |
|
454
|
|
|
{ |
|
455
|
|
|
$node = new ArrayNodeDefinition('queues'); |
|
456
|
|
|
$prototypeNode = $node->prototype('array'); |
|
457
|
|
|
|
|
458
|
|
|
$this->addQueueNodeConfiguration($prototypeNode); |
|
459
|
|
|
|
|
460
|
|
|
$prototypeNode->children() |
|
461
|
|
|
->scalarNode('callback')->isRequired()->end() |
|
462
|
|
|
->end(); |
|
463
|
|
|
|
|
464
|
|
|
$prototypeNode->end(); |
|
465
|
|
|
|
|
466
|
|
|
return $node; |
|
467
|
|
|
} |
|
468
|
|
|
|
|
469
|
|
|
protected function addQueueNodeConfiguration(ArrayNodeDefinition $node) |
|
470
|
|
|
{ |
|
471
|
|
|
$node |
|
472
|
|
|
->fixXmlConfig('routing_key') |
|
473
|
|
|
->children() |
|
474
|
|
|
->scalarNode('name')->end() |
|
475
|
|
|
->booleanNode('passive')->defaultFalse()->end() |
|
476
|
|
|
->booleanNode('durable')->defaultTrue()->end() |
|
477
|
|
|
->booleanNode('exclusive')->defaultFalse()->end() |
|
478
|
|
|
->booleanNode('auto_delete')->defaultFalse()->end() |
|
479
|
|
|
->booleanNode('nowait')->defaultFalse()->end() |
|
480
|
|
|
->booleanNode('declare')->defaultTrue()->end() |
|
481
|
|
|
->variableNode('arguments')->defaultNull()->end() |
|
482
|
|
|
->scalarNode('ticket')->defaultNull()->end() |
|
483
|
|
|
->arrayNode('routing_keys') |
|
484
|
|
|
->prototype('scalar')->end() |
|
485
|
|
|
->defaultValue(array()) |
|
486
|
|
|
->end() |
|
487
|
|
|
->end() |
|
488
|
|
|
; |
|
489
|
|
|
} |
|
490
|
|
|
} |
|
491
|
|
|
|