How to fetch an existing Exchange or Queue in EasyNetQ?
See original GitHub issueI am using EasyNetQ and I am wondering how to fetch an existing IExchange
and IQueue
without subscribing beforehand?
In the IAdvanceBus
I can only see:
ExchangeDeclareAsync
QueueDeclareAsync
But I am not sure really whether those will override an existing queue or exchange with the same name?
Also how can I be sure that that queue or exchange exist before trying to fetch / declare it?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to fetch an existing Exchange or Queue in EasyNetQ?
If an exchange or queue with the given name already exists, it will simply be returned. In fact, exchanges and queues in RabbitMQ...
Read more >RabbitMQ tutorial - Publish/Subscribe
This step is necessary as publishing to a non-existing exchange is forbidden. The messages will be lost if no queue is bound to...
Read more >13 Common RabbitMQ Mistakes and How to Avoid Them
You should not be afraid of creating new queues, it's good to separate into many queues if you can do so, and it's...
Read more >Building a Topic Exchange with RabbitMQ and .NET 6
Topic exchanges route messages to one or many queues based on ... types of exchange available in RabbitMQ, then checkout the documentation.
Read more >Exchanges bound together with EasyNetQ
I've bound this delayed-message exchange to the exchange of the first "primary" queue. So now, I can have timed retries of messages that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I did not take measurements. This is just a wrapper around RabbitMQ HTTP API. The disadvantage of this method is that an user account with elevated rights is required (It may differ from your “runtime” user account from connection string).
Actually, I have not looked at the repo for a long time. Now I see that there are methods
IAdvancedBus.QueueDeclarePassiveAsync
/IAdvancedBus.ExchangeDeclarePassiveAsync
which, according to its description, does just what you need.ManagementClient is the way to go, thanks @sungam3r! I’m going to close this issue.