Skip to content

Commit

Permalink
Merge pull request #23 from NiR-/fix/exchange-arguments
Browse files Browse the repository at this point in the history
Fix exchange arguments
  • Loading branch information
fabdsp committed Oct 22, 2015
2 parents d3c68fa + 8da219a commit e84a5a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/AmqpBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ protected function addProducers(ArrayNodeDefinition $node)
->arrayNode('arguments')
->prototype('scalar')->end()
->defaultValue(array())
->normalizeKeys(false)
->end()

// binding
Expand Down
1 change: 1 addition & 0 deletions src/AmqpBundle/Factory/ProducerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public function get($class, $connexion, array $exchangeOptions, array $queueOpti
$exchange = new $this->exchangeClass($channel);
$exchange->setName($exchangeOptions['name']);
$exchange->setType($exchangeOptions['type']);
$exchange->setArguments($exchangeOptions['arguments']);
$exchange->setFlags(
($exchangeOptions['passive'] ? AMQP_PASSIVE : AMQP_NOPARAM) |
($exchangeOptions['durable'] ? AMQP_DURABLE : AMQP_NOPARAM) |
Expand Down
3 changes: 2 additions & 1 deletion src/AmqpBundle/Tests/Units/Factory/ProducerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public function testFactory()
'passive' => false,
'durable' => true,
'auto_delete' => false,
'routing_keys' => ['key']
'routing_keys' => ['key'],
'arguments' => ['alternate-exchange' => 'my-ae'],
])
->and($queueOptions = [
'name' => 'myqueue',
Expand Down

0 comments on commit e84a5a1

Please sign in to comment.