Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to route to multiple ASB topics in the same namespace #48

Open
marcselis opened this issue Mar 17, 2022 · 5 comments
Open

Comments

@marcselis
Copy link

When setting up a router between a multi-schema SQL transport & a multi-topic ASB transport all subscriptions are created in the routers own ASB topic, instead of the topic where the event is published, causing the SQL subscribers not to receive the event.
Please see Azure Service Bus Transport issue #511 for more context.

@SzymonPobiega
Copy link
Owner

Hi @marcselis

I replied in the other thread in the ASB transport repo. If I understand correctly your scenario, it is possible to configure it with the current version of the Router.

@marcselis
Copy link
Author

Ok, I'm currently sick at home, but I'll have a look at it when I'm back at work.
Thanks!

@marcselis
Copy link
Author

If I understand your sample correctly, you propose to setup a router with 1 channel for SQL transport and a separate channel for each ASB topic. This can work, but we currently have 22 schema's in the SQL transport and I expect in a few years to also reach that same number of topics.
Do you think this setup is scalable enough? A single router with 23 channels?
And if the ASB endpoints want to send messages to SQL endpoints residing in different schema's, will the single SQL channel be suffucient? Or will they also need to be split-up in different channels?

@SzymonPobiega
Copy link
Owner

Do you think this setup is scalable enough? A single router with 23 channels?

Yes, I don't see any obvious problems there. An alternative solution could be to try to create a forwarding role between topics. I think that should be possible to create in Azure Service Bus. This is not supported by Router or NServiceBus so it would require manual maintenance but given you are going to make a heavy use of it, it might be worth developing a custom little tool that can connect the topics with forwarding and manage that.

And if the ASB endpoints want to send messages to SQL endpoints residing in different schema's, will the single SQL channel be suffucient?

One interface on the SQL side is enough because the SQL Server transport is catalog-aware. It can router between catalogs and schemas without external help.

@marcselis
Copy link
Author

Thanks @SzymonPobiega for the confirmation, but I think this is way to overcomplicated.

Topics in ASB are not used to physically divide endpoints in groups. They are only used while publishing an event. The subscriptions for a topic and their filters determine in what queue the published event will be placed for processing.

When routing a message or command between SQL and ASB, the topic is not important as the message can be deliverd directly in the destination endpoint's queue. The same is true when routing a message between ASB & SQL.
So, the whole message routing can be done using a single ASB channel, which is a much simpler setup.

The 'topic' problem only comes into play when a SQL endpoint wants to subscribe to an event published by an ASB endpoint.
The ASB channel needs to know in what topic the subscribed event is published, so it can create the correct subscription.
The current router setup uses a "destination endpoint" to determine what channel to use to forward the subscription.
But most modern transports like ASB, RabbitMQ and even SQL Server don't need to know the exact endpoint that publishes the event because the transport itself determines where to send a certain event to, based on centrally stored subscription information. In the case of ASB & RabbitMQ, these subscriptions are stored in the Topic. In case of SQL server, they are stored in a central subscriptionrouting table.
In your samples the topic to send a subscription to can easily be determined based on the destination endpoint's name: endpoint's name starts with 'Green.' ==> topic is 'Green'. In our case there is no relation whatsoever between an endpoint's name and the topic it is using to publish messages, so there is no way to determine the correct ASB channel except creating a mapping of all ASB endpoint queues and the topic they are using.

It would be much simpler if the "destination part" of the subscription message would just contain the destination that will handle the subscription. In an ASB or RabbitMQ channel this could just be as simple as the Topic name where to create the subscription in. That would eliminate the need for having all those different ASB channels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants