Closed riezebosch closed 1 year ago
just discovered this PR when I was about to create one. I just made similar changes as I need this feature as well because our service bus is enterprise wide and is treated as a managed resource where creation of new topics/queues/subscriptions is done via IaC and requires going through an approval process.
FYI, I discovered Rebus works as-is (i.e. using DoNotCreateQueues().DoNotCheckQueueConfiguration()) as long as you do not make any Subscribe calls. I was using common code for multiple service bus namespaces (some of which do not allow manage) and this was my issue.
What does this PR actually do? You can easily avoid creating/interrogating subscriptions by avoiding making any calls to
await bus.Subscribe<TEvent>();
// and
await bus.Unsubscribe<TEvent>();
as well as their generic siblings
var topics = bus.Advanced.Topics;
await topics.Subscribe("some-topic");
// and
await topics.Unsubscribe("some-topic");
But do I then still receive any messages? Oh, sure do as long as they are forwarded to the queue for sure 🤦🏻 .
fix #94
Rebus is MIT-licensed. The code submitted in this pull request needs to carry the MIT license too. By leaving this text in, I hereby acknowledge that the code submitted in the pull request has the MIT license and can be merged with the Rebus codebase.