Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc2d994 commit d5b946dCopy full SHA for d5b946d
src/Symfony/Component/Messenger/Bridge/Amqp/Transport/AmqpReceiver.php
@@ -52,6 +52,12 @@ private function getEnvelope(string $queueName): iterable
52
{
53
try {
54
$amqpEnvelope = $this->connection->get($queueName);
55
+ } catch (\AMQPConnectionException) {
56
+ // Try to reconnect once to accommodate need for one of the nodes in cluster needing to stop serving the
57
+ // traffic. This may happen for example when one of the nodes in cluster is going into maintenance node.
58
+ // see https://github.com/php-amqplib/php-amqplib/issues/1161
59
+ $this->connection->queue($queueName)->getConnection()->reconnect();
60
+ $amqpEnvelope = $this->connection->get($queueName);
61
} catch (\AMQPException $exception) {
62
throw new TransportException($exception->getMessage(), 0, $exception);
63
}
0 commit comments