Is there an example for using MT3 with Azure Service Bus?

816 views
Skip to first unread message

Jussi Mattila

unread,
Mar 23, 2015, 9:04:54 AM3/23/15
to masstrans...@googlegroups.com
Hi,

I'm using MassTransit v3 for a demo project and currently have it running locally on RabbitMQ. I'd like to deploy to Azure though. Do you have an example showing how to use MT3 with Azure Service Bus? I was hoping to find some information regarding host setup (connection strings, token provider, etc.). I have not found anything yet.

   - Jussi

Jussi Mattila

unread,
Mar 24, 2015, 7:28:19 AM3/24/15
to masstrans...@googlegroups.com
I have now setup Azure Service Bus and I'm testing it with MT3. I'm using a SAS token provider with the "RootManageSharedAccessKey" and password. Queues and topics are created and published messages go to Azure service bus queues, but my consumers are not called. Is there something special (compared to RabbitMQ transport) I have to do to get the published messages forwarded to my consumers?

   - Jussi

Adam Tybor

unread,
Mar 24, 2015, 9:12:14 AM3/24/15
to masstrans...@googlegroups.com
Are you building from source or using nugets?  It looks like the nugets were updated very recently, I would make sure you are using those.  When I tried the 3.0.1 alpha there were issues with the receiver and I had to use the raw source.  I think some of the error handling is a little broken, my receiver would fail silently in the background which made it very difficult to debug and figure out what was happening.

However, I was able to get some simple send / receive working, I didn't try pub / sub.

Adam

Chris Patterson

unread,
Mar 24, 2015, 10:44:01 AM3/24/15
to masstrans...@googlegroups.com
The latest (3.0.2-alpha) packages should work with PubSub on Azure, but if you're seeing issues I'm not surprised. It's a little quirky with the timing, I'm looking at how I can streamline the interactions with Azure and make them more error resilient. I get a lot of MessagingException 409 when dealing with topics and queues (some fixes have been applies in the mt3 branch, but it's not there yet). Concurrency and ASB is weird.

You can see how to setup a bus on ASB by looking at the test fixture:


As for error handling, the mt3 branch has the latest error management bits that I worked on yesterday, including the ability to stack retries and move messages to error queues. The move to error queue isn't quite complete though, there are three policies I need to put into place before I can call it done (undelivered/dead-letter, consumer fault, and deserialization failure -- each of those should be handled or could be handled separately with MT3).

For some reason the trace listener doesn't work for MT like it does for Topshelf, I need to figure that out as well.


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/f1e87edc-97e8-499e-b7ee-4bc51cc0cb21%40googlegroups.com.

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

Jussi Mattila

unread,
Mar 25, 2015, 3:10:55 AM3/25/15
to masstrans...@googlegroups.com
Thanks for your replies Adam and Chris,

I'm using the latest 3.0.2-alpha NuGets in a PubSub setup. 

I configured the bus on Azure with h.TokenProvider instead of calling h.SharedAccessSignature as shown in the test fixture. I don't suppose that makes any difference.

In the Azure management portal, I can see that 4 queues (my-srv1, my-srv2, bus_..., bus_...) and 2 topics (demo.messages.nofity1, demo.messages.notify2) have been created. Both topics have a single subscriber attached to them. Published messages go to the my-srv queues but are never received by my consumers. They just sit in the queues.

This is how I setup the consumers:
c.ReceiveEndpoint(host, "my-srv1",
                           conf =>
                           {
                               conf.Consumer(componentContext.Resolve<Func<Notify1Consumer>>());
                           });

Consumer factory method is resolved from a Autofac DI container. The same configuration works fine with RabbitMQ.

To me it seems that bindings that should exist between the my-srv queues and the consumer topics are missing. I'm quite new to MT and service buses in general, so maybe there's something wrong in my way of thinking.

   - Jussi
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.
Reply all
Reply to author
Forward
0 new messages