SubscribeConsumer and making it permanent

397 views
Skip to first unread message

Andrei Alecu

unread,
Apr 23, 2012, 3:54:25 PM4/23/12
to masstransit-discuss
The delegate supplied during initialize lets you Subscribe a consumer
and make it permanent:

var busWorker = ServiceBusFactory.New(
sbc =>
{
sbc.ReceiveFrom("rabbitmq://localhost/
test_queue1");
sbc.UseRabbitMqRouting();

sbc.UseControlBus();
sbc.Subscribe(x =>
x.Consumer<MessageConsumer>().Permanent());
});

busWorker.SubscribeConsomer however, doesn't seem to have a way to
make the subscription permanent. Not sure if I'm missing something or
it's an oversight.

Fawad Halim

unread,
Apr 23, 2012, 8:00:53 PM4/23/12
to masstrans...@googlegroups.com
Your subscription should persist if you don't call the UnsubscribeAction you get from the SubscribeConsumer call.

-fawad


--
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.
For more options, visit this group at http://groups.google.com/group/masstransit-discuss?hl=en.


Dru Sellers

unread,
Apr 24, 2012, 9:20:22 AM4/24/12
to masstrans...@googlegroups.com
Any call to subscribe from an instance of IServiceBus is going to be a temporary subscription. To establish permanent subscriptions, they must be setup at config time.


-d


Chris Patterson

unread,
Apr 24, 2012, 3:41:48 PM4/24/12
to masstrans...@googlegroups.com
Or don't call the unsubscribe action. 

--
Chris Patterson

Dru Sellers

unread,
Apr 24, 2012, 3:44:19 PM4/24/12
to masstrans...@googlegroups.com
@chris - would that survive bus.Dispose() ?
-d

Chris Patterson

unread,
Apr 24, 2012, 10:42:00 PM4/24/12
to masstrans...@googlegroups.com
It should, yes.
Reply all
Reply to author
Forward
0 new messages