A Curious Mind
#tastic

MassTransit Question: Subscription Service

Tuesday, October 07, 2008 10:50 PM

I was having a discussion with a friend about MassTransit about the purpose of the subscription (pubsub) service in MT, and I thought I would address the issue here.

Basically, the subscription service is what allows us to 'publish' messages. At a high level, before the bus does a publish it consults with the subscription service to see if there are any susbscribers. If there are, then each subscriber gets a copy of the message. Otherwise, nothing is sent.

At a lower level there is a subscription client that cache's the subscriptions locally to the service, and it is this cache that is consulted pre-publish. The cache is kept up-to-date via messaging (whoda thunk) so that there is a minimal amount of polling.

Therefore, if the subscription service (and the client) is not running, then nothing will be sent. As you can see its a pretty important part of the system. :)

Ok, so that wasn't as awesome as I had hoped but hopefully it helps.

-d


Feedback

# re: MassTransit Question: Subscription Service

Funny... I was just looking at the bits this week and playing with the pub/sub sample for that very reason.

One questions about pub/sub. How can multiple services subscribe to the same message but only have it delivered once? I am thinking of redundancy and load balancing scenarios where I have multiple clients processing messages.

I really like the interfaces and simplicity of masstransit. Keep up on the good work.

-Adam 10/8/2008 8:39 AM | Adam Tybor

# re: MassTransit Question: Subscription Service

So if nothing is "listening" nothing is published? What if you have some other process/exe listening to messages that a client publishes that is not using MassTransit, will the subscription manager know about this subscriber? 10/8/2008 10:21 AM | Tim Barcz

# re: MassTransit Question: Subscription Service

Say I have my own .NET dashboard and want to get a list of subscriptions onto it as well as some health information.

What is the best way to do this? 4/5/2009 10:10 PM | Steve

Comments have been closed on this topic.