Running multiple application instances in the same Service Bus namespace

26 views
Skip to first unread message

Alejandro Mora

unread,
May 26, 2020, 12:55:57 PM5/26/20
to masstransit-discuss
Hello,

I apologize in advance if this has been asked before, I tried looking around but couldn't find anything similar to what we are attempting to do.

Background
We are attempting to use MassTransit -for a group of business applications- to publish/consume domain events using Service Bus as the backplane. 

These applications are structured under an environment-instance scheme, meaning we can have N instances of the app in the same environment. Where Environment is Dev, QA, Staging, etc. and Instance is 00, 01, 02, etc. Each application knows which environment-instance it belongs to. 

For each environment we would have one service bus namespace. So multiple instances of the app will connect to the same Service Bus instance.

To complicate things further, there have been talks of consolidating to only one Service Bus namespace for all environment-instances, so that some messages can be consumed by all applications.

Question
Is there any way within MassTransit to segregate messages based on some sort of identifier (i.e. environment-instance), so that events generated in one environment-instance (i.e. DEV01) are not consumed in another (i.e. DEV03) and viceversa (Let's call this Local events) ?
Could this made optional, so that certain consumers disregard this filter and consume all events of a certain type (Let's call this Global events)?


I've been trying to play with Name Formatters change the names of the queues, topics, and messages to prefix them with the environment-instance. The idea being, to only publish/consume on the topics and queues where your the environment-instance match. But I haven't had much success.

I've been looking at partition keys as well but I don't know if this could be used to create this kind of filter/routing, the documentation is a little vague.

Ideally, when the application starts, it will register all the consumers for a particular environment-instance(local), then the common consumers (global).

Is this a valid use case? 

Any help or insight that could steer us in the right direction, would be greatly appreciated!
Thanks!


ttt

unread,
May 26, 2020, 7:12:59 PM5/26/20
to masstrans...@googlegroups.com
Here we are segregating using rabbit vhost, but if it was another transport layer I didnt knew how to do. 

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/f3a6014c-cdaf-45c6-9f7f-c8f05d9664f9%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages