Re: [masstransit-discuss] Is the Subscription Service necessary?

328 views
Skip to first unread message

Dru Sellers

unread,
Jul 19, 2012, 11:04:30 AM7/19/12
to masstrans...@googlegroups.com
if you are using msmq you must use either the SubscriptionService or the MulticastSubscriptions. 

-d

On Thu, Jul 19, 2012 at 1:21 AM, Tommy Jakobsen <to...@holmjakobsen.dk> wrote:
Hello,
 
Dead simple question. Is the Subscription Service necessary? I'm writing a pub/sub example with a single publisher and many subscribers (MSMQ). I got a bit confused when reading the docs about the runtime services here: http://docs.masstransit-project.com/en/latest/overview/runtimeservices.html
"As of 2.0 the MsmqMulticastSubscription manager provides similar functionality while removing the need for a single point of failure."
 
Does that mean that I don't have to use the Subscription Service? I haven't been able to figure out a way to set up a pub/sub scenario without it so far. And the pub/sub sample shows the use of the Subscription Service (I'm away that they can be out dated of course). If it's possible to avoid the Subscription Service (and thus a single point of failure) when using MSMQ, can you show me how? And maybe provide some details on why this works. I can see the necessity of a Subscription Service but not a scenario without it, so some details would be very helpful.
 
Best,
Tommy

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/PzDSEXwHW3cJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Chris Patterson

unread,
Jul 19, 2012, 1:14:48 PM7/19/12
to masstrans...@googlegroups.com
And multicast subscriptions are not persisted at each bus instance, so they are lost if everyone shuts down. The only production worthy way to use MSMQ in production is with the subscription service.

Jeffrey T. Fritz

unread,
Jul 19, 2012, 1:20:30 PM7/19/12
to masstrans...@googlegroups.com
I gotta ask a follow-up question:  is there a way to setup a redundant SubscriptionService?



Jeff

Chris Patterson

unread,
Jul 19, 2012, 1:53:41 PM7/19/12
to masstrans...@googlegroups.com
We have set it up as a cluster resource so that it fails over if the windows server fails.

Jeff

unread,
Jul 20, 2012, 1:43:25 PM7/20/12
to masstrans...@googlegroups.com
Are there instructions somewhere on how to cluster the subscription service?  Or is this just running on a clustered server?

Jeff


On Thursday, July 19, 2012 1:53:41 PM UTC-4, Chris Patterson wrote:
We have set it up as a cluster resource so that it fails over if the windows server fails.

On Thu, Jul 19, 2012 at 12:20 PM, Jeffrey T. Fritz <jeffre...@gmail.com> wrote:
I gotta ask a follow-up question:  is there a way to setup a redundant SubscriptionService?



Jeff


On Jul 19, 2012, at 13:14, Chris Patterson <ch...@phatboyg.com> wrote:

And multicast subscriptions are not persisted at each bus instance, so they are lost if everyone shuts down. The only production worthy way to use MSMQ in production is with the subscription service.

On Thu, Jul 19, 2012 at 10:04 AM, Dru Sellers <d...@drusellers.com> wrote:
if you are using msmq you must use either the SubscriptionService or the MulticastSubscriptions. 

-d


On Thu, Jul 19, 2012 at 1:21 AM, Tommy Jakobsen <to...@holmjakobsen.dk> wrote:
Hello,
 
Dead simple question. Is the Subscription Service necessary? I'm writing a pub/sub example with a single publisher and many subscribers (MSMQ). I got a bit confused when reading the docs about the runtime services here: http://docs.masstransit-project.com/en/latest/overview/runtimeservices.html
"As of 2.0 the MsmqMulticastSubscription manager provides similar functionality while removing the need for a single point of failure."
 
Does that mean that I don't have to use the Subscription Service? I haven't been able to figure out a way to set up a pub/sub scenario without it so far. And the pub/sub sample shows the use of the Subscription Service (I'm away that they can be out dated of course). If it's possible to avoid the Subscription Service (and thus a single point of failure) when using MSMQ, can you show me how? And maybe provide some details on why this works. I can see the necessity of a Subscription Service but not a scenario without it, so some details would be very helpful.
 
Best,
Tommy

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To unsubscribe from this group, send email to masstransit-discuss+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/PzDSEXwHW3cJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To unsubscribe from this group, send email to masstransit-discuss+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To unsubscribe from this group, send email to masstransit-discuss+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To unsubscribe from this group, send email to masstransit-discuss+unsub...@googlegroups.com.

Travis Smith

unread,
Jul 20, 2012, 3:00:46 PM7/20/12
to masstrans...@googlegroups.com

This would just be a clustered windows server. There is no MT config related to it.

-Travis

To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/sJk1MCulLOQJ.

Tommy Jakobsen

unread,
Jul 23, 2012, 3:15:22 AM7/23/12
to masstrans...@googlegroups.com
Thank you very much for clarifying.

Dru Sellers

unread,
Mar 15, 2013, 4:30:47 PM3/15/13
to masstrans...@googlegroups.com
What are the values of 
MassTransitSettngs.ConsumerQueueUrl
-d

On Mar 15, 2013, at 13:42, Altug Sahin <asa...@aecoffice.com> wrote:

MassTransitSettings.ConsumerQueueUrl

Travis Smith

unread,
Mar 15, 2013, 4:33:15 PM3/15/13
to masstrans...@googlegroups.com
They must read off different queues. I'm not sure if that's the case here or not, since it's hidden behind a class. 

Additionally, you shouldn't need the UseControlBus with Rabbit. Since normally there's no meta data, it's all in Rabbit. 

-Travis


--
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 post to this group, send email to masstrans...@googlegroups.com.

altug sahin

unread,
Mar 15, 2013, 4:48:40 PM3/15/13
to masstrans...@googlegroups.com
Hi Dru,
the consumer queue is

rabbitmq://localhost/dart-dev/mdxreporting-consumer

altug sahin

unread,
Mar 15, 2013, 4:51:12 PM3/15/13
to masstrans...@googlegroups.com
Producer queue is (I know, name is ....)

rabbitmq://localhost/dart-dev/mdx-consumer

Chris Patterson

unread,
Mar 15, 2013, 7:17:33 PM3/15/13
to masstrans...@googlegroups.com
To answer your initial question, you do not need the Subscription Server with RabbitMQ. It's only for MSMQ.




On Fri, Mar 15, 2013 at 11:42 AM, Altug Sahin <asa...@aecoffice.com> wrote:
As a newbie in MT, I am researching and trying to understand the framework. I came across this old post but wanted to post my question here since it is somewhat relevant to the original question.

I setup a sample solution with one producer and two consumers. I publish from producer and all consumers are handling the event. So all is good. I am using RabbitMQ 3.02 and MT 2.6.5.

However, this setup below is not working; subscriber (consumer) is not invoking the handler.

Solution 1
Producer
Messages dll

mt config for producer

            builder.RegisterType<MdxExpressionCreatedHandler>()

                   .AsSelf();

 

            builder.Register(c => ServiceBusFactory.New(x =>

            {

                x.UseRabbitMq();

                x.UseNLog();

                x.ReceiveFrom(MassTransitSettings.ConsumerQueueUrl);

                x.Subscribe(s => s.LoadFrom(c.Resolve<ILifetimeScope>()));

                x.UseControlBus();

                //x.UseSubscriptionService("rabbitmq://localhost/dart-dev/subscriptions");

                x.Validate();

            })).As<IServiceBus>()

               .SingleInstance();


Solution 2
Consumer
Messages dll

my config for consumer

            builder.Register(c => ServiceBusFactory.New(x =>

            {

                x.UseRabbitMq();

                x.UseNLog();

                x.ReceiveFrom(MassTransitSettings.ConsumerQueueUrl);

                //x.UseSubscriptionService("rabbitmq://localhost/dart-dev/subscriptions");

                x.Subscribe(s => s.LoadFrom(c.Resolve<ILifetimeScope>()));

                x.UseControlBus();

                x.Validate();

            })).As<IServiceBus>()

               .SingleInstance();


A copy Messages.dll is physically deployed to both apps (console app with topshelf).

Do I need a third process for subscription service hosting MT? Not sure why first solution was working and second is not. As you can see I was about to setup the subscription service but wanted to post here to see if I am going in the right direction to verify this.

Thank you.



On Thursday, July 19, 2012 11:04:30 AM UTC-4, Dru wrote:
if you are using msmq you must use either the SubscriptionService or the MulticastSubscriptions. 

-d

On Thu, Jul 19, 2012 at 1:21 AM, Tommy Jakobsen <to...@holmjakobsen.dk> wrote:
Hello,
 
Dead simple question. Is the Subscription Service necessary? I'm writing a pub/sub example with a single publisher and many subscribers (MSMQ). I got a bit confused when reading the docs about the runtime services here: http://docs.masstransit-project.com/en/latest/overview/runtimeservices.html
"As of 2.0 the MsmqMulticastSubscription manager provides similar functionality while removing the need for a single point of failure."
 
Does that mean that I don't have to use the Subscription Service? I haven't been able to figure out a way to set up a pub/sub scenario without it so far. And the pub/sub sample shows the use of the Subscription Service (I'm away that they can be out dated of course). If it's possible to avoid the Subscription Service (and thus a single point of failure) when using MSMQ, can you show me how? And maybe provide some details on why this works. I can see the necessity of a Subscription Service but not a scenario without it, so some details would be very helpful.
 
Best,
Tommy

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstrans...@googlegroups.com.

To unsubscribe from this group, send email to masstransit-discuss+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/PzDSEXwHW3cJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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 post to this group, send email to masstrans...@googlegroups.com.

Chris Patterson

unread,
Mar 15, 2013, 7:21:25 PM3/15/13
to masstrans...@googlegroups.com
I'm guessing that your classes may not be registered in the container correctly. There are several threads on using Autofac with MassTransit, particularly in ensuring that the concrete type of the consumer is registered, and not the Consumes interfaces.

You can verify the subscriptions by looking at the log, and also looking at the RabbitMQ exchange bindings in the RabbitMQ management web site, in which there should be a binding from the exchange named after the message type, all the way down to the exchange that matches the input queue name (mdx-consumer), etc.


--
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 post to this group, send email to masstrans...@googlegroups.com.

altug sahin

unread,
Mar 18, 2013, 8:53:50 AM3/18/13
to masstrans...@googlegroups.com
Thanks Chris. Documentation is missing this clarification. May be that can be appended here?
 
Thanks
-d


To unsubscribe from this group, send email to masstransit-discuss+unsubscribe...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/PzDSEXwHW3cJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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-discuss+unsub...@googlegroups.com.

altug sahin

unread,
Mar 18, 2013, 9:09:26 AM3/18/13
to masstrans...@googlegroups.com
I looked at the exchanges page on management page and the exchange names as "MdxExpressionCreated" has two bindings; mdx-producer and mdx-creator. The exchange is a fanout exchage (which is default).
 
I published a message from exchange page (in mgm web app) and I see that message in both queues.
 
I checked the autofac setup and I was registering to concrete type not implementation.
 
I also see the subscription to MdxExpressionCreated message is being created on the console output of the producer.
 
I commented out the autofac wiring of handler and added it in the bus setup as below but the message is not being handled. Any other ideas to check where I am missing something?
 
Thanks
 
//builder.RegisterType<MdxExpressionCreatedHandler>()
//       .AsSelf();
 
builder.Register(c => ServiceBusFactory.New(x =>
{
    x.UseRabbitMq();
    x.UseNLog();
    x.EnableMessageTracing();
    x.ReceiveFrom("rabbitmq://localhost/dart-dev/mdx-producer");
    x.Subscribe(s => s.Handler<MdxExpressionCreated>(expression => new MdxExpressionCreatedHandler().Consume(expression)));
    //x.Subscribe(s => s.LoadFrom(c.Resolve<ILifetimeScope>()));

    x.Validate();
})).As<IServiceBus>()
   .SingleInstance();

On Friday, March 15, 2013 7:21:25 PM UTC-4, Chris Patterson wrote:
I'm guessing that your classes may not be registered in the container correctly. There are several threads on using Autofac with MassTransit, particularly in ensuring that the concrete type of the consumer is registered, and not the Consumes interfaces.

You can verify the subscriptions by looking at the log, and also looking at the RabbitMQ exchange bindings in the RabbitMQ management web site, in which there should be a binding from the exchange named after the message type, all the way down to the exchange that matches the input queue name (mdx-consumer), etc.
On Fri, Mar 15, 2013 at 1:51 PM, altug sahin <altug...@gmail.com> wrote:
Producer queue is (I know, name is ....)

rabbitmq://localhost/dart-dev/mdx-consumer


On Friday, March 15, 2013 4:48:40 PM UTC-4, altug sahin wrote:
Hi Dru,
the consumer queue is

rabbitmq://localhost/dart-dev/mdxreporting-consumer


On Friday, March 15, 2013 4:30:47 PM UTC-4, Dru wrote:
What are the values of 
MassTransitSettngs.ConsumerQueueUrl
-d

On Mar 15, 2013, at 13:42, Altug Sahin <asa...@aecoffice.com> wrote:

MassTransitSettings.ConsumerQueueUrl

--
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-discuss+unsub...@googlegroups.com.

To post to this group, send email to masstrans...@googlegroups.com.

altug sahin

unread,
Mar 18, 2013, 10:54:41 AM3/18/13
to masstrans...@googlegroups.com
 
Found the issue but it has nothing to do with setup of config f MT or rmq. Issue was with the way I publishing through a static property (mt is abstracted inside an implementation). back ctor injection; pub/sub works again.
 
Nevertheless, thank you for the help. It helped me verify my setup and ignore subscription manager if using rmq. :)

Chris Patterson

unread,
Mar 18, 2013, 11:32:48 AM3/18/13
to masstrans...@googlegroups.com
Great, glad you worked it out!



To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.

To post to this group, send email to masstrans...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages