Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't define a queue in producer if has not set it

  • Loading branch information...
commit 9576cc1cfd03e95c75ca4fc9d9dc3e2e3c35349f 1 parent 37f29b1
@mvrhov mvrhov authored
View
6 DependencyInjection/OldSoundRabbitMqExtension.php
@@ -83,9 +83,11 @@ protected function loadProducers()
foreach ($this->config['producers'] as $key => $producer) {
$definition = new Definition('%old_sound_rabbit_mq.producer.class%');
$definition->addMethodCall('setExchangeOptions', array($producer['exchange_options']));
- if (isset($producer['queue_options'])) {
- $definition->addMethodCall('setQueueOptions', array($producer['queue_options']));
+ //this producer doesn't define a queue
+ if (!isset($producer['queue_options'])) {
+ $producer['queue_options']['name'] = null;
}
+ $definition->addMethodCall('setQueueOptions', array($producer['queue_options']));
$this->injectConnection($definition, $producer['connection']);
if ($this->collectorEnabled) {
$this->injectLoggedChannel($definition, $key, $producer['connection']);
View
16 Tests/DependencyInjection/OldSoundRabbitMqExtensionTest.php
@@ -63,6 +63,14 @@ public function testFooProducerDefinition()
'ticket' => null,
)
)
+ ),
+ array(
+ 'setQueueOptions',
+ array(
+ array(
+ 'name' => null,
+ )
+ )
)
),
$definition->getMethodCalls()
@@ -94,6 +102,14 @@ public function testDefaultProducerDefinition()
'ticket' => null,
)
)
+ ),
+ array(
+ 'setQueueOptions',
+ array(
+ array(
+ 'name' => null,
+ )
+ )
)
),
$definition->getMethodCalls()
Please sign in to comment.
Something went wrong with that request. Please try again.