2

We have a number of topics in the Azure SB and constantly update our environments through a VIP swap from staging to production.

When an instance is running in staging we don't want the subscribers to read and delete messages intended to send events to our instances running in the production slot.

The Solution I have come up with is to create subscriptions that include the RoleEnvironment.SubscriptionId in the name. These are then deleted during RoleEntryPoint.OnStop() to avoid unused subscriptions.

Is there a more elegant solution to this and am I missing something obvious?

el_tone
  • 1,182
  • 8
  • 16

1 Answers1

0

One approach is to have a configuration setting that your application understands. It can then be changed between staging/production environments and the same config value can be used to enable/disable things you do not want in production. For Service Bus you can create a Staging and a Production namespace and then put the url in config.

Abhishek Lal
  • 3,233
  • 1
  • 17
  • 16
  • The problem there is that there is no "nice" way to detect whether something is in production or staging. If it is being pulled from config then any change to that config post swap requires downtime. – el_tone Jan 26 '12 at 17:26
  • I researched this some more and found steps that indicate that you can prevent the restart on config change if you choose: http://www.codeproject.com/Articles/63977/Windows-Azure-Development-Deep-Dive-Working-With-C – Abhishek Lal Feb 10 '12 at 08:33