1

I'm using EasyNetQ to send a message in a queue of rabbit.

I have a code like this

using (var bus = RabbitHutch.CreateBus("MyConnection"))
{                
       bus.Send("MyCodeName", "MyClass");
}

the connection is open when I create the bus, but there is this error when I send the message

The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text="PRECONDITION_FAILED - inequivalent arg 'x-max-priority' for queue ....: received none but current is the value '10' of type 'long'", classId=50, methodId=10, cause=

I setup the queue with x-max-priority: 10. I have to setup anything else in the connection string?

user3401335
  • 2,335
  • 2
  • 19
  • 32
  • what is RabbitHutch ? How about ask the question to the manufacturer of this RabbitHutch ? –  Jul 01 '16 at 09:35
  • sorry, i've modified the question. RabbitHutch is a class of easynetq used to connect to rabbit queue – user3401335 Jul 01 '16 at 09:37
  • this probably can help you : http://stackoverflow.com/questions/15290541/easynetq-model-shutdown –  Jul 01 '16 at 09:40

2 Answers2

1

I have resolved without using Send method

EasyNetQ

Infact the send method, tries to create a queue before send message. I have used the publish method

user3401335
  • 2,335
  • 2
  • 19
  • 32
0

Delete the queue/exchange first and try again.

Don't use 'using' around the bus instance, instead instantiate it once in your application and dispose on quit.

Wiebe Tijsma
  • 10,173
  • 5
  • 52
  • 68