File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed
src/com/rabbitmq/client/impl Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,22 @@ public void releaseChannelNumber() {
168168 // incoming commands except for a close-ok.
169169
170170 Method method = command .getMethod ();
171+
172+ if (method instanceof Channel .Close ) {
173+ // Channel should always respond to Channel.Close
174+ // from the server
175+ releaseChannelNumber ();
176+ ShutdownSignalException signal = new ShutdownSignalException (false ,
177+ false ,
178+ command ,
179+ this );
180+ synchronized (this ) {
181+ processShutdownSignal (signal );
182+ quiescingTransmit (new Channel .CloseOk ());
183+ }
184+ notifyListeners ();
185+ return true ;
186+ }
171187 if (isOpen ()) {
172188 // We're in normal running mode.
173189
@@ -215,18 +231,6 @@ public void releaseChannelNumber() {
215231 }
216232 }
217233 return true ;
218- } else if (method instanceof Channel .Close ) {
219- releaseChannelNumber ();
220- ShutdownSignalException signal = new ShutdownSignalException (false ,
221- false ,
222- command ,
223- this );
224- synchronized (this ) {
225- processShutdownSignal (signal );
226- quiescingTransmit (new Channel .CloseOk ());
227- }
228- notifyListeners ();
229- return true ;
230234 } else {
231235 return false ;
232236 }
You can’t perform that action at this time.
0 commit comments