You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
I Have use case where I need to consume message, make some work and push it back to other queues. The problem is that DI container have some strange behavior in Worker application.
When I try to use AddRabbitMqClient(rabbitConnection) It will inject IQueueService, but application wont start,
managed to make work around by injecting .AddRabbitMqConsumingClientSingleton(rabbitConnection), because it injects only IConsuming service and then application starts successfully (MessageHandlerSingleton)
But when I Added .AddRabbitMqProducingClientSingleton(rabbitConnection) It fails.
First of all it will not inject IQueueService we can check that in IServiceCollection List, so I can reach produce methods only by injecting IProduceService to send some messages to rabbit.
Consuming still works after adding ProducingClientSingleton
But When I try to inject IProducingService producingService to Message Handler application freezes and DI container do not construct MessageHandler Singleton and ConsumingService anymore and there is no any error messages. :/
I am trying to make connection to the same server but different exchanges, maybe I have missed something in the documentation ?
RabbitMQ.Client.Core.DependencyInjection V4.3.0
.Net core 3.1
The text was updated successfully, but these errors were encountered:
danieliu456
changed the title
Cannot Produce and Consume messages in same application
Can't Produce and Consume messages in same application
Dec 17, 2020
I Have use case where I need to consume message, make some work and push it back to other queues. The problem is that DI container have some strange behavior in Worker application.
When I try to use
AddRabbitMqClient(rabbitConnection)
It will inject IQueueService, but application wont start,managed to make work around by injecting .AddRabbitMqConsumingClientSingleton(rabbitConnection), because it injects only IConsuming service and then application starts successfully (MessageHandlerSingleton)
But when I Added
.AddRabbitMqProducingClientSingleton(rabbitConnection)
It fails.First of all it will not inject IQueueService we can check that in IServiceCollection List, so I can reach produce methods only by injecting IProduceService to send some messages to rabbit.
Consuming still works after adding ProducingClientSingleton
But When I try to inject
IProducingService producingService
to Message Handler application freezes and DI container do not construct MessageHandler Singleton and ConsumingService anymore and there is no any error messages. :/I am trying to make connection to the same server but different exchanges, maybe I have missed something in the documentation ?
RabbitMQ.Client.Core.DependencyInjection V4.3.0
.Net core 3.1
The text was updated successfully, but these errors were encountered: