I could not find another place to post this, so I'm posting it here... (if there is a better place, please let me know)
I just upgraded my project from MassTransit 2.x to 3.x. I followed the instructions at http://masstransit.readthedocs.org/en/master/migrating/index.html and get this error when registering a consumer...
The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text="PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'queuename' in vhost '/': received 'false' but current is 'true'", classId=50, methodId=10, cause=
The queue is created on the RabbitMQ server as durable. So I am puzzled as to what the error means.
Thanks for any help you can provide...
It appears that the queue already exists as a durable queue, but the service is specifying that the queue should _not_ be durable (false). Either change the application code to specify a durable queue (the default for receive endpoints), or remove the queue and let MassTransit recreate it as non-durable.
If you're stuck, please post your bus configuration code to assist in troubleshooting the issue.
I deleted all my queues in RabbitMQ and restarted. It creates the Durable queue and then throws these errors.
This is my Start method on a Windows service started with Topshelf. "_scope" is my lifetime scope created with Autofac.
var queuePath = "rabbitmq://localhost";
var formattedQueueName = "Sub_EmailProcessor";
var username = _configHelper.GetSetting("RabbitMqUsername", "guest");
var password = _configHelper.GetSetting("RabbitMqPassword", "guest");
_emailServiceBus = _emailServiceBus ?? Bus.Factory.CreateUsingRabbitMq(sbc =>
{
var host = sbc.Host(new Uri(queuePath), h =>
{
h.Username(username);
h.Password(password);
});
sbc.UseRetry(Retry.Immediate(5));
sbc.ReceiveEndpoint(host, formattedQueueName, ep =>
{
ep.Consumer<UserCreatedEmailConsumer>(_scope);
ep.Consumer<UserPasswordResetEmailConsumer>(_scope);
ep.Consumer<UserQuestionsResetEmailConsumer>(_scope);
ep.Consumer<ClaimPricedEmailConsumer>(_scope);
});
sbc.BusQueueName = formattedQueueName;
});
_emailServiceBus.Start();
Don't set BusQueueName. The help text should give an indication but it is only there to support some cases that are almost never valid.
The bus has a default endpoint, and it uses a machine generated name for that endpoint. By setting it, and by making it the same as your receive endpoint, you are creating two endpoints on the same queue which is bad.
Just remove that call and you're all set.
That worked. So is there a case where you would use BusQueueName?
If I had a bus that only publishes messages, is a queue name used? I assumed that BusQueueName would be used for that.
Thanks
Just forget it exists and you'll be fine!
Glad you got it working.
com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method
Hello guys please help me i'm getting such type of issue.
Your RabbitMQ server doesn't match what MT is expecting (durable vs non-durable). Change your code, or change the setting on the broker (might have to remove it and let MT recreate it). @shyamlalRishabh
rabbitMqChannel.QueueDeclare(queue: queueName,
durable: true,
exclusive: false,
autoDelete: false,
arguments: null);
Making durable as true works for me!
Most helpful comment
It appears that the queue already exists as a durable queue, but the service is specifying that the queue should _not_ be durable (false). Either change the application code to specify a durable queue (the default for receive endpoints), or remove the queue and let MassTransit recreate it as non-durable.
If you're stuck, please post your bus configuration code to assist in troubleshooting the issue.