RabbitMQ.Client.Core.DependencyInjection icon indicating copy to clipboard operation
RabbitMQ.Client.Core.DependencyInjection copied to clipboard

Consuming from queue when Exchange to Exchange binding set

Open gzres opened this issue 4 years ago • 0 comments

I have such situation: Message are passed to FirstExchange with some.routing.key FirstExchange binds some.routing.key to SecondExchange exchange SecondExchange binds some.routing.key to queue MyQueue.

Using code

var rabbitMqSection = hostContext.Configuration.GetSection("RabbitMq");
var exchangeSection = hostContext.Configuration.GetSection("RabbitMqExchange");

services.AddRabbitMqServices(rabbitMqSection)
                .AddConsumptionExchange("SecondExchange", exchangeSection)
                .AddMessageHandlerTransient<MyMessageHandler>("some.routing.key");

messages from MyQueue are on Unacked state but nothing happens in MyMessageHandler logs in Console are empty. When I shutdown worker messages return to queue with Ready state.

How to start processing messages from MyQueue inMyMessageHandler?

Im using version 5 of library. Thanks for help.

gzres avatar Dec 29 '21 12:12 gzres