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