Skip to content

Commit 05d1460

Browse files
committed
Close a channel, cause don't deliver successful a incoming message when a consumer is running in other channel
(https://groups.google.com/forum/#!topic/rabbitmq-users/nHsouCO6nPw)
1 parent f27607b commit 05d1460

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ public void Shutdown()
2727
this.workService.StopWork();
2828
}
2929

30+
public void Shutdown(IModel model)
31+
{
32+
this.workService.StopWork(model);
33+
}
34+
3035
public bool IsShutdown
3136
{
3237
get;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,7 @@ void HandleModelShutdown(IBasicConsumer consumer,
7373
void Quiesce();
7474

7575
void Shutdown();
76+
77+
void Shutdown(IModel model);
7678
}
7779
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public void Close(ShutdownEventArgs reason, bool abort)
298298
_Private_ChannelClose(reason.ReplyCode, reason.ReplyText, 0, 0);
299299
}
300300
k.Wait();
301-
ConsumerDispatcher.Shutdown();
301+
ConsumerDispatcher.Shutdown(this);
302302
}
303303
catch (AlreadyClosedException ace)
304304
{
@@ -633,7 +633,7 @@ public void OnSessionShutdown(object sender, ShutdownEventArgs reason)
633633
SetCloseReason(reason);
634634
OnModelShutdown(reason);
635635
BroadcastShutdownToConsumers(m_consumers, reason);
636-
this.ConsumerDispatcher.Shutdown();
636+
this.ConsumerDispatcher.Shutdown(this);
637637
}
638638

639639
protected void BroadcastShutdownToConsumers(IDictionary<string, IBasicConsumer> cs, ShutdownEventArgs reason)

0 commit comments

Comments
 (0)