Skip to content

Commit 94266df

Browse files
Continue to attempt recovery every [configured time span]
1 parent 298d9f2 commit 94266df

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

projects/client/RabbitMQ.Client/src/client/impl/AutorecoveringConnection.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,22 @@ public void BeginAutomaticRecovery()
514514

515515
protected void RecoverConnectionDelegate()
516516
{
517-
this.m_delegate = new Connection(m_factory, false, m_factory.CreateFrameHandler());
517+
var recovering = true;
518+
while(recovering)
519+
{
520+
try
521+
{
522+
this.m_delegate =
523+
new Connection(m_factory, false,
524+
m_factory.CreateFrameHandler());
525+
recovering = false;
526+
} catch (Exception e)
527+
{
528+
// TODO: exponential back-off
529+
Thread.Sleep(m_factory.NetworkRecoveryInterval);
530+
// TODO: provide a way to handle these exceptions
531+
}
532+
}
518533
}
519534

520535
protected void RecoverConnectionShutdownHandlers()

0 commit comments

Comments
 (0)