| @@ 69-83 (lines=15) @@ | ||
| 66 | return $this; |
|
| 67 | } |
|
| 68 | ||
| 69 | private function registerExchanges( |
|
| 70 | array $config, |
|
| 71 | ContainerBuilder $container |
|
| 72 | ): self { |
|
| 73 | $autoDeclare = $container->getDefinition('innmind.amqp.client.auto_declare'); |
|
| 74 | ||
| 75 | foreach ($config['exchanges'] as $name => $exchange) { |
|
| 76 | $autoDeclare->addMethodCall( |
|
| 77 | 'declareExchange', |
|
| 78 | [$name, $exchange['type'], $exchange['durable'], $exchange['arguments']] |
|
| 79 | ); |
|
| 80 | } |
|
| 81 | ||
| 82 | return $this; |
|
| 83 | } |
|
| 84 | ||
| 85 | private function registerQueues( |
|
| 86 | array $config, |
|
| @@ 106-120 (lines=15) @@ | ||
| 103 | return $this; |
|
| 104 | } |
|
| 105 | ||
| 106 | private function registerBindings( |
|
| 107 | array $config, |
|
| 108 | ContainerBuilder $container |
|
| 109 | ): self { |
|
| 110 | $autoDeclare = $container->getDefinition('innmind.amqp.client.auto_declare'); |
|
| 111 | ||
| 112 | foreach ($config['bindings'] as $binding) { |
|
| 113 | $autoDeclare->addMethodCall( |
|
| 114 | 'declareBinding', |
|
| 115 | [$binding['exchange'], $binding['queue'], $binding['routingKey'], $binding['arguments']] |
|
| 116 | ); |
|
| 117 | } |
|
| 118 | ||
| 119 | return $this; |
|
| 120 | } |
|
| 121 | ||
| 122 | private function registerProducers( |
|
| 123 | array $config, |
|