Skip to content

Commit 79bc62c

Browse files
committed
Merge pull request #191 from oleg-andreyev/adding-reconnect-ability
adding reconnect method
2 parents 8ab2650 + b35c489 commit 79bc62c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
- 2014-07-21
2+
* Added `reconnect` method into `OldSound\RabbitMqBundle\RabbitMq\BaseAmqp`
3+
14
- 2014-02-24
25
* Add a parameter to RPC client configuration to disable auto unserialize when adding call results to results array.
36

RabbitMq/BaseAmqp.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract class BaseAmqp
1515
protected $routingKey = '';
1616
protected $autoSetupFabric = true;
1717
protected $basicProperties = array('content_type' => 'text/plain', 'delivery_mode' => 2);
18-
18+
1919
protected $exchangeOptions = array(
2020
'passive' => false,
2121
'durable' => true,
@@ -66,6 +66,15 @@ public function __destruct()
6666
}
6767
}
6868

69+
public function reconnect()
70+
{
71+
if (!$this->conn->isConnected()) {
72+
return;
73+
}
74+
75+
$this->conn->reconnect();
76+
}
77+
6978
/**
7079
* @return AMQPChannel
7180
*/

0 commit comments

Comments
 (0)