Topology.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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\Amqp\Topology\ExchangeInstaller;
  8. use Magento\Framework\Amqp\Topology\QueueInstaller;
  9. use Magento\Framework\MessageQueue\ConfigInterface as QueueConfig;
  10. use Magento\Framework\Communication\ConfigInterface as CommunicationConfig;
  11. use Magento\Framework\MessageQueue\Topology\ConfigInterface as TopologyConfig;
  12. use Magento\Framework\Amqp\ConfigPool;
  13. use Magento\Framework\Amqp\ConnectionTypeResolver;
  14. use Magento\Framework\Amqp\TopologyInstaller;
  15. /**
  16. * Class Topology creates topology for Amqp messaging
  17. *
  18. * @deprecated 100.2.0
  19. */
  20. class Topology extends TopologyInstaller
  21. {
  22. /**
  23. * Type of exchange
  24. *
  25. * @deprecated
  26. */
  27. const TOPIC_EXCHANGE = 'topic';
  28. /**
  29. * Amqp connection
  30. */
  31. const AMQP_CONNECTION = 'amqp';
  32. /**
  33. * Durability for exchange and queue
  34. *
  35. * @deprecated
  36. */
  37. const IS_DURABLE = true;
  38. /**
  39. * Initialize dependencies
  40. *
  41. * @param Config $amqpConfig
  42. * @param QueueConfig $queueConfig
  43. * @param CommunicationConfig $communicationConfig
  44. * @param \Psr\Log\LoggerInterface $logger
  45. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  46. */
  47. public function __construct(
  48. Config $amqpConfig,
  49. QueueConfig $queueConfig,
  50. CommunicationConfig $communicationConfig,
  51. \Psr\Log\LoggerInterface $logger
  52. ) {
  53. parent::__construct(
  54. \Magento\Framework\App\ObjectManager::getInstance()->get(TopologyConfig::class),
  55. \Magento\Framework\App\ObjectManager::getInstance()->get(ExchangeInstaller::class),
  56. \Magento\Framework\App\ObjectManager::getInstance()->get(ConfigPool::class),
  57. \Magento\Framework\App\ObjectManager::getInstance()->get(QueueInstaller::class),
  58. \Magento\Framework\App\ObjectManager::getInstance()->get(ConnectionTypeResolver::class),
  59. $logger
  60. );
  61. }
  62. }