objectManager = $objectManager; } /** * @param string $connectionName * @return ExchangeInterface * @throws \LogicException */ public function getByConnectionName($connectionName) { if (!isset($this->exchangePool[$connectionName])) { $exchange = $this->getExchangeFactory()->create($connectionName); $this->exchangePool[$connectionName] = $exchange; } return $this->exchangePool[$connectionName]; } /** * Get exchange factory. * * @return ExchangeFactoryInterface * @deprecated 102.0.1 */ private function getExchangeFactory() { if ($this->exchangeFactory === null) { $this->exchangeFactory = $this->objectManager->get(ExchangeFactoryInterface::class); } return $this->exchangeFactory; } }