8 out of 9 rated this helpful - Rate this topic

Understanding and Using the CloudFx Framework

This topic describes the Cloud Application Framework & Extensions (CloudFx) library, its proper usage scenarios, and contains links to topics that show how to use the library in common scenarios.

Overview

Getting Started with CloudFx

Navigating CloudFx Features

Overview

The Cloud Application Framework & Extensions (CloudFx library) is a production-quality library created with a single goal in mind: to enable Windows Azure developers to build high-fidelity, cloud-based solutions without having to write the code to handle all the relatively complex mechanical tasks each Windows Azure platform service API requires of production-quality applications. CloudFx implements a collection of patterns derived from real customer solutions to provide professional features at reduced complexity, which results in faster development of robust and performant Windows Azure applications. While not all Windows Azure platform services are included at this time, currently the framework supports Windows Azure storage services, Windows Azure SQL Database, Windows Azure Service Bus, and Windows Azure caching.

For example, when working with Windows Azure queues, CloudFx provides a pair of simple Put and Get (send and receive) methods that understand the application’s specific business objects, reliably and efficiently invoke the underlying storage client API, handle errors, process messages that don’t fit in a queue, and so on.

For those exploring Windows Azure Service Bus, CloudFx offers straightforward Publish and Subscribe operations that make the most efficient use of the asynchronous messaging APIs as well as implement the most important best practices for Service Bus queues, topics, and subscriptions. This lets the developer focus on the business domain and forget about implementing low-level plumbing.

noteNote
The CloudFx framework is used internally at Microsoft as a foundation of some of the company’s internal and commercial cloud services, and is now available to the development community for exploration and adoption. You can learn more about one example of how the CloudFx framework was used in the implementation of a real-world complex cloud-based solution here.

The current release of CloudFx is comprised of the following features.

  • A configuration system abstraction capable of working on the cloud and on-premises environments, making it a first-class choice for hybrid solutions.

  • A diagnostics system abstraction providing unified instrumentation and tracing capabilities which work efficiently on the cloud as well as on-premises.

  • A storage service abstraction offering platform service agnostic “skin” that sits on top of the existing Windows Azure Storage Service APIs and provides value-add capabilities such as support for large messages, .NET generic types and custom serializers.

  • A multi-threaded queue listener implementation optimized for storage transaction costs and performance.

  • A messaging service abstraction delivering the asynchronous publish/subscribe messaging via Windows Azure Service Bus through a significantly simplified programming model comprised of just two general purposes operations: Publish and Subscribe.

  • A scalable inter-role communication implementation built on top of the messaging service abstraction, which significantly reduces the amount of code required to support durable and resilient communication between Windows Azure role instances.

  • Built-in extensibility offering a simplified, light-weight implementation of the Inversion of Control (IoC) pattern that greatly reduces or eliminates coupling between solution components and helps make CloudFx-based solutions more agile to changes.

  • Value-add extensions that are easily pluggable into Windows Azure web and worker role implementations, as well as traditional on-premises solutions, to quickly introduce additional capabilities such as declaratively turning a worker role into a REST-based service host using a single line of code.

Getting Started with CloudFx

To get started with CloudFx, start with the basic how-to topics, How to: Use CloudFx to Send and Receive Messages with a Service Bus Topic and Subscription and How to: Use CloudFx to Send and Receive Messages Asynchronously with a Service Bus Topic. To see how to send unicast and multicast messages, see How to: Use CloudFx to Send and Receive Uni- and Multicast Messages with the Service Bus. And to see how to use the request-reply pattern and yet preserve asynchronous functionality, see How to: Use CloudFx to Implement a Request-Reply Message Exchange Pattern using Service Bus Topics.

Each of those topics describes how to create an application in Visual Studio 2010 and add the CloudFx framework by adding the package to the project, as demonstrated in the following graphic:

Finding CloudFx in NuGet.

Once you have the basic understanding of how to approach the API, you can learn more and expand your usage quickly by using the following information.

  • Technical documentation in the form of detailed API reference included in the NuGet package

  • Basic “How-to” style samples and advanced samples (demonstrating several CloudFx features at the same time) located here.

  • If you want to browse the sample source code, you can do so here.

Navigating CloudFx Features

Some of the key components in the current release of the CloudFx framework are listed below. Please note that this list is not exhaustive. For the detailed list of components, please refer to the API documentation included in the CloudFx package on NuGet.

Microsoft.Experience.CloudFx.Framework Namespace
  • Common utility classes (for example, CloudEnvironment, CloudUtility, and ExceptionTextFormatter).

  • Common exception types (for example, CloudApplicationException).

  • Global constants and structures (for example, GlobalConst).

  • Bases classes for web/worker roles and ASP.NET web applications (for example, CloudWorkerRoleBase, CloudWebRoleBase, and CloudWebAppBase).

  • Common extension methods (for example, IObservable.Retry, and IsQueueNotFound).

Microsoft.Experience.CloudFx.Framework.Configuration Namespace
  • Common configuration sections & collections (for example, StorageAccountConfigurationSection, ServiceBusConfigurationSection, and ServiceBusEndpointCollection).

  • Common configuration elements (for example, StorageAccountInfo, ServiceBusEndpointInfo, and ServiceBusPublishSubscribeChannelSettings).

  • Hybrid application configuration provider (CloudApplicationConfiguration).

Microsoft.Experience.CloudFx.Framework.Diagnostics Namespace
  • Base interfaces & common components supporting application instrumentation & tracing (for example, ITraceEventProvider and TraceEvent).

  • Hybrid application tracing component implementation (HybridTraceEventProvider).

  • Central access point into all tracing components (TraceManager).

  • Standard implementations of application event observers (for example, SqlExceptionObserver and SqlThrottlingStateObserver).

Microsoft.Experience.CloudFx.Framework.Extensibility Namespace
  • Base interfaces & classes supporting the extensibility feature of the framework (for example, IExtensibleComponent and IComponentExtension).

  • Extension methods that contribute to the extensibility feature (for example, EnsureExists and Demand).

Microsoft.Experience.CloudFx.Framework.Messaging Namespace
  • Base interfaces & infrastructure components supporting messaging service abstraction (for example, IPublishSubscribeChannel and ReliableServiceBusClient).

  • Out-of-the-box implementations of the Publish/Subscribe abstraction leveraging Windows Azure Service Bus topics and subscriptions (ServiceBusPublishSubscribeChannel).

  • Out-of-the-box implementation of the queuing abstraction leveraging Windows Azure Service Bus queues (ReliableServiceBusQueue).

  • Value-add extension methods for various messaging APIs (for example, PublishAsync, CompleteAsync, AbandonAsync).

Microsoft.Experience.CloudFx.Framework.Storage Namespace
  • Base interfaces supporting the Window Azure storage service abstraction (for example, ICloudQueueStorage, ICloudTableStorage, ICloudBlobStorage).

  • Out-of-the-box implementations of the Windows Azure Storage service abstractions (for example, ReliableCloudBlobStorage, ReliableCloudQueueStorage, and ReliableCloudTableStorage).

  • Value-add extension methods for storage APIs (for example, PutAsync, GetMessagesAsync, and UploadFromStreamAsync).

Microsoft.Experience.CloudFx.Extensions.Configuration Namespace
  • A component that abstracts access to the application configuration and works symmetrically both in the cloud and on-premises applications (ConfigurationSettingsProviderExtension).

  • A component that enables receiving notifications about changes in the configuration sections (ConfigurationUpdateObserverExtension).

Microsoft.Experience.CloudFx.Extensions.Diagnostics Namespace
  • A component that optimally configures the Windows Azure Diagnostic Monitor based off the diagnostic settings expressed in the configuration file (RoleDiagnosticMonitorExtension).

  • A component that allows capturing application exceptions and critical events into a dedicated role-specific table for rapid analysis (RoleErrorLoggingExtension).

Microsoft.Experience.CloudFx.Extensions.Messaging Namespace
  • A component that implements durable inter-role communication based off the Windows Azure Service Bus topics and subscriptions (InterRoleCommunicationExtension).

  • Components that declaratively enable turning a worker role into a fully functional WCF Service Host (for example, ServiceHostWorkerRoleExtension and WebServiceHostWorkerRoleExtension).

Microsoft.Experience.CloudFx.Extensions.Storage Namespace
  • A component that implements a multi-threaded listener for a Windows Azure Queue (CloudQueueListenerExtension).

  • A component that facilitates the use of multiple storage accounts for scale-out and partitioning purposes (CloudStorageLoadBalancingExtension).

See Also


Build Date:

2013-05-16
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.
facebook page visit twitter rss feed newsletter