PublisherInterface.php 645 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\MessageQueue;
  7. /**
  8. * Producer to publish messages via a specific transport to a specific queue or exchange.
  9. *
  10. * @api
  11. * @since 102.0.1
  12. * @since 100.0.2
  13. */
  14. interface PublisherInterface
  15. {
  16. /**
  17. * Publishes a message to a specific queue or exchange.
  18. *
  19. * @param string $topicName
  20. * @param array|object $data
  21. * @return null|mixed
  22. * @throws \InvalidArgumentException If message is not formed properly
  23. * @since 102.0.1
  24. */
  25. public function publish($topicName, $data);
  26. }