diff --git a/Transport/Connection.php b/Transport/Connection.php index b49bc95..260e226 100644 --- a/Transport/Connection.php +++ b/Transport/Connection.php @@ -13,6 +13,7 @@ use Symfony\Component\Messenger\Exception\InvalidArgumentException; use Symfony\Component\Messenger\Exception\LogicException; +use Symfony\Component\Messenger\Exception\TransportException; /** * An AMQP connection. @@ -493,7 +494,7 @@ public function channel(): \AMQPChannel $this->amqpChannel->confirmSelect(); $this->amqpChannel->setConfirmCallback( static fn (): bool => false, - static fn (): bool => false + static fn () => throw new TransportException('Message publication failed due to a negative acknowledgment (nack) from the broker.'), ); }