Exchange.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Amqp\Model;
  7. use Magento\Framework\MessageQueue\ConfigInterface as QueueConfig;
  8. use Magento\Framework\Communication\ConfigInterface as CommunicationConfigInterface;
  9. use Magento\Framework\MessageQueue\Publisher\ConfigInterface as PublisherConfig;
  10. use Magento\Framework\MessageQueue\Rpc\ResponseQueueNameBuilder;
  11. /**
  12. * {@inheritdoc}
  13. *
  14. * @deprecated 100.2.0
  15. */
  16. class Exchange extends \Magento\Framework\Amqp\Exchange
  17. {
  18. /**
  19. * Initialize dependencies.
  20. *
  21. * @param Config $amqpConfig
  22. * @param QueueConfig $queueConfig
  23. * @param CommunicationConfigInterface $communicationConfig
  24. * @param int $rpcConnectionTimeout
  25. *
  26. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  27. */
  28. public function __construct(
  29. Config $amqpConfig,
  30. QueueConfig $queueConfig,
  31. CommunicationConfigInterface $communicationConfig,
  32. $rpcConnectionTimeout = self::RPC_CONNECTION_TIMEOUT
  33. ) {
  34. parent::__construct(
  35. $amqpConfig,
  36. $this->getPublisherConfig(),
  37. $this->getResponseQueueNameBuilder(),
  38. $communicationConfig,
  39. $rpcConnectionTimeout
  40. );
  41. }
  42. /**
  43. * Get publisher config.
  44. *
  45. * @return PublisherConfig
  46. *
  47. * @deprecated 100.2.0
  48. */
  49. private function getPublisherConfig()
  50. {
  51. return \Magento\Framework\App\ObjectManager::getInstance()->get(PublisherConfig::class);
  52. }
  53. /**
  54. * Get response queue name builder.
  55. *
  56. * @return ResponseQueueNameBuilder
  57. *
  58. * @deprecated 100.2.0
  59. */
  60. private function getResponseQueueNameBuilder()
  61. {
  62. return \Magento\Framework\App\ObjectManager::getInstance()->get(ResponseQueueNameBuilder::class);
  63. }
  64. }