ConfigInterface.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\MessageQueue;
  7. use Magento\Framework\Exception\LocalizedException;
  8. /**
  9. * @deprecated 102.0.1
  10. */
  11. interface ConfigInterface
  12. {
  13. const PUBLISHERS = 'publishers';
  14. const PUBLISHER_NAME = 'name';
  15. const PUBLISHER_CONNECTION = 'connection';
  16. const PUBLISHER_EXCHANGE = 'exchange';
  17. const TOPICS = 'topics';
  18. const TOPIC_NAME = 'name';
  19. const TOPIC_PUBLISHER = 'publisher';
  20. const TOPIC_SCHEMA = 'schema';
  21. const TOPIC_RESPONSE_SCHEMA = 'response_schema';
  22. const TOPIC_SCHEMA_TYPE = 'schema_type';
  23. const TOPIC_SCHEMA_VALUE = 'schema_value';
  24. const TOPIC_SCHEMA_TYPE_OBJECT = 'object';
  25. const TOPIC_SCHEMA_TYPE_METHOD = 'method_arguments';
  26. const SCHEMA_METHOD_PARAM_NAME = 'param_name';
  27. const SCHEMA_METHOD_PARAM_POSITION = 'param_position';
  28. const SCHEMA_METHOD_PARAM_TYPE = 'param_type';
  29. const SCHEMA_METHOD_PARAM_IS_REQUIRED = 'is_required';
  30. const CONSUMERS = 'consumers';
  31. const CONSUMER_NAME = 'name';
  32. const CONSUMER_QUEUE = 'queue';
  33. const CONSUMER_CONNECTION = 'connection';
  34. const CONSUMER_INSTANCE_TYPE = 'instance_type';
  35. const CONSUMER_CLASS = 'type';
  36. const CONSUMER_METHOD = 'method';
  37. const CONSUMER_MAX_MESSAGES = 'max_messages';
  38. const CONSUMER_HANDLERS = 'handlers';
  39. const CONSUMER_HANDLER_TYPE = 'type';
  40. const CONSUMER_HANDLER_METHOD = 'method';
  41. const CONSUMER_TYPE = 'consumer_type';
  42. const CONSUMER_TYPE_SYNC = 'sync';
  43. const CONSUMER_TYPE_ASYNC = 'async';
  44. const RESPONSE_QUEUE_PREFIX = 'responseQueue.';
  45. const BINDS = 'binds';
  46. const BIND_QUEUE = 'queue';
  47. const BIND_EXCHANGE = 'exchange';
  48. const BIND_TOPIC = 'topic';
  49. const BROKER_TOPIC = 'topic';
  50. const BROKER_TYPE = 'type';
  51. const BROKER_EXCHANGE = 'exchange';
  52. const BROKER_CONSUMERS = 'consumers';
  53. const BROKER_CONSUMER_NAME = 'name';
  54. const BROKER_CONSUMER_QUEUE = 'queue';
  55. const BROKER_CONSUMER_INSTANCE_TYPE = 'instance_type';
  56. const BROKER_CONSUMER_MAX_MESSAGES = 'max_messages';
  57. const BROKERS = 'brokers';
  58. /**
  59. * Map which allows optimized search of queues corresponding to the specified exchange and topic pair.
  60. */
  61. const EXCHANGE_TOPIC_TO_QUEUES_MAP = 'exchange_topic_to_queues_map';
  62. /**
  63. * Identify configured exchange for the provided topic.
  64. *
  65. * @param string $topicName
  66. * @return string
  67. * @throws LocalizedException
  68. * @see \Magento\Framework\MessageQueue\Publisher\ConfigInterface::getPublisher
  69. */
  70. public function getExchangeByTopic($topicName);
  71. /**
  72. * Identify a list of all queue names corresponding to the specified topic (and implicitly exchange).
  73. *
  74. * @param string $topic
  75. * @return string[]
  76. * @throws LocalizedException
  77. * @see \Magento\Framework\MessageQueue\Topology\ConfigInterface::getQueues
  78. */
  79. public function getQueuesByTopic($topic);
  80. /**
  81. * @param string $topic
  82. * @return string
  83. * @throws LocalizedException
  84. * @see \Magento\Framework\MessageQueue\Publisher\ConfigInterface::getPublisher
  85. */
  86. public function getConnectionByTopic($topic);
  87. /**
  88. * @param string $consumer
  89. * @return string
  90. * @throws LocalizedException
  91. * @see \Magento\Framework\MessageQueue\Consumer\ConfigInterface::getConsumer
  92. */
  93. public function getConnectionByConsumer($consumer);
  94. /**
  95. * Identify which option is used to define message schema: data interface or service method params
  96. *
  97. * @param string $topic
  98. * @return string
  99. * @see \Magento\Framework\Communication\ConfigInterface::getTopic
  100. */
  101. public function getMessageSchemaType($topic);
  102. /**
  103. * Get all consumer names
  104. *
  105. * @return string[]
  106. * @see \Magento\Framework\MessageQueue\Consumer\ConfigInterface::getConsumers
  107. */
  108. public function getConsumerNames();
  109. /**
  110. * Get consumer configuration
  111. *
  112. * @param string $name
  113. * @return array|null
  114. * @see \Magento\Framework\MessageQueue\Consumer\ConfigInterface::getConsumer
  115. */
  116. public function getConsumer($name);
  117. /**
  118. * Get queue binds
  119. *
  120. * @return array
  121. * @see \Magento\Framework\MessageQueue\Topology\ConfigInterface::getExchanges
  122. */
  123. public function getBinds();
  124. /**
  125. * Get publishers
  126. *
  127. * @return array
  128. * @see \Magento\Framework\MessageQueue\Publisher\ConfigInterface::getPublishers
  129. */
  130. public function getPublishers();
  131. /**
  132. * Get consumers
  133. *
  134. * @return array
  135. * @see \Magento\Framework\MessageQueue\Consumer\ConfigInterface::getConsumers
  136. */
  137. public function getConsumers();
  138. /**
  139. * Get topic config
  140. *
  141. * @param string $name
  142. * @return array
  143. * @see \Magento\Framework\Communication\ConfigInterface::getTopic
  144. * @see \Magento\Framework\MessageQueue\Publisher\ConfigInterface::getPublisher
  145. */
  146. public function getTopic($name);
  147. /**
  148. * Get published config
  149. * @param string $name
  150. *
  151. * @return array
  152. * @see \Magento\Framework\MessageQueue\Publisher\ConfigInterface::getPublisher
  153. */
  154. public function getPublisher($name);
  155. /**
  156. * Get queue name for response
  157. *
  158. * @param string $topicName
  159. * @return string
  160. * @see \Magento\Framework\MessageQueue\Rpc\ResponseQueueNameBuilder::getQueueName
  161. */
  162. public function getResponseQueueName($topicName);
  163. }