13 private $objectManager;
18 private $exchangeFactory;
25 private $exchangePool = [];
45 if (!isset($this->exchangePool[$connectionName])) {
46 $exchange = $this->getExchangeFactory()->create($connectionName);
47 $this->exchangePool[$connectionName] = $exchange;
49 return $this->exchangePool[$connectionName];
58 private function getExchangeFactory()
60 if ($this->exchangeFactory ===
null) {
61 $this->exchangeFactory = $this->objectManager->get(ExchangeFactoryInterface::class);
63 return $this->exchangeFactory;
__construct(\Magento\Framework\ObjectManagerInterface $objectManager, array $exchanges=[])
getByConnectionName($connectionName)