Archives For Queues


Have you tried forcing an unexpected reboot?

Imagine a Worker Role that continuously polls a Windows Azure Storage Queue. It probably got it’s configuration settings when the Role instance started and it might not use the CloudConfigurationManager to refresh its configuration for every pull. This is where the Changing and Changed events come in. They allow you to build a strategy to deal efficiently with configuration changes.

Details

The Changing event and the Changed event are used together to identify and manage configuration changes to the service model. By using the Changing event, an instance can respond to a configuration change in one of the following ways:

  • Accept the configuration change while it is running, without going offline.

  • Set the Cancel property of RoleEnvironmentChangingEventArgs to true to take the instance offline, apply the configuration change, and then bring the instance back online.

By using the Cancel property, you can ensure that the instance proceeds through an orderly shutdown sequence and is taken offline before the configuration change is applied. During the shutdown process, Windows Azure raises the Stopping event, and then runs any code in the OnStop method.

You have a limited amount of time to accept or cancel the Changing event. Make sure your event handler can return in a timely manner.

You may want to cancel the Changing event if:

  • Your role instance does not support configuration changes while it is running, and requires recycling in order to apply the change.
  • Your role instance is performing work that should not be disrupted by a configuration change, and needs to proceed through the shutdown sequence before applying the change.

The RoleEnvironmentChangingEventArgs class provides a Changes property that returns a collection of the configuration changes that are about to be applied to the instance. Objects in this collection can be one of the following types:

Continue Reading…


showdownBulky versus chatty applications is a topic that comes up a lot when we design applications on the cloud and believe me it’s not a random topic!

Concepts

When talk about bulky versus chatty, we’re essentially talking about the applications communication style. When the payloads exchanged by the application are large, we say that they are bulky. When we say that an application is chatty, we mean that the application exchanges many messages.

Continue Reading…