File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/Symfony/Component/Messenger/Bridge/Amqp/Transport Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,16 @@ private function getEnvelope(string $queueName): iterable
52
52
{
53
53
try {
54
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
+ try {
60
+ $ this ->connection ->queue ($ queueName )->getConnection ()->reconnect ();
61
+ $ amqpEnvelope = $ this ->connection ->get ($ queueName );
62
+ } catch (\AMQPException $ exception ) {
63
+ throw new TransportException ($ exception ->getMessage (), 0 , $ exception );
64
+ }
55
65
} catch (\AMQPException $ exception ) {
56
66
throw new TransportException ($ exception ->getMessage (), 0 , $ exception );
57
67
}
You can’t perform that action at this time.
0 commit comments