diff --git a/src/Transport/AmqpTransport.php b/src/Transport/AmqpTransport.php index fb96b4d..58f14eb 100644 --- a/src/Transport/AmqpTransport.php +++ b/src/Transport/AmqpTransport.php @@ -38,6 +38,13 @@ public function getHeartbeat(): int public function sendHeartbeat(): void { try { + if (\property_exists($this->connection, 'lastActivityTime')) { + $reflection = new \ReflectionClass($this->connection); + $property = $reflection->getProperty('lastActivityTime'); + $property->setAccessible(true); + $property->setValue($this->connection, time()); + } + $this->getMessageCount(); } catch (\Throwable $throwable) { if ($throwable instanceof TransportException || $throwable->getPrevious() instanceof TransportException) {