RuntimeServices or separate services?

114 views
Skip to first unread message

Mike Hadlow

unread,
Jul 21, 2009, 11:56:58 AM7/21/09
to masstransit-discuss
Hi

I'm just starting to look at MassTransit. I've been very impressed so
far. A quick noob question: Is the preferred way of providing the MT
infrastructure to run RuntimeServices or each infrastructure service
independently? I notice that RuntimeServices is used in the Starbucks
example.

Also, I'm a little confused about the actual sequence of events. I
have the following two services:

Mike.Subscriber configured with
<bus id="main" endpoint="msmq://localhost/mt_mike_subscriber">
<subscriptionService endpoint="msmq://localhost/mt_subscriptions" />
<managementService heartbeatInterval="3" />
</bus>

Mike.Publisher configured with
<bus id="main" endpoint="msmq://localhost/mt_mike_publisher">
<subscriptionService endpoint="msmq://localhost/mt_subscriptions" />
<managementService heartbeatInterval="3" />
</bus>

It all works fine, I run up RuntimeServices and my two serivces. A
message gets published from my publisher and arrives at my subcriber.
But what is actually happening? Does the RuntimeServices simply tell
my subscriber to sit on my publisher's queue (mt_mike_publisher) or
does RuntimeServices pick up messages from mt_mike_publisher and put
them on mt_mike_subscriber?

Any enlightenment would be greatly appreciated :)

Thanks
Mike

Dru Sellers

unread,
Jul 21, 2009, 12:34:00 PM7/21/09
to masstrans...@googlegroups.com
But what is actually happening? Does the RuntimeServices simply tell
my subscriber to sit on my publisher's queue (mt_mike_publisher) or
does RuntimeServices pick up messages from mt_mike_publisher and put
them on mt_mike_subscriber?


Each of your services has a 'subscription client' this client keeps track of the address by message type and updates your outbound pipeline appropriately. so when you say 'publish' the outbound pipeline merely takes the message and pushes it through.

this has the effect of the message being passed straight to the destination queue where your other service reads the message off of the queue.

does that help?

-d

Mike Hadlow

unread,
Jul 22, 2009, 4:42:22 AM7/22/09
to masstransit-discuss
Thanks Dru,

A further question then...

What role does the subscription service play? I noticed that both the
publisher and subscriber have to point to the subscription serivce's
queue. What are the steps when the publisher and subscriber both come
on line that result in the publisher's outbound pipeline being updated
with the subscribers queue address?

Cheers
Mike

On Jul 21, 5:34 pm, Dru Sellers <d...@drusellers.com> wrote:
> But what is actually happening? Does the RuntimeServices simply tell
> my subscriber to sit on my publisher's queue (mt_mike_publisher) or
> does RuntimeServices pick up messages from mt_mike_publisher and put
> them on mt_mike_subscriber?
>
> Each of your services has a 'subscription client' this client keeps track of
> the address by message type and updates your outbound pipeline
> appropriately. so when you say 'publish' the outbound pipeline merely takes
> the message and pushes it through.
>
> this has the effect of the message being passed straight to the destination
> queue where your other service reads the message off of the queue.
>
> does that help?
>
> -d
>

Dru Sellers

unread,
Jul 22, 2009, 10:08:36 AM7/22/09
to masstrans...@googlegroups.com
Role: Is the holder of all subscription information - all others are copies of this repository.
The publisher and subscriber must point to the service if they wish to 'publish' so really its just publishers.

SubscriptionService comes online (empty repo)
Publisher comes online (empty outbound pipeline, empty inbound pipeline)
Subscriber comes online (empty outbound pipeline, populated inbound pipeline)
* messages sent to SubscriptionService from Subscriber using direct send *
SubscriptionService notes the subscriptions (populated repo)
SubscriptionService broadcasts the subscription data (messages sent directly to know clients)
Publisher receives messages (populated outbound pipeline, empty inbound pipeline)

@chris: did I miss anything?
-d
Reply all
Reply to author
Forward
0 new messages