10

Rather than having my unhandled exceptions go into EasyNetQ_Default_Error_Queue I wondered if there is a way that I can explicitly state the name of an Error Queue that should be used for a given application, so errors don't ALL end up in this one EasyNetQ_Default_Error_Queue?

I can see how to specify regular message queue names but haven't managed to find anything about Error Queue names.

Wiebe Tijsma
  • 10,173
  • 5
  • 52
  • 68
marcusstarnes
  • 6,393
  • 14
  • 65
  • 112

1 Answers1

13

Yes, you can customize the naming conventions by overriding the delegates on the IConventions object (or just create your own implementation of it and register that as a dependency):

https://github.com/EasyNetQ/EasyNetQ/blob/master/Source/EasyNetQ.Tests/ConventionsTests.cs

This should probably work:

var bus = RabbitHutch.CreateBus("host=localhost");
bus.Advanced.Container.Resolve<IConventions>().ErrorExchangeNamingConvention = info => "MyExchangeNaming";
bus.Advanced.Container.Resolve<IConventions>().ErrorQueueNamingConvention = () => "MyErrorQueueNaming";
Wiebe Tijsma
  • 10,173
  • 5
  • 52
  • 68
  • 1
    Thanks Zidad. Works great. My only issue after doing this is now: http://stackoverflow.com/questions/28738683/is-there-a-way-to-specify-a-different-error-queue-when-using-easynetq-hosepipe – marcusstarnes Feb 26 '15 at 09:30