Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ private function getEnvelope(string $queueName): iterable
{
try {
$amqpEnvelope = $this->connection->get($queueName);
} catch (\AMQPConnectionException) {
// Try to reconnect once to accommodate need for one of the nodes in cluster needing to stop serving the
// traffic. This may happen for example when one of the nodes in cluster is going into maintenance node.
// see https://github.com/php-amqplib/php-amqplib/issues/1161
try {
$this->connection->queue($queueName)->getConnection()->reconnect();
$amqpEnvelope = $this->connection->get($queueName);
} catch (\AMQPException $exception) {
throw new TransportException($exception->getMessage(), 0, $exception);
}
} catch (\AMQPException $exception) {
throw new TransportException($exception->getMessage(), 0, $exception);
}
Expand Down