File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
projects/client/RabbitMQ.Client/src/client/impl Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ public void init()
92
92
var self = this ;
93
93
ConnectionShutdownEventHandler recoveryListener = ( _ , args ) =>
94
94
{
95
- if ( args . Initiator == ShutdownInitiator . Peer )
95
+ if ( ShouldTriggerConnectionRecovery ( args ) )
96
96
{
97
97
try
98
98
{
@@ -111,6 +111,14 @@ public void init()
111
111
}
112
112
}
113
113
114
+ protected bool ShouldTriggerConnectionRecovery ( ShutdownEventArgs args )
115
+ {
116
+ return ( args . Initiator == ShutdownInitiator . Peer ||
117
+ // happens when EOF is reached, e.g. due to RabbitMQ node
118
+ // connectivity loss or abrupt shutdown
119
+ args . Initiator == ShutdownInitiator . Library ) ;
120
+ }
121
+
114
122
115
123
public event ConnectionShutdownEventHandler ConnectionShutdown
116
124
{
You can’t perform that action at this time.
0 commit comments