Question

My Queue name is "TaskQueue" but when i run code, create new queue which name is "System_String:mscorlib_TaskQueue". My Subscriber code below. What is my fault?

var bus = RabbitHutch.CreateBus("host=localhost;username=guest;password=guest");
bus.SubscribeAsync<string>("TaskQueue", (msg) =>
    Task.Factory.StartNew(() =>
    {
       Console.WriteLine("Got Message: {0}", msg);
    }));
Was it helpful?

Solution

Basically you're doing it right. However, TaskQueue is the subscription id and not the name of the queue which gets generated.

By default EasyNetQ will use the subscription id and the type of the message for generating the name of the queue. Hence, it's named System_String:mscorlib_TaskQueue So all subscriptions with the id TaskQueue will be treated as concurrent consumers.

See https://github.com/EasyNetQ/EasyNetQ/wiki/Subscribe

You could change this behavior with Taking Control Of The SubscriptionId Generation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top