Bus config when auto-scaling Azure Website?

56 views
Skip to first unread message

Matt Honeycutt

unread,
May 31, 2016, 11:09:10 PM5/31/16
to masstransit-discuss
Good evening!

I have an Azure Website that keeps an in-memory cache of some data, and I've got it where the website will receive messages via MassTransit when the cached data changes in the backend so that the cache can be updated.  That works fine as long as there is only a single instance of the site.  Any recommendations on how I'd handle queue naming so that it works nicely with auto-scaling?  Right now, I've got it where the queue name is pulled from the web.config file, but I don't want the website instances to operate as competing consumers in this case.  Each instance will need to receive a copy of the message so that it can update its internal cache, so each will need a unique (but consistent) queue name.  

I am using MT with Azure Service bus in this instance. 

Thoughts or suggestions?  

Travis Smith

unread,
Jun 1, 2016, 10:52:46 AM6/1/16
to masstransit-discuss
With RabbitMQ you can define a temp queue name (http://stackoverflow.com/questions/30760108/masstransit-temporary-queue), I don't know if this has been implemented for Azure Service Bus. Or you could use the hostname, which I'm assuming is unique, for the queue name. 

--
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/8048f714-1662-4a30-8ab9-e535f7aea991%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
-Travis

Chris Patterson

unread,
Jun 1, 2016, 11:23:01 AM6/1/16
to masstrans...@googlegroups.com
You can create a receive endpoint that doesn't have a queue name and a dynamic one will be generated. But unfortunately the subscriptions will be retained in the topic after shut down and it ends up filling the topic subscriptions until the size quota is reached. And then the topic no longer accepts messages. 

So try to use a static one based on something list role name instance number or something to that effect. Then each instance has its own. And monitor monitor monitor. 

I'll be adding dynamic subscriptions in a subsequent release of MassTransit it's on the backlog. 

__
Chris Patterson




Matt Honeycutt

unread,
Jun 11, 2016, 12:16:02 AM6/11/16
to masstransit-discuss
Thanks for the feedback.  I've been doing some digging on this, but I haven't found a good way to get the instance number or any other consistent (yet unique) identifier to use.  I believe I can get do something like this:

- During instance startup, grab a list of known instance IDs (using this approach: http://blog.amitapple.com/post/2014/03/access-specific-instance/#.V1uOyvkrK-4)
- Sort the IDs
- Figure out the current instance's position in that list
- Use that to create a consistent, distinct queue name for the instance.

Obviously I will still need to watch for orphaned queues, but I believe this approach will work for now.

Is there some easier way that I've totally overlooked?  


On Wednesday, June 1, 2016 at 10:23:01 AM UTC-5, Chris Patterson wrote:
You can create a receive endpoint that doesn't have a queue name and a dynamic one will be generated. But unfortunately the subscriptions will be retained in the topic after shut down and it ends up filling the topic subscriptions until the size quota is reached. And then the topic no longer accepts messages. 

So try to use a static one based on something list role name instance number or something to that effect. Then each instance has its own. And monitor monitor monitor. 

I'll be adding dynamic subscriptions in a subsequent release of MassTransit it's on the backlog. 

__
Chris Patterson




On Wed, Jun 1, 2016 at 7:52 AM -0700, "Travis Smith" <tra...@legomaster.net> wrote:

With RabbitMQ you can define a temp queue name (http://stackoverflow.com/questions/30760108/masstransit-temporary-queue), I don't know if this has been implemented for Azure Service Bus. Or you could use the hostname, which I'm assuming is unique, for the queue name. 

On Tue, May 31, 2016 at 8:09 PM Matt Honeycutt <mbhon...@gmail.com> wrote:
Good evening!

I have an Azure Website that keeps an in-memory cache of some data, and I've got it where the website will receive messages via MassTransit when the cached data changes in the backend so that the cache can be updated.  That works fine as long as there is only a single instance of the site.  Any recommendations on how I'd handle queue naming so that it works nicely with auto-scaling?  Right now, I've got it where the queue name is pulled from the web.config file, but I don't want the website instances to operate as competing consumers in this case.  Each instance will need to receive a copy of the message so that it can update its internal cache, so each will need a unique (but consistent) queue name.  

I am using MT with Azure Service bus in this instance. 

Thoughts or suggestions?  

--
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.
--
-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-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages