System.NotSupportedException: Pipelining of requests forbidden
See original GitHub issueHi,
I have the following issue.
In my local machine RabbitMQ works fine with no issue. Local Version is 3.7.0, Erlang 20.1.
But when I try to use other (using network) version of RabbitMQ it sends me the following exception Version 3.6.14 Erlang 18.3
System.NotSupportedException: Pipelining of requests forbidden at RabbitMQ.Client.Impl.RpcContinuationQueue.Enqueue(IRpcContinuation k) at RabbitMQ.Client.Impl.ModelBase.Enqueue(IRpcContinuation k) at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body) at RabbitMQ.Client.Framing.Impl.Model._Private_ExchangeDeclare(String exchange, String type, Boolean passive, Boolean durable, Boolean autoDelete, Boolean internal, Boolean nowait, IDictionary2 arguments) at RabbitMQ.Client.Impl.ModelBase.ExchangeDeclare(String exchange, String type, Boolean durable, Boolean autoDelete, IDictionary2 arguments) at EasyNetQ.RabbitAdvancedBus.<>c__DisplayClass33_0.<ExchangeDeclareAsync>b__1(IModel x) at EasyNetQ.Producer.ClientCommandDispatcherSingleton.<>c__DisplayClass8_0.<InvokeAsync>b__0(IModel x) at EasyNetQ.Producer.ClientCommandDispatcherSingleton.<>c__DisplayClass7_01.b__1(IModel channel) at EasyNetQ.Producer.PersistentChannel.InvokeChannelAction(Action1 channelAction) at EasyNetQ.Producer.ClientCommandDispatcherSingleton.<>c__DisplayClass7_01.b__0() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at EasyNetQ.RabbitAdvancedBus.d__33.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at EasyNetQ.Producer.PublishExchangeDeclareStrategy.d__4.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at EasyNetQ.RabbitBus.d__131.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at WOF.Bus.Infrastructure.EasyNetQBusAdapter.<PublishAsync>d__61.MoveNext()'`
Issue Analytics
- State:
- Created 5 years ago
- Comments:47 (27 by maintainers)
Top GitHub Comments
Hi guys, recently I’ve been facing exactly the same exception and after some investigating I found out this is related to passive declaration (either IModel.QueueDeclarePassive and IModel.ExchangeDeclarePassive). As stated in rabbitmq client docu (https://www.rabbitmq.com/dotnet-api-guide.html#passive-declaration) if queue/exchange doesn’t exists you’ll get OperationInterruptedException and this channel cannot be used anymore. However, AdvancedBus when passing parameter passive = true will enqueue this operation and in case of error will still reuse persistent channel which will leads to massive NotSupportedExceptions. In our case we get rid of passive flag when executing QueueDeclare, proper soultion would involve recreating persistent channel in StartDispatcherThread when handling OperationInterruptedException in ClientCommandDispatcherSingleton as OperationInterrupted is a channel-level exception. I might test it in near future. Hope it helps
Hey. I had the same problems. I have proxies for some interfaces and got a stack:
I logged thread ids. It turned out that the error occurs when the InternalConsumer object is dispose:
public void Dispose()
{
if (this.disposed)
return;
this.disposed = true;
if (this.Model == null)
return;
this.consumerDispatcher.QueueAction((Action) (() => //this code
{
this.Model.Dispose();
foreach (BasicConsumer basicConsumer in (IEnumerable<BasicConsumer>) this.basicConsumers)
basicConsumer.Dispose();
}));
` }consumerDispatcher thread id == thread id of method caller.
I copy InternalConsumerFactory implementation and InternalConsumer implementation. In InternalConsumerFactory i create my InternalConsumer. In InternalConsumer i remove dispatcher call and NotSupportedException error disappeared. I use this code:
public void Dispose()
{
if (this.disposed)
return;
this.disposed = true;
if (this.Model == null)
return;
this.Model.Dispose();
foreach (BasicConsumer basicConsumer in (IEnumerable<BasicConsumer>) this.basicConsumers)
basicConsumer.Dispose();
}