AmqpReceivedStamp.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Messenger\Bridge\Amqp\Transport;
  11. use Symfony\Component\Messenger\Stamp\NonSendableStampInterface;
  12. /**
  13. * Stamp applied when a message is received from Amqp.
  14. */
  15. class AmqpReceivedStamp implements NonSendableStampInterface
  16. {
  17. private $amqpEnvelope;
  18. private $queueName;
  19. public function __construct(\AMQPEnvelope $amqpEnvelope, string $queueName)
  20. {
  21. $this->amqpEnvelope = $amqpEnvelope;
  22. $this->queueName = $queueName;
  23. }
  24. public function getAmqpEnvelope(): \AMQPEnvelope
  25. {
  26. return $this->amqpEnvelope;
  27. }
  28. public function getQueueName(): string
  29. {
  30. return $this->queueName;
  31. }
  32. }
  33. class_alias(AmqpReceivedStamp::class, \Symfony\Component\Messenger\Transport\AmqpExt\AmqpReceivedStamp::class);