antonyvorontsov / RabbitMQ.Client.Core.DependencyInjection

.Net Core library-wrapper of RabbitMQ.Client for Dependency Injection.
MIT License
111 stars 36 forks source link

Make it possible to work without configuring exchanges and queues in services #38

Open gzres opened 4 years ago

gzres commented 4 years ago

I would like to have possibility to run this library without creating exchanges and queues in service. I want to configure all aspects of exchanges and queues directly in RMQ. As I see in source for now its not possible because of method ValidateArguments in QueueService.cs.

What do you think?

antonyvorontsov commented 4 years ago

Hi, Grzegorz!

Good thought, but it goes across of the current implementation of the library. As you can see, I created a project inside this repository and I've just finished making a new version of the library (just released it with 4.0.0 version). My top priority right now is to make some unit/integration tests for this library (you can see it in the project that I have already mentioned). And after that I will be more free for changes that can change the basic behaviour (previously incorporated).

So I added your issue as a TODO task and will take a look at it ASAP.

For now you can make a little "hack". You can define exchanges only which you use in your application, but you can leave queue declaring. So configuration section will be simplified and it will allow you to use QueueService as a producer easily.

But remember that RabbitMQ maintainers advice to declare exchanges/queues in each application regardless of whether they were declared manually or automatically.

Best regards, Antony