Geeks With Blogs



A Curious Mind #tastic

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.


Posted on Tuesday, October 7, 2008 10:50 PM | Back to top

Comments on this post: MassTransit Question: Subscription Service

# re: MassTransit Question: Subscription Service
Requesting Gravatar...
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.

Left by Adam Tybor on Oct 08, 2008 8:39 AM

# re: MassTransit Question: Subscription Service
Requesting Gravatar...
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?
Left by Tim Barcz on Oct 08, 2008 10:21 AM

# re: MassTransit Question: Subscription Service
Requesting Gravatar...
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?
Left by Steve on Apr 05, 2009 10:10 PM

Your comment:
 (will show your gravatar)

Copyright © Dru Sellers | Powered by: