Closed sabbadino closed 4 years ago
(...) he wants to create a single topic for all the application
It sounds like your OPS person has not quite understood the Azure Service Bus model. 🙂
With Azure Service Bus, you usually create a topic for each type of event that you intend to publish. Or, actually, for each "topic" that you intend to publish, but the definition of what constitutes a "topic" is entirely up to you, the developer... Rebus defaults to treating each type of event as a topic.
With Rebus, topics get created automatically like this:
await bus.Publish(new SomeEvent());
await bus.Publish(new AnotherEvent());
in this case creating two topics named after the .NET types SomeEvent
and AnotherEvent
.
When those topics exist, subscribers subscribe by establishing a subscription. The best way to do that with Azure Service Bus, is to establish the subscription and configure it to forward the received messages to the subscriber's input queue.
All of this happens automatically with Rebus when a subscriber goes
await bus.Subscribe<SomeEvent>();
await bus.Subscribe<AnotherEvent>();
Using this model, a single subscriber may subscribe to multiple topics, using only one single input queue.
It's totally possible to use Rebus without management rights, you just need to tell Rebus to stay away from trying to automatically create and/or check anything:
Configure.With(...)
.Transport(t => {
t.UseAzureServiceBus(connectionString, "subscriber_queue_name")
.DoNotCreateQueues()
.DoNotCheckQueueConfiguration();
})
.(...)
.Start();
In my opinion, the creation of topics and subscriptions in an application is more like inserting rows in a table in your database, where it sounds like your OPS person sees it more on the level of maintaining the schema of the database.
Being a nuanced guy, I can see good reasons for both views, I just happen to lean towards the "do-that-stuff-at-runtime" camp.
But as you can see, it's totally possible to use Rebus, even if you insist on maintaining your messaging topology by hand. it just requires that you be very meticulous about it, and you configure Rebus to not try to be helpful.
Let me know if you need any more guidance 🙂
HI, we are planning to use rebus to have some microservices communicate each other. Who runs the azure infrastructure don't want to let us (rebus) to create topics and queues and subscribers . He says he wants to create a single topic for all the application .. and that he will create manually the queues and subscribers we need.
Is it possible to use Rebus with such constraints ?
thank you Enrico