question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to fetch an existing Exchange or Queue in EasyNetQ?

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sungam3rcommented, May 14, 2019

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.

0reactions
zidadcommented, May 15, 2019

ManagementClient is the way to go, thanks @sungam3r! I’m going to close this issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found