+
+
+
+
+
+
+ Id
+ |
+
+ Quantity
+ |
+
+ Status
+ |
+
+
+
+
+
+ <%# DataBinder.Eval(Container.DataItem, "Id") %>
+ |
+
+ <%# DataBinder.Eval(Container.DataItem, "Quantity") %>
+ |
+
+ <%# DataBinder.Eval(Container.DataItem, "Status") %>
+ |
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Default.aspx.cs b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Default.aspx.cs
new file mode 100644
index 00000000000..e560ca43601
--- /dev/null
+++ b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Default.aspx.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using MyMessages;
+using NServiceBus;
+using Order = MyMessages.Order;
+
+namespace OrderWebSite
+{
+ public partial class _Default : System.Web.UI.Page, IHandleMessages
+ {
+ protected void Page_PreRender(object sender, EventArgs e)
+ {
+ lock (Global.Orders)
+ OrderList.DataSource = new List(Global.Orders);
+
+ OrderList.DataBind();
+ }
+
+ protected void btnSubmit_Click(object sender, EventArgs e)
+ {
+ Global.Bus
+ .Send(new SubmitOrderRequest
+ {
+ Id = Guid.NewGuid(),
+ Quantity = Convert.ToInt32(txtQuatity.Text)
+ });
+ }
+
+ public void Handle(SubmitOrderResponse message)
+ {
+ lock (Global.Orders)
+ Global.Orders.Add(message.Order);
+ }
+ }
+}
diff --git a/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Default.aspx.designer.cs b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Default.aspx.designer.cs
new file mode 100644
index 00000000000..ce1c978147b
--- /dev/null
+++ b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Default.aspx.designer.cs
@@ -0,0 +1,51 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace OrderWebSite {
+
+
+ public partial class _Default {
+
+ ///
+ /// form1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// txtQuatity control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtQuatity;
+
+ ///
+ /// btnSubmit control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnSubmit;
+
+ ///
+ /// OrderList control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Repeater OrderList;
+ }
+}
diff --git a/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Global.asax b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Global.asax
new file mode 100644
index 00000000000..97e0ad28ae5
--- /dev/null
+++ b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Global.asax
@@ -0,0 +1 @@
+<%@ Application Codebehind="Global.asax.cs" Inherits="OrderWebSite.Global" Language="C#" %>
diff --git a/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Global.asax.cs b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Global.asax.cs
new file mode 100644
index 00000000000..c0dffc21fb1
--- /dev/null
+++ b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Global.asax.cs
@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+using System.Web;
+using log4net;
+using NServiceBus;
+using NServiceBus.Config;
+using NServiceBus.Integration.Azure;
+
+namespace OrderWebSite
+{
+ public class Global : HttpApplication
+ {
+ public static IBus Bus;
+ public static IList Orders;
+ private static IStartableBus _configure;
+
+ private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus);
+
+ private static IBus ConfigureNServiceBus()
+ {
+ var bus = _configure
+ .Start();
+
+ return bus;
+ }
+
+ protected void Application_Start(object sender, EventArgs e)
+ {
+ Orders = new List();
+
+
+ }
+
+ protected void Application_BeginRequest(object sender, EventArgs e)
+ {
+ if(_configure == null)
+ _configure = Configure.WithWeb()
+ .DefaultBuilder()
+ .Log4Net(new AzureAppender())
+ .AzureConfigurationSource()
+ .AppFabricQueue()
+ .JsonSerializer()
+ .UnicastBus()
+ .DoNotAutoSubscribe()
+ .LoadMessageHandlers()
+ .IsTransactional(true)
+ .CreateBus();
+
+ Bus = StartBus.Value;
+ }
+
+ protected void Application_AuthenticateRequest(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_Error(object sender, EventArgs e)
+ {
+ //get reference to the source of the exception chain
+ var ex = Server.GetLastError().GetBaseException();
+
+ LogManager.GetLogger(typeof(Global)).Error(ex.ToString());
+ }
+
+ protected void Session_End(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_End(object sender, EventArgs e)
+ {
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/OrderWebSite.csproj b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/OrderWebSite.csproj
new file mode 100644
index 00000000000..ec4b3854713
--- /dev/null
+++ b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/OrderWebSite.csproj
@@ -0,0 +1,162 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}
+ {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
+ Library
+ Properties
+ OrderWebSite
+ OrderWebSite
+ v4.0
+
+
+ 4.0
+
+ false
+
+
+ true
+ full
+ false
+ bin\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+
+ ..\..\..\..\build\azure\hosting\Common.Logging.dll
+
+
+ ..\..\..\..\build\azure\hosting\Iesi.Collections.dll
+
+
+ ..\..\..\..\build\azure\hosting\Ionic.Zip.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\log4net.dll
+
+
+ ..\..\..\..\build\azure\hosting\Microsoft.Practices.ServiceLocation.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\Microsoft.WindowsAzure.Diagnostics.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\Microsoft.WindowsAzure.ServiceRuntime.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\Microsoft.WindowsAzure.StorageClient.dll
+
+
+ ..\..\..\..\build\azure\hosting\NHibernate.dll
+
+
+ ..\..\..\..\build\azure\hosting\NHibernate.Drivers.Azure.TableStorage.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\NServiceBus.dll
+
+
+ ..\..\..\..\build\azure\hosting\NServiceBus.Azure.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\NServiceBus.Core.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\NServiceBus.Hosting.dll
+
+
+ ..\..\..\..\build\azure\hosting\NServiceBus.Hosting.Azure.dll
+
+
+ ..\..\..\..\build\azure\hosting\NServiceBus.NHibernate.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Designer
+
+
+
+
+ ASPXCodeBehind
+ Default.aspx
+
+
+ Default.aspx
+
+
+ Global.asax
+
+
+
+
+
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}
+ MyMessages
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ True
+ 51188
+ /
+
+
+ False
+ False
+
+
+ False
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Properties/AssemblyInfo.cs b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..e2cf2ae74bf
--- /dev/null
+++ b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("OrderWebSite")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("OrderWebSite")]
+[assembly: AssemblyCopyright("Copyright © 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Web.config b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Web.config
new file mode 100644
index 00000000000..54c6de45450
--- /dev/null
+++ b/Samples/Azure/AppFabricQueueFullDuplex/OrderWebSite/Web.config
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueueFullDuplex/ServiceConfiguration.cscfg b/Samples/Azure/AppFabricQueueFullDuplex/ServiceConfiguration.cscfg
new file mode 100644
index 00000000000..70f5d6cacbb
--- /dev/null
+++ b/Samples/Azure/AppFabricQueueFullDuplex/ServiceConfiguration.cscfg
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueueFullDuplex/ServiceDefinition.build.csdef b/Samples/Azure/AppFabricQueueFullDuplex/ServiceDefinition.build.csdef
new file mode 100644
index 00000000000..1fd9232b9ec
--- /dev/null
+++ b/Samples/Azure/AppFabricQueueFullDuplex/ServiceDefinition.build.csdef
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueueFullDuplex/ServiceDefinition.csdef b/Samples/Azure/AppFabricQueueFullDuplex/ServiceDefinition.csdef
new file mode 100644
index 00000000000..c5c98ec81e4
--- /dev/null
+++ b/Samples/Azure/AppFabricQueueFullDuplex/ServiceDefinition.csdef
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/AppFabricPubSub.ccproj b/Samples/Azure/AppFabricQueuePubSub/AppFabricPubSub.ccproj
new file mode 100644
index 00000000000..f57c0f6354c
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/AppFabricPubSub.ccproj
@@ -0,0 +1,70 @@
+
+
+
+
+ Debug
+ AnyCPU
+ 1.5.0
+ {adcfc6b6-8bf7-4d56-b6a4-f6d221111666}
+ Library
+ Properties
+ AzureService
+ AzureService
+ True
+ AzureService
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+ OrderService
+ {84aca710-e5b3-4a46-b87a-7c12fb2527a8}
+ True
+ Worker
+ OrderService
+
+
+ OrderWebSite
+ {f3798c2c-41dc-407c-9ebe-3f10c1ca9a76}
+ True
+ Web
+ OrderWebSite
+
+
+
+
+ 10.0
+ $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\1.5\
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/AppFabricPubSub.sln b/Samples/Azure/AppFabricQueuePubSub/AppFabricPubSub.sln
new file mode 100644
index 00000000000..d6e81147ef5
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/AppFabricPubSub.sln
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "AppFabricPubSub", "AppFabricPubSub.ccproj", "{ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderWebSite", "OrderWebSite\OrderWebSite.csproj", "{F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderService", "OrderService\OrderService.csproj", "{84ACA710-E5B3-4A46-B87A-7C12FB2527A8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMessages", "MyMessages\MyMessages.csproj", "{3871CC9B-235F-4E60-98F7-FEF04DB1201B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.Build.0 = Release|Any CPU
+ {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/AppFabricPubSub.ccproj b/Samples/Azure/AppFabricQueuePubSub/Backup/AppFabricPubSub.ccproj
new file mode 100644
index 00000000000..52cfb880ae7
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/AppFabricPubSub.ccproj
@@ -0,0 +1,68 @@
+
+
+
+ Debug
+ AnyCPU
+ 1.3.0
+ {adcfc6b6-8bf7-4d56-b6a4-f6d221111666}
+ Library
+ Properties
+ AzureService
+ AzureService
+ True
+ AzureService
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+ OrderService
+ {84aca710-e5b3-4a46-b87a-7c12fb2527a8}
+ True
+ Worker
+ OrderService
+
+
+ OrderWebSite
+ {f3798c2c-41dc-407c-9ebe-3f10c1ca9a76}
+ True
+ Web
+ OrderWebSite
+
+
+
+
+ $(MSBuildExtensionsPath)\Microsoft\Cloud Service\1.0\Visual Studio 10.0\
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/AppFabricPubSub.sln b/Samples/Azure/AppFabricQueuePubSub/Backup/AppFabricPubSub.sln
new file mode 100644
index 00000000000..d6e81147ef5
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/AppFabricPubSub.sln
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "AppFabricPubSub", "AppFabricPubSub.ccproj", "{ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderWebSite", "OrderWebSite\OrderWebSite.csproj", "{F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderService", "OrderService\OrderService.csproj", "{84ACA710-E5B3-4A46-B87A-7C12FB2527A8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMessages", "MyMessages\MyMessages.csproj", "{3871CC9B-235F-4E60-98F7-FEF04DB1201B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.Build.0 = Release|Any CPU
+ {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/LoadOrdersMessage.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/LoadOrdersMessage.cs
new file mode 100644
index 00000000000..ba9857fe625
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/LoadOrdersMessage.cs
@@ -0,0 +1,11 @@
+using System;
+using NServiceBus;
+
+namespace MyMessages
+{
+ [Serializable]
+ public class LoadOrdersMessage:IMessage
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/LoadOrdersResponseMessage.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/LoadOrdersResponseMessage.cs
new file mode 100644
index 00000000000..1ae483c017b
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/LoadOrdersResponseMessage.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using NServiceBus;
+
+namespace MyMessages
+{
+ [Serializable]
+ public class LoadOrdersResponseMessage : IMessage
+ {
+ private List orders;
+
+ public List Orders
+ {
+ get
+ {
+ if(orders == null)
+ orders = new List();
+
+ return orders;
+ }
+ set
+ {
+ orders = value;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/MyMessages.csproj b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/MyMessages.csproj
new file mode 100644
index 00000000000..43698e1ce6b
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/MyMessages.csproj
@@ -0,0 +1,98 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}
+ Library
+ Properties
+ MyMessages
+ MyMessages
+ v4.0
+ 512
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+
+ False
+ ..\..\..\binaries\NServiceBus.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ Microsoft .NET Framework 4 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/Order.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/Order.cs
new file mode 100644
index 00000000000..b6df81ec9fa
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/Order.cs
@@ -0,0 +1,44 @@
+using System;
+
+namespace MyMessages
+{
+ [Serializable]
+ public class Order
+ {
+ public Guid Id { get; set; }
+ public OrderStatus Status { get; set; }
+
+ public int Quantity { get; set; }
+
+
+ public bool Equals(Order other)
+ {
+ if (ReferenceEquals(null, other)) return false;
+ if (ReferenceEquals(this, other)) return true;
+ return other.Id.Equals(Id);
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (ReferenceEquals(null, obj)) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ if (obj.GetType() != typeof (Order)) return false;
+ return Equals((Order) obj);
+ }
+
+ public override int GetHashCode()
+ {
+ return Id.GetHashCode();
+ }
+
+ public static bool operator ==(Order left, Order right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Order left, Order right)
+ {
+ return !Equals(left, right);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/OrderMessage.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/OrderMessage.cs
new file mode 100644
index 00000000000..1bcbd60558e
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/OrderMessage.cs
@@ -0,0 +1,12 @@
+using System;
+using NServiceBus;
+
+namespace MyMessages
+{
+ [Serializable]
+ public class OrderMessage:IMessage
+ {
+ public Guid Id { get; set; }
+ public int Quantity { get; set; }
+ }
+}
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/OrderStatus.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/OrderStatus.cs
new file mode 100644
index 00000000000..2d78e051238
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/OrderStatus.cs
@@ -0,0 +1,9 @@
+namespace MyMessages
+{
+ public enum OrderStatus
+ {
+ AwaitingApproval,
+ Approved,
+ Pending
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/OrderUpdatedEvent.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/OrderUpdatedEvent.cs
new file mode 100644
index 00000000000..067aabcec69
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/OrderUpdatedEvent.cs
@@ -0,0 +1,11 @@
+using System;
+using NServiceBus;
+
+namespace MyMessages
+{
+ [Serializable]
+ public class OrderUpdatedEvent:IMessage
+ {
+ public Order UpdatedOrder{ get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/Properties/AssemblyInfo.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..3ffd0007b74
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/MyMessages/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("MyMessages")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MyMessages")]
+[assembly: AssemblyCopyright("Copyright © 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("39b14fdb-e9e9-4dab-96e5-919966481923")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/App.config b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/App.config
new file mode 100644
index 00000000000..b5f6b852516
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/App.config
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/EndpointConfiguration.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/EndpointConfiguration.cs
new file mode 100644
index 00000000000..82ce372a16d
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/EndpointConfiguration.cs
@@ -0,0 +1,7 @@
+using NServiceBus;
+using NServiceBus.Hosting.Azure.Roles.Handlers;
+
+namespace OrderService
+{
+ public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Publisher, ICommunicateThroughAppFabricQueues { }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/EndpointInitialisation.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/EndpointInitialisation.cs
new file mode 100644
index 00000000000..99bb258aba5
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/EndpointInitialisation.cs
@@ -0,0 +1,12 @@
+using NServiceBus;
+
+namespace OrderService
+{
+ public class EndpointInitialisation : IWantCustomInitialization
+ {
+ public void Init()
+ {
+ Configure.Instance.Configurer.RegisterSingleton(new OrderList());
+ }
+ }
+}
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/Host.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/Host.cs
new file mode 100644
index 00000000000..2a2f8d372c6
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/Host.cs
@@ -0,0 +1,6 @@
+using NServiceBus.Hosting.Azure;
+
+namespace OrderService
+{
+ public class Host : RoleEntryPoint{}
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs
new file mode 100644
index 00000000000..c6f0c86fde2
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs
@@ -0,0 +1,27 @@
+using System.Linq;
+using MyMessages;
+using NServiceBus;
+
+namespace OrderService.MessageHandlers
+{
+ public class LoadOrdersMessageHandlers : IHandleMessages
+ {
+ private readonly IBus bus;
+ private readonly OrderList orders;
+
+ public LoadOrdersMessageHandlers(IBus bus,OrderList orders)
+ {
+ this.bus = bus;
+ this.orders = orders;
+ }
+
+ public void Handle(LoadOrdersMessage message)
+ {
+ var reply = new LoadOrdersResponseMessage
+ {
+ Orders = orders.GetCurrentOrders().ToList()
+ };
+ bus.Reply(reply);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/MessageHandlers/OrderMessageHandler.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/MessageHandlers/OrderMessageHandler.cs
new file mode 100644
index 00000000000..c14b84babc6
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/MessageHandlers/OrderMessageHandler.cs
@@ -0,0 +1,39 @@
+using System.Threading;
+using MyMessages;
+using NServiceBus;
+using Order=MyMessages.Order;
+
+namespace OrderService.MessageHandlers
+{
+ public class OrderMessageHandler : IHandleMessages
+ {
+ private readonly IBus bus;
+ private readonly OrderList orders;
+
+ public OrderMessageHandler(IBus bus, OrderList orders)
+ {
+ this.bus = bus;
+ this.orders = orders;
+ }
+
+ public void Handle(OrderMessage message)
+ {
+ var order = new Order
+ {
+ Id = message.Id,
+ Quantity = message.Quantity
+ };
+ //simulate processing
+ //Thread.Sleep(4000);
+
+ //simlute business logic
+ order.Status = message.Quantity < 100 ? OrderStatus.Approved : OrderStatus.AwaitingApproval;
+
+ orders.AddOrder(order);
+
+ //publish update
+ var orderUpdatedEvent = bus.CreateInstance(x=>x.UpdatedOrder = order);
+ bus.Publish(orderUpdatedEvent);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/OrderList.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/OrderList.cs
new file mode 100644
index 00000000000..65dc4f5be54
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/OrderList.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+
+using System.Linq;
+using MyMessages;
+
+namespace OrderService
+{
+ public class OrderList
+ {
+ private readonly IList orders;
+
+ public OrderList()
+ {
+ //add some orders to simulate "existing orders"
+ orders = new List
+ {
+ new Order {Id = Guid.NewGuid(), Quantity = 20, Status = OrderStatus.Approved},
+ new Order {Id = Guid.NewGuid(), Quantity = 300, Status = OrderStatus.Approved}
+ };
+ }
+
+ public void AddOrder(Order order)
+ {
+ lock(orders)
+ orders.Add(order);
+ }
+
+ public Order UpdateStatus(Order order,OrderStatus newStatus)
+ {
+ lock (orders)
+ {
+ foreach (var orderToUpdate in orders)
+ {
+ if(orderToUpdate.Id == order.Id)
+ {
+ orderToUpdate.Status = newStatus;
+ return orderToUpdate;
+ }
+
+ }
+ throw new Exception("Order not found");
+ }
+
+ }
+
+
+
+ public IEnumerable GetOrdersToApprove()
+ {
+ lock(orders)
+ {
+ return new List(orders.Where(x => x.Status == OrderStatus.AwaitingApproval));
+ }
+ }
+
+ public IEnumerable GetCurrentOrders()
+ {
+ lock (orders)
+ return new List(orders);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/OrderService.csproj b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/OrderService.csproj
new file mode 100644
index 00000000000..312f347a78a
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/OrderService.csproj
@@ -0,0 +1,151 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}
+ Library
+ Properties
+ OrderService
+ OrderService
+ v4.0
+ 512
+ Worker
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+
+ False
+ ..\..\..\binaries\log4net.dll
+
+
+ False
+ ..\..\..\lib\Azure\AppFabric\Microsoft.ServiceBus.dll
+ True
+
+
+ False
+ ..\..\..\lib\Azure\AppFabric\Microsoft.ServiceBus.Messaging.dll
+ True
+
+
+ False
+ ..\..\..\binaries\Microsoft.WindowsAzure.Diagnostics.dll
+
+
+ False
+ ..\..\..\binaries\Microsoft.WindowsAzure.ServiceRuntime.dll
+ True
+
+
+ False
+ ..\..\..\binaries\Microsoft.WindowsAzure.StorageClient.dll
+
+
+ False
+ ..\..\..\binaries\NServiceBus.dll
+
+
+ False
+ ..\..\..\binaries\NServiceBus.Core.dll
+
+
+ False
+ ..\..\..\build\hosting\NServiceBus.Hosting.dll
+
+
+ False
+ ..\..\..\build\hosting\NServiceBus.Hosting.Azure.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}
+ MyMessages
+
+
+
+
+ Designer
+
+
+
+
+ False
+ Microsoft .NET Framework 4 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/Properties/AssemblyInfo.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..77fc28ac62a
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderService/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("OrderService")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("OrderService")]
+[assembly: AssemblyCopyright("Copyright © 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6fdad954-96d7-4733-b5ee-41733ae4f018")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Default.aspx b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Default.aspx
new file mode 100644
index 00000000000..6215a4f4b95
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Default.aspx
@@ -0,0 +1,58 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="OrderWebSite._Default" %>
+<%@ Import Namespace="System.Data" %>
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Default.aspx.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Default.aspx.cs
new file mode 100644
index 00000000000..3055c3d6c34
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Default.aspx.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using MyMessages;
+
+namespace OrderWebSite
+{
+ public partial class _Default : System.Web.UI.Page
+ {
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ Refresh();
+ }
+
+ private void Refresh()
+ {
+ lock (Global.Orders)
+ OrderList.DataSource = new List(Global.Orders);
+
+
+ OrderList.DataBind();
+ }
+
+ protected void btnSubmit_Click(object sender, EventArgs e)
+ {
+ var order = new Order
+ {
+ Id = Guid.NewGuid(),
+ Quantity = Convert.ToInt32(txtQuatity.Text),
+ Status = OrderStatus.Pending
+
+ };
+
+ Global.Bus.Send(new OrderMessage
+ {
+ Id = order.Id,
+ Quantity = order.Quantity
+ });
+
+ lock (Global.Orders)
+ Global.Orders.Add(order);
+
+ Refresh();
+ }
+ }
+}
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Default.aspx.designer.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Default.aspx.designer.cs
new file mode 100644
index 00000000000..ce1c978147b
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Default.aspx.designer.cs
@@ -0,0 +1,51 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace OrderWebSite {
+
+
+ public partial class _Default {
+
+ ///
+ /// form1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// txtQuatity control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtQuatity;
+
+ ///
+ /// btnSubmit control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnSubmit;
+
+ ///
+ /// OrderList control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Repeater OrderList;
+ }
+}
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Global.asax b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Global.asax
new file mode 100644
index 00000000000..97e0ad28ae5
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Global.asax
@@ -0,0 +1 @@
+<%@ Application Codebehind="Global.asax.cs" Inherits="OrderWebSite.Global" Language="C#" %>
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Global.asax.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Global.asax.cs
new file mode 100644
index 00000000000..51eed807a8b
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Global.asax.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+using System.Web;
+using log4net;
+using MyMessages;
+using NServiceBus;
+using NServiceBus.Config;
+
+namespace OrderWebSite
+{
+ public class Global : HttpApplication
+ {
+ public static IBus Bus;
+ public static IList Orders;
+ private static IStartableBus _configure;
+
+ private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus);
+
+ private static IBus ConfigureNServiceBus()
+ {
+ var bus = _configure
+ .Start();
+
+ bus.Send(new LoadOrdersMessage());
+
+ return bus;
+ }
+
+ protected void Application_Start(object sender, EventArgs e)
+ {
+ Orders = new List();
+
+ _configure = Configure.WithWeb()
+ .DefaultBuilder()
+ //.Log4Net(new AzureAppender())
+ .AzureConfigurationSource()
+ .AppFabricMessageQueue()
+ .JsonSerializer()
+ .UnicastBus()
+ .LoadMessageHandlers()
+ .IsTransactional(true)
+ .CreateBus()
+ ;
+ }
+
+ protected void Application_BeginRequest(object sender, EventArgs e)
+ {
+ Bus = StartBus.Value;
+ }
+
+ protected void Application_AuthenticateRequest(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_Error(object sender, EventArgs e)
+ {
+ //get reference to the source of the exception chain
+ var ex = Server.GetLastError().GetBaseException();
+
+ LogManager.GetLogger(typeof(Global)).Error(ex.ToString());
+ }
+
+ protected void Session_End(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_End(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs
new file mode 100644
index 00000000000..78ccdac126a
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs
@@ -0,0 +1,14 @@
+using MyMessages;
+using NServiceBus;
+
+namespace OrderWebSite.MessageHandlers
+{
+ public class LoadOrdersResponseMessageHandler : IHandleMessages
+ {
+ public void Handle(LoadOrdersResponseMessage message)
+ {
+ lock (Global.Orders)
+ Global.Orders = message.Orders;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs
new file mode 100644
index 00000000000..ee65ff6541a
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs
@@ -0,0 +1,21 @@
+using MyMessages;
+using NServiceBus;
+
+namespace OrderWebSite.MessageHandlers
+{
+ public class OrderUpdatedEventHandler : IHandleMessages
+ {
+ public void Handle(OrderUpdatedEvent message)
+ {
+ var order = message.UpdatedOrder;
+
+ lock (Global.Orders)
+ {
+ if (Global.Orders.Contains(order))
+ Global.Orders.Remove(order);
+
+ Global.Orders.Add(order);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/OrderWebSite.csproj b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/OrderWebSite.csproj
new file mode 100644
index 00000000000..8c4bb2bcc36
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/OrderWebSite.csproj
@@ -0,0 +1,142 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}
+ {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
+ Library
+ Properties
+ OrderWebSite
+ OrderWebSite
+ v4.0
+
+
+ 4.0
+
+
+
+ true
+ full
+ false
+ bin\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+
+ False
+ ..\..\..\binaries\log4net.dll
+
+
+ False
+ ..\..\..\lib\Azure\AppFabric\Microsoft.ServiceBus.dll
+ True
+
+
+ False
+ ..\..\..\lib\Azure\AppFabric\Microsoft.ServiceBus.Messaging.dll
+ True
+
+
+ False
+ ..\..\..\binaries\Microsoft.WindowsAzure.Diagnostics.dll
+
+
+ False
+ ..\..\..\binaries\Microsoft.WindowsAzure.ServiceRuntime.dll
+
+
+ False
+ ..\..\..\binaries\Microsoft.WindowsAzure.StorageClient.dll
+
+
+ False
+ ..\..\..\build\hosting\NServiceBus.dll
+
+
+ False
+ ..\..\..\build\hosting\NServiceBus.Core.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Designer
+
+
+
+
+ ASPXCodeBehind
+ Default.aspx
+
+
+ Default.aspx
+
+
+ Global.asax
+
+
+
+
+
+
+
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}
+ MyMessages
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ False
+ 8089
+ /
+
+
+ False
+ False
+
+
+ False
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Properties/AssemblyInfo.cs b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..e2cf2ae74bf
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("OrderWebSite")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("OrderWebSite")]
+[assembly: AssemblyCopyright("Copyright © 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Web.config b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Web.config
new file mode 100644
index 00000000000..49a90256baf
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/OrderWebSite/Web.config
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/ServiceConfiguration.cscfg b/Samples/Azure/AppFabricQueuePubSub/Backup/ServiceConfiguration.cscfg
new file mode 100644
index 00000000000..a96054caf45
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/ServiceConfiguration.cscfg
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/Backup/ServiceDefinition.csdef b/Samples/Azure/AppFabricQueuePubSub/Backup/ServiceDefinition.csdef
new file mode 100644
index 00000000000..80486c212ca
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/Backup/ServiceDefinition.csdef
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/MyMessages/LoadOrdersMessage.cs b/Samples/Azure/AppFabricQueuePubSub/MyMessages/LoadOrdersMessage.cs
new file mode 100644
index 00000000000..ba9857fe625
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/MyMessages/LoadOrdersMessage.cs
@@ -0,0 +1,11 @@
+using System;
+using NServiceBus;
+
+namespace MyMessages
+{
+ [Serializable]
+ public class LoadOrdersMessage:IMessage
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/MyMessages/LoadOrdersResponseMessage.cs b/Samples/Azure/AppFabricQueuePubSub/MyMessages/LoadOrdersResponseMessage.cs
new file mode 100644
index 00000000000..1ae483c017b
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/MyMessages/LoadOrdersResponseMessage.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using NServiceBus;
+
+namespace MyMessages
+{
+ [Serializable]
+ public class LoadOrdersResponseMessage : IMessage
+ {
+ private List orders;
+
+ public List Orders
+ {
+ get
+ {
+ if(orders == null)
+ orders = new List();
+
+ return orders;
+ }
+ set
+ {
+ orders = value;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/MyMessages/MyMessages.csproj b/Samples/Azure/AppFabricQueuePubSub/MyMessages/MyMessages.csproj
new file mode 100644
index 00000000000..3f54133ed4b
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/MyMessages/MyMessages.csproj
@@ -0,0 +1,98 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}
+ Library
+ Properties
+ MyMessages
+ MyMessages
+ v4.0
+ 512
+ false
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+
+ False
+ ..\..\..\..\build\azure\hosting\NServiceBus.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ Microsoft .NET Framework 4 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/MyMessages/Order.cs b/Samples/Azure/AppFabricQueuePubSub/MyMessages/Order.cs
new file mode 100644
index 00000000000..b6df81ec9fa
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/MyMessages/Order.cs
@@ -0,0 +1,44 @@
+using System;
+
+namespace MyMessages
+{
+ [Serializable]
+ public class Order
+ {
+ public Guid Id { get; set; }
+ public OrderStatus Status { get; set; }
+
+ public int Quantity { get; set; }
+
+
+ public bool Equals(Order other)
+ {
+ if (ReferenceEquals(null, other)) return false;
+ if (ReferenceEquals(this, other)) return true;
+ return other.Id.Equals(Id);
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (ReferenceEquals(null, obj)) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ if (obj.GetType() != typeof (Order)) return false;
+ return Equals((Order) obj);
+ }
+
+ public override int GetHashCode()
+ {
+ return Id.GetHashCode();
+ }
+
+ public static bool operator ==(Order left, Order right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Order left, Order right)
+ {
+ return !Equals(left, right);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/MyMessages/OrderMessage.cs b/Samples/Azure/AppFabricQueuePubSub/MyMessages/OrderMessage.cs
new file mode 100644
index 00000000000..1bcbd60558e
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/MyMessages/OrderMessage.cs
@@ -0,0 +1,12 @@
+using System;
+using NServiceBus;
+
+namespace MyMessages
+{
+ [Serializable]
+ public class OrderMessage:IMessage
+ {
+ public Guid Id { get; set; }
+ public int Quantity { get; set; }
+ }
+}
diff --git a/Samples/Azure/AppFabricQueuePubSub/MyMessages/OrderStatus.cs b/Samples/Azure/AppFabricQueuePubSub/MyMessages/OrderStatus.cs
new file mode 100644
index 00000000000..2d78e051238
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/MyMessages/OrderStatus.cs
@@ -0,0 +1,9 @@
+namespace MyMessages
+{
+ public enum OrderStatus
+ {
+ AwaitingApproval,
+ Approved,
+ Pending
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/MyMessages/OrderUpdatedEvent.cs b/Samples/Azure/AppFabricQueuePubSub/MyMessages/OrderUpdatedEvent.cs
new file mode 100644
index 00000000000..067aabcec69
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/MyMessages/OrderUpdatedEvent.cs
@@ -0,0 +1,11 @@
+using System;
+using NServiceBus;
+
+namespace MyMessages
+{
+ [Serializable]
+ public class OrderUpdatedEvent:IMessage
+ {
+ public Order UpdatedOrder{ get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/MyMessages/Properties/AssemblyInfo.cs b/Samples/Azure/AppFabricQueuePubSub/MyMessages/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..3ffd0007b74
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/MyMessages/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("MyMessages")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MyMessages")]
+[assembly: AssemblyCopyright("Copyright © 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("39b14fdb-e9e9-4dab-96e5-919966481923")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderService/App.config b/Samples/Azure/AppFabricQueuePubSub/OrderService/App.config
new file mode 100644
index 00000000000..b5f6b852516
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderService/App.config
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderService/EndpointConfiguration.cs b/Samples/Azure/AppFabricQueuePubSub/OrderService/EndpointConfiguration.cs
new file mode 100644
index 00000000000..ec54b6ce114
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderService/EndpointConfiguration.cs
@@ -0,0 +1,7 @@
+using NServiceBus;
+using NServiceBus.Hosting.Azure.Roles.Handlers;
+
+namespace OrderService
+{
+ public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker { }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderService/EndpointInitialisation.cs b/Samples/Azure/AppFabricQueuePubSub/OrderService/EndpointInitialisation.cs
new file mode 100644
index 00000000000..99bb258aba5
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderService/EndpointInitialisation.cs
@@ -0,0 +1,12 @@
+using NServiceBus;
+
+namespace OrderService
+{
+ public class EndpointInitialisation : IWantCustomInitialization
+ {
+ public void Init()
+ {
+ Configure.Instance.Configurer.RegisterSingleton(new OrderList());
+ }
+ }
+}
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderService/Host.cs b/Samples/Azure/AppFabricQueuePubSub/OrderService/Host.cs
new file mode 100644
index 00000000000..2a2f8d372c6
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderService/Host.cs
@@ -0,0 +1,6 @@
+using NServiceBus.Hosting.Azure;
+
+namespace OrderService
+{
+ public class Host : RoleEntryPoint{}
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs b/Samples/Azure/AppFabricQueuePubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs
new file mode 100644
index 00000000000..c6f0c86fde2
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs
@@ -0,0 +1,27 @@
+using System.Linq;
+using MyMessages;
+using NServiceBus;
+
+namespace OrderService.MessageHandlers
+{
+ public class LoadOrdersMessageHandlers : IHandleMessages
+ {
+ private readonly IBus bus;
+ private readonly OrderList orders;
+
+ public LoadOrdersMessageHandlers(IBus bus,OrderList orders)
+ {
+ this.bus = bus;
+ this.orders = orders;
+ }
+
+ public void Handle(LoadOrdersMessage message)
+ {
+ var reply = new LoadOrdersResponseMessage
+ {
+ Orders = orders.GetCurrentOrders().ToList()
+ };
+ bus.Reply(reply);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderService/MessageHandlers/OrderMessageHandler.cs b/Samples/Azure/AppFabricQueuePubSub/OrderService/MessageHandlers/OrderMessageHandler.cs
new file mode 100644
index 00000000000..c14b84babc6
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderService/MessageHandlers/OrderMessageHandler.cs
@@ -0,0 +1,39 @@
+using System.Threading;
+using MyMessages;
+using NServiceBus;
+using Order=MyMessages.Order;
+
+namespace OrderService.MessageHandlers
+{
+ public class OrderMessageHandler : IHandleMessages
+ {
+ private readonly IBus bus;
+ private readonly OrderList orders;
+
+ public OrderMessageHandler(IBus bus, OrderList orders)
+ {
+ this.bus = bus;
+ this.orders = orders;
+ }
+
+ public void Handle(OrderMessage message)
+ {
+ var order = new Order
+ {
+ Id = message.Id,
+ Quantity = message.Quantity
+ };
+ //simulate processing
+ //Thread.Sleep(4000);
+
+ //simlute business logic
+ order.Status = message.Quantity < 100 ? OrderStatus.Approved : OrderStatus.AwaitingApproval;
+
+ orders.AddOrder(order);
+
+ //publish update
+ var orderUpdatedEvent = bus.CreateInstance(x=>x.UpdatedOrder = order);
+ bus.Publish(orderUpdatedEvent);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderService/OrderList.cs b/Samples/Azure/AppFabricQueuePubSub/OrderService/OrderList.cs
new file mode 100644
index 00000000000..65dc4f5be54
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderService/OrderList.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+
+using System.Linq;
+using MyMessages;
+
+namespace OrderService
+{
+ public class OrderList
+ {
+ private readonly IList orders;
+
+ public OrderList()
+ {
+ //add some orders to simulate "existing orders"
+ orders = new List
+ {
+ new Order {Id = Guid.NewGuid(), Quantity = 20, Status = OrderStatus.Approved},
+ new Order {Id = Guid.NewGuid(), Quantity = 300, Status = OrderStatus.Approved}
+ };
+ }
+
+ public void AddOrder(Order order)
+ {
+ lock(orders)
+ orders.Add(order);
+ }
+
+ public Order UpdateStatus(Order order,OrderStatus newStatus)
+ {
+ lock (orders)
+ {
+ foreach (var orderToUpdate in orders)
+ {
+ if(orderToUpdate.Id == order.Id)
+ {
+ orderToUpdate.Status = newStatus;
+ return orderToUpdate;
+ }
+
+ }
+ throw new Exception("Order not found");
+ }
+
+ }
+
+
+
+ public IEnumerable GetOrdersToApprove()
+ {
+ lock(orders)
+ {
+ return new List(orders.Where(x => x.Status == OrderStatus.AwaitingApproval));
+ }
+ }
+
+ public IEnumerable GetCurrentOrders()
+ {
+ lock (orders)
+ return new List(orders);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderService/OrderService.csproj b/Samples/Azure/AppFabricQueuePubSub/OrderService/OrderService.csproj
new file mode 100644
index 00000000000..4ef8dc30a25
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderService/OrderService.csproj
@@ -0,0 +1,164 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}
+ Library
+ Properties
+ OrderService
+ OrderService
+ v4.0
+ 512
+ Worker
+ false
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+
+ ..\..\..\..\build\azure\hosting\Common.Logging.dll
+
+
+ ..\..\..\..\build\azure\hosting\Iesi.Collections.dll
+
+
+ ..\..\..\..\build\azure\hosting\Ionic.Zip.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\log4net.dll
+
+
+ ..\..\..\..\build\azure\hosting\Microsoft.Practices.ServiceLocation.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\Microsoft.WindowsAzure.Diagnostics.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\Microsoft.WindowsAzure.ServiceRuntime.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\Microsoft.WindowsAzure.StorageClient.dll
+
+
+ ..\..\..\..\build\azure\hosting\NHibernate.dll
+
+
+ ..\..\..\..\build\azure\hosting\NHibernate.Drivers.Azure.TableStorage.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\NServiceBus.dll
+
+
+ ..\..\..\..\build\azure\hosting\NServiceBus.Azure.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\NServiceBus.Core.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\NServiceBus.Hosting.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\NServiceBus.Hosting.Azure.dll
+
+
+ ..\..\..\..\build\azure\hosting\NServiceBus.NHibernate.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}
+ MyMessages
+
+
+
+
+ Designer
+
+
+
+
+ False
+ Microsoft .NET Framework 4 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderService/Properties/AssemblyInfo.cs b/Samples/Azure/AppFabricQueuePubSub/OrderService/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..77fc28ac62a
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderService/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("OrderService")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("OrderService")]
+[assembly: AssemblyCopyright("Copyright © 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6fdad954-96d7-4733-b5ee-41733ae4f018")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderService/WorkerRole.cs b/Samples/Azure/AppFabricQueuePubSub/OrderService/WorkerRole.cs
new file mode 100644
index 00000000000..34da24466f9
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderService/WorkerRole.cs
@@ -0,0 +1,99 @@
+using System;
+using System.Collections.Specialized;
+using System.Threading;
+using Common.Logging;
+using log4net.Core;
+using Microsoft.WindowsAzure.ServiceRuntime;
+using MyMessages;
+using NServiceBus;
+using NServiceBus.Config;
+using NServiceBus.Integration.Azure;
+
+namespace OrderService
+{
+ public class WorkerRole : RoleEntryPoint
+ {
+ public IBus Bus;
+
+ public OrderList Orders = new OrderList();
+ private ILog logger;
+
+ public override void Run()
+ {
+ ConfigureLogging();
+
+ logger.Info("Starting order worker with instance id:" + RoleEnvironment.CurrentRoleInstance.Id);
+
+ ConfigureNServiceBus();
+
+ while (true)
+ {
+ Thread.Sleep(10000);
+
+ logger.Info("Approving orders");
+
+ foreach (var order in Orders.GetOrdersToApprove())
+ {
+ var updatedOrder = Orders.UpdateStatus(order, OrderStatus.Approved);
+
+ //publish update
+ var orderUpdatedEvent = Bus.CreateInstance(x => x.UpdatedOrder = updatedOrder);
+ Bus.Publish(orderUpdatedEvent);
+ }
+ }
+ }
+
+ private void ConfigureNServiceBus()
+ {
+
+ logger.Info("Initalizing NServiceBus");
+ try
+ {
+ var config = Configure.With()
+ .SpringBuilder()
+ .AzureConfigurationSource()
+ .XmlSerializer()
+ .UnicastBus()
+ .LoadMessageHandlers()
+ .AzureQueuesTransport()
+ .IsTransactional(true)
+ .PurgeOnStartup(false)
+ .InMemorySubscriptionStorage();//we use inmemory storage until we have a sub storage for TableStorage or SQL Services
+
+ Configure.Instance.Configurer.RegisterSingleton(Orders);
+
+ Bus = config.CreateBus()
+ .Start();
+
+ }
+ catch (Exception ex)
+ {
+ logger.Error(ex);
+ throw;
+ }
+
+ logger.Info("NServiceBus started");
+
+ }
+
+
+ private void ConfigureLogging()
+ {
+ LogManager.Adapter = new Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter(new NameValueCollection
+ {
+ {"configType","EXTERNAL"}
+ });
+
+ var appender = new AzureAppender
+ {
+ ConnectionStringKey = "AzureQueueConfig.ConnectionString",
+ Threshold = Level.Debug
+ };
+ appender.ActivateOptions();
+
+ log4net.Config.BasicConfigurator.Configure(appender);
+
+ logger = LogManager.GetLogger(typeof(WorkerRole));
+ }
+ }
+}
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Default.aspx b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Default.aspx
new file mode 100644
index 00000000000..6215a4f4b95
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Default.aspx
@@ -0,0 +1,58 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="OrderWebSite._Default" %>
+<%@ Import Namespace="System.Data" %>
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Default.aspx.cs b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Default.aspx.cs
new file mode 100644
index 00000000000..3055c3d6c34
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Default.aspx.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using MyMessages;
+
+namespace OrderWebSite
+{
+ public partial class _Default : System.Web.UI.Page
+ {
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ Refresh();
+ }
+
+ private void Refresh()
+ {
+ lock (Global.Orders)
+ OrderList.DataSource = new List(Global.Orders);
+
+
+ OrderList.DataBind();
+ }
+
+ protected void btnSubmit_Click(object sender, EventArgs e)
+ {
+ var order = new Order
+ {
+ Id = Guid.NewGuid(),
+ Quantity = Convert.ToInt32(txtQuatity.Text),
+ Status = OrderStatus.Pending
+
+ };
+
+ Global.Bus.Send(new OrderMessage
+ {
+ Id = order.Id,
+ Quantity = order.Quantity
+ });
+
+ lock (Global.Orders)
+ Global.Orders.Add(order);
+
+ Refresh();
+ }
+ }
+}
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Default.aspx.designer.cs b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Default.aspx.designer.cs
new file mode 100644
index 00000000000..ce1c978147b
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Default.aspx.designer.cs
@@ -0,0 +1,51 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace OrderWebSite {
+
+
+ public partial class _Default {
+
+ ///
+ /// form1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// txtQuatity control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtQuatity;
+
+ ///
+ /// btnSubmit control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnSubmit;
+
+ ///
+ /// OrderList control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Repeater OrderList;
+ }
+}
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Global.asax b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Global.asax
new file mode 100644
index 00000000000..97e0ad28ae5
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Global.asax
@@ -0,0 +1 @@
+<%@ Application Codebehind="Global.asax.cs" Inherits="OrderWebSite.Global" Language="C#" %>
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Global.asax.cs b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Global.asax.cs
new file mode 100644
index 00000000000..fd9303022e2
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Global.asax.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.Web;
+using NServiceBus.Integration.Azure;
+using log4net;
+using MyMessages;
+using NServiceBus;
+using NServiceBus.Config;
+
+namespace OrderWebSite
+{
+ public class Global : HttpApplication
+ {
+ public static IBus Bus;
+ public static IList Orders;
+
+ private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus);
+
+ private static IBus ConfigureNServiceBus()
+ {
+ var bus = Configure.WithWeb()
+ .DefaultBuilder()
+ .Log4Net(new AzureAppender())
+ .AzureConfigurationSource()
+ .AppFabricQueue()
+ .JsonSerializer()
+ .UnicastBus()
+ .LoadMessageHandlers()
+ .IsTransactional(true)
+ .CreateBus()
+ .Start();
+
+ bus.Send(new LoadOrdersMessage());
+
+ return bus;
+ }
+
+ protected void Application_Start(object sender, EventArgs e)
+ {
+ Orders = new List();
+ }
+
+ protected void Application_BeginRequest(object sender, EventArgs e)
+ {
+ Bus = StartBus.Value;
+ }
+
+ protected void Application_AuthenticateRequest(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_Error(object sender, EventArgs e)
+ {
+ //get reference to the source of the exception chain
+ var ex = Server.GetLastError().GetBaseException();
+
+ LogManager.GetLogger(typeof(Global)).Error(ex.ToString());
+ }
+
+ protected void Session_End(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_End(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs
new file mode 100644
index 00000000000..78ccdac126a
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs
@@ -0,0 +1,14 @@
+using MyMessages;
+using NServiceBus;
+
+namespace OrderWebSite.MessageHandlers
+{
+ public class LoadOrdersResponseMessageHandler : IHandleMessages
+ {
+ public void Handle(LoadOrdersResponseMessage message)
+ {
+ lock (Global.Orders)
+ Global.Orders = message.Orders;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs
new file mode 100644
index 00000000000..ee65ff6541a
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs
@@ -0,0 +1,21 @@
+using MyMessages;
+using NServiceBus;
+
+namespace OrderWebSite.MessageHandlers
+{
+ public class OrderUpdatedEventHandler : IHandleMessages
+ {
+ public void Handle(OrderUpdatedEvent message)
+ {
+ var order = message.UpdatedOrder;
+
+ lock (Global.Orders)
+ {
+ if (Global.Orders.Contains(order))
+ Global.Orders.Remove(order);
+
+ Global.Orders.Add(order);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/OrderWebSite.csproj b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/OrderWebSite.csproj
new file mode 100644
index 00000000000..3564e904f4c
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/OrderWebSite.csproj
@@ -0,0 +1,154 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}
+ {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
+ Library
+ Properties
+ OrderWebSite
+ OrderWebSite
+ v4.0
+
+
+ 4.0
+
+ false
+
+
+ true
+ full
+ false
+ bin\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+
+ ..\..\..\..\build\azure\hosting\Common.Logging.dll
+
+
+ ..\..\..\..\build\azure\hosting\Iesi.Collections.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\log4net.dll
+
+
+ ..\..\..\..\build\azure\hosting\Microsoft.Practices.ServiceLocation.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\Microsoft.WindowsAzure.Diagnostics.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\Microsoft.WindowsAzure.ServiceRuntime.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\Microsoft.WindowsAzure.StorageClient.dll
+
+
+ ..\..\..\..\build\azure\hosting\NHibernate.dll
+
+
+ ..\..\..\..\build\azure\hosting\NHibernate.Drivers.Azure.TableStorage.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\NServiceBus.dll
+
+
+ ..\..\..\..\build\azure\hosting\NServiceBus.Azure.dll
+
+
+ False
+ ..\..\..\..\build\azure\hosting\NServiceBus.Core.dll
+
+
+ ..\..\..\..\build\azure\hosting\NServiceBus.NHibernate.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Designer
+
+
+
+
+ ASPXCodeBehind
+ Default.aspx
+
+
+ Default.aspx
+
+
+ Global.asax
+
+
+
+
+
+
+
+ {3871CC9B-235F-4E60-98F7-FEF04DB1201B}
+ MyMessages
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ False
+ 8089
+ /
+
+
+ False
+ False
+
+
+ False
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Properties/AssemblyInfo.cs b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..e2cf2ae74bf
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("OrderWebSite")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("OrderWebSite")]
+[assembly: AssemblyCopyright("Copyright © 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Web.config b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Web.config
new file mode 100644
index 00000000000..49a90256baf
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/OrderWebSite/Web.config
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Azure/AppFabricQueuePubSub/ServiceConfiguration.cscfg b/Samples/Azure/AppFabricQueuePubSub/ServiceConfiguration.cscfg
new file mode 100644
index 00000000000..0e6d8d6fd21
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/ServiceConfiguration.cscfg
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/ServiceDefinition.build.csdef b/Samples/Azure/AppFabricQueuePubSub/ServiceDefinition.build.csdef
new file mode 100644
index 00000000000..81aff1c0561
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/ServiceDefinition.build.csdef
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AppFabricQueuePubSub/ServiceDefinition.csdef b/Samples/Azure/AppFabricQueuePubSub/ServiceDefinition.csdef
new file mode 100644
index 00000000000..322ba039a12
--- /dev/null
+++ b/Samples/Azure/AppFabricQueuePubSub/ServiceDefinition.csdef
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Azure/AzureFullDuplex/OrderWebSite/Global.asax.cs b/Samples/Azure/AzureFullDuplex/OrderWebSite/Global.asax.cs
index fd1da0a6c26..31e798b0cb0 100644
--- a/Samples/Azure/AzureFullDuplex/OrderWebSite/Global.asax.cs
+++ b/Samples/Azure/AzureFullDuplex/OrderWebSite/Global.asax.cs
@@ -18,7 +18,18 @@ public class Global : HttpApplication
private static IBus ConfigureNServiceBus()
{
- var bus = _configure
+ var bus = Configure.WithWeb()
+ .DefaultBuilder()
+ .Log4Net(new AzureAppender())
+ .AzureConfigurationSource()
+ .AzureMessageQueue()
+ .JsonSerializer()
+ .QueuePerInstance()
+ .PurgeOnStartup(true)
+ .UnicastBus()
+ .LoadMessageHandlers()
+ .IsTransactional(true)
+ .CreateBus()
.Start();
return bus;
@@ -31,20 +42,6 @@ protected void Application_Start(object sender, EventArgs e)
protected void Application_BeginRequest(object sender, EventArgs e)
{
- if(_configure == null)
- _configure = Configure.WithWeb()
- .DefaultBuilder()
- .Log4Net(new AzureAppender())
- .AzureConfigurationSource()
- .AzureMessageQueue()
- .JsonSerializer()
- .QueuePerInstance()
- .PurgeOnStartup(true)
- .UnicastBus()
- .LoadMessageHandlers()
- .IsTransactional(true)
- .CreateBus();
-
Bus = StartBus.Value;
}
diff --git a/Samples/Azure/AzureFullDuplex/ServiceConfiguration.cscfg b/Samples/Azure/AzureFullDuplex/ServiceConfiguration.cscfg
index 6bdc1908231..db70861b854 100644
--- a/Samples/Azure/AzureFullDuplex/ServiceConfiguration.cscfg
+++ b/Samples/Azure/AzureFullDuplex/ServiceConfiguration.cscfg
@@ -4,7 +4,6 @@
-
@@ -19,12 +18,11 @@
-
+
-
diff --git a/Samples/Azure/AzureFullDuplex/ServiceDefinition.build.csdef b/Samples/Azure/AzureFullDuplex/ServiceDefinition.build.csdef
index cc06cbf55a7..3800a496c71 100644
--- a/Samples/Azure/AzureFullDuplex/ServiceDefinition.build.csdef
+++ b/Samples/Azure/AzureFullDuplex/ServiceDefinition.build.csdef
@@ -19,7 +19,6 @@
-
@@ -40,7 +39,6 @@
-
diff --git a/Samples/Azure/AzureFullDuplex/ServiceDefinition.csdef b/Samples/Azure/AzureFullDuplex/ServiceDefinition.csdef
index f8fee760421..b3976268e27 100644
--- a/Samples/Azure/AzureFullDuplex/ServiceDefinition.csdef
+++ b/Samples/Azure/AzureFullDuplex/ServiceDefinition.csdef
@@ -10,7 +10,6 @@
-
@@ -31,7 +30,6 @@
-
diff --git a/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.build.csdef b/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.build.csdef
index 3d960fc9833..6355c51e61b 100644
--- a/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.build.csdef
+++ b/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.build.csdef
@@ -35,7 +35,7 @@
-
+
\ No newline at end of file
diff --git a/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.csdef b/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.csdef
index 27fb864d921..71fb9b86249 100644
--- a/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.csdef
+++ b/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.csdef
@@ -27,7 +27,7 @@
-
+
\ No newline at end of file
diff --git a/Samples/Azure/AzureHost/Worker/App.config b/Samples/Azure/AzureHost/Worker/App.config
index 185c869169b..c0148ab9997 100644
--- a/Samples/Azure/AzureHost/Worker/App.config
+++ b/Samples/Azure/AzureHost/Worker/App.config
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/Samples/Azure/AzurePubSub/ServiceConfiguration.cscfg b/Samples/Azure/AzurePubSub/ServiceConfiguration.cscfg
index 960d9c8abfd..1056582aff2 100644
--- a/Samples/Azure/AzurePubSub/ServiceConfiguration.cscfg
+++ b/Samples/Azure/AzurePubSub/ServiceConfiguration.cscfg
@@ -4,7 +4,6 @@
-
@@ -25,8 +24,7 @@
-
-
+
diff --git a/Samples/Azure/AzurePubSub/ServiceDefinition.build.csdef b/Samples/Azure/AzurePubSub/ServiceDefinition.build.csdef
index 446098c1b6a..055fbe3f977 100644
--- a/Samples/Azure/AzurePubSub/ServiceDefinition.build.csdef
+++ b/Samples/Azure/AzurePubSub/ServiceDefinition.build.csdef
@@ -19,7 +19,6 @@
-
diff --git a/Samples/Azure/AzurePubSub/ServiceDefinition.csdef b/Samples/Azure/AzurePubSub/ServiceDefinition.csdef
index 3a040b20462..50dde5b8cb5 100644
--- a/Samples/Azure/AzurePubSub/ServiceDefinition.csdef
+++ b/Samples/Azure/AzurePubSub/ServiceDefinition.csdef
@@ -10,7 +10,6 @@
-
diff --git a/Samples/Azure/AzureSagas/Barista/Barista.csproj b/Samples/Azure/AzureSagas/Barista/Barista.csproj
index 05debe73675..edb6b1f7e62 100644
--- a/Samples/Azure/AzureSagas/Barista/Barista.csproj
+++ b/Samples/Azure/AzureSagas/Barista/Barista.csproj
@@ -69,9 +69,9 @@
False
..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll
-
+
False
- ..\..\..\..\binaries\containers\structuremap\StructureMap.dll
+ ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll
diff --git a/Samples/Azure/AzureSagas/Barista/BaristaMessageHandler.cs b/Samples/Azure/AzureSagas/Barista/BaristaMessageHandler.cs
index 02af3917f0b..cdce7de3d11 100644
--- a/Samples/Azure/AzureSagas/Barista/BaristaMessageHandler.cs
+++ b/Samples/Azure/AzureSagas/Barista/BaristaMessageHandler.cs
@@ -66,7 +66,10 @@ private void DeliverOrder()
var viewData = new DeliverOrderView(Data.Drink, Data.Size);
_view.DeliverOrder(viewData);
- Bus.Send(new OrderReadyMessage(Data.CustomerName, Data.Drink));
+ var reply = Bus.CreateInstance();
+ reply.Drink = Data.Drink;
+ reply.CustomerName = Data.CustomerName;
+ Bus.Send(reply);
MarkAsComplete();
}
diff --git a/Samples/Azure/AzureSagas/Cashier/Cashier.csproj b/Samples/Azure/AzureSagas/Cashier/Cashier.csproj
index 488ebfc6dcb..28a6a2fafcd 100644
--- a/Samples/Azure/AzureSagas/Cashier/Cashier.csproj
+++ b/Samples/Azure/AzureSagas/Cashier/Cashier.csproj
@@ -71,9 +71,9 @@
False
..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll
-
+
False
- ..\..\..\..\binaries\containers\structuremap\StructureMap.dll
+ ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll
diff --git a/Samples/Azure/AzureSagas/Cashier/CashierMessageHandler.cs b/Samples/Azure/AzureSagas/Cashier/CashierMessageHandler.cs
index a8de9134f71..bb9e6cef242 100644
--- a/Samples/Azure/AzureSagas/Cashier/CashierMessageHandler.cs
+++ b/Samples/Azure/AzureSagas/Cashier/CashierMessageHandler.cs
@@ -37,8 +37,19 @@ public void Handle(NewOrderMessage message)
Data.CustomerName = message.CustomerName;
Data.Amount = CalculateAmountAccordingTo(message.DrinkSize);
- Bus.Publish(new PrepareOrderMessage(Data.CustomerName, Data.Drink, Data.DrinkSize, Data.OrderId));
- Bus.Reply(new PaymentRequestMessage(Data.Amount, message.CustomerName, message.OrderId));
+ var prepareOrder = Bus.CreateInstance();
+ prepareOrder.CustomerName = Data.CustomerName;
+ prepareOrder.Drink = Data.Drink;
+ prepareOrder.DrinkSize = Data.DrinkSize;
+ prepareOrder.OrderId = Data.OrderId;
+
+ var paymentRequest = Bus.CreateInstance();
+ paymentRequest.OrderId = message.OrderId;
+ paymentRequest.CustomerName = message.CustomerName;
+ paymentRequest.Amount = Data.Amount;
+
+ Bus.Publish(prepareOrder);
+ Bus.Reply(paymentRequest);
}
public void Handle(PaymentMessage message)
@@ -53,7 +64,9 @@ public void Handle(PaymentMessage message)
var viewData = new ReceivedFullPaymentView(Data.CustomerName, Data.Drink, Data.DrinkSize);
_view.ReceivedFullPayment(viewData);
- Bus.Publish(new PaymentCompleteMessage(Data.OrderId));
+ var paymentCompleteMessage = Bus.CreateInstance();
+ paymentCompleteMessage.OrderId = Data.OrderId;
+ Bus.Publish(paymentCompleteMessage);
}
MarkAsComplete();
diff --git a/Samples/Azure/AzureSagas/CashierContracts/NewOrderMessage.cs b/Samples/Azure/AzureSagas/CashierContracts/NewOrderMessage.cs
index c794b4c1f59..620e7d00b9d 100644
--- a/Samples/Azure/AzureSagas/CashierContracts/NewOrderMessage.cs
+++ b/Samples/Azure/AzureSagas/CashierContracts/NewOrderMessage.cs
@@ -12,6 +12,7 @@ public class NewOrderMessage : IMessage
public NewOrderMessage()
{
+ OrderId = Guid.NewGuid();
}
public NewOrderMessage(String customerName, String drink, DrinkSize drinkSize)
diff --git a/Samples/Azure/AzureSagas/Customer/Customer.csproj b/Samples/Azure/AzureSagas/Customer/Customer.csproj
index fb233f96ec3..d21d8606b01 100644
--- a/Samples/Azure/AzureSagas/Customer/Customer.csproj
+++ b/Samples/Azure/AzureSagas/Customer/Customer.csproj
@@ -71,9 +71,9 @@
False
..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll
-
+
False
- ..\..\..\..\binaries\containers\structuremap\StructureMap.dll
+ ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll
diff --git a/Samples/Azure/AzureSagas/Customer/CustomerOrder.cs b/Samples/Azure/AzureSagas/Customer/CustomerOrder.cs
index 1e575203163..9342ddd526e 100644
--- a/Samples/Azure/AzureSagas/Customer/CustomerOrder.cs
+++ b/Samples/Azure/AzureSagas/Customer/CustomerOrder.cs
@@ -24,7 +24,10 @@ private void OrderButton_Click(Object sender, EventArgs e)
var drink = DrinkComboBox.Text;
var drinkSize = (DrinkSize) Enum.Parse(typeof(DrinkSize), SizeComboBox.Text);
- var newOrder = new NewOrderMessage(customerName, drink, drinkSize);
+ var newOrder = _bus.CreateInstance();
+ newOrder.CustomerName = customerName;
+ newOrder.Drink = drink;
+ newOrder.DrinkSize = drinkSize;
_bus.Send(newOrder);
}
@@ -34,7 +37,11 @@ private void OrderButton_Click(Object sender, EventArgs e)
var result = MessageBox.Show(text, "Request payment", MessageBoxButtons.YesNo);
var amount = (DialogResult.Yes == result) ? message.Amount : 0.0;
- _bus.Reply(new PaymentMessage(amount, message.OrderId));
+ var payment = _bus.CreateInstance();
+ payment.Amount = amount;
+ payment.OrderId = message.OrderId;
+
+ _bus.Reply(payment);
}
public new void Handle(OrderReadyMessage message)
diff --git a/Samples/Azure/AzureSagas/TimeoutManager/TimeoutManager.csproj b/Samples/Azure/AzureSagas/TimeoutManager/TimeoutManager.csproj
index a15698282e5..07f75ae2c08 100644
--- a/Samples/Azure/AzureSagas/TimeoutManager/TimeoutManager.csproj
+++ b/Samples/Azure/AzureSagas/TimeoutManager/TimeoutManager.csproj
@@ -76,8 +76,9 @@
..\..\..\..\build\azure\timeout\NServiceBus.Timeout.Hosting.Azure.dll
-
- ..\..\..\..\binaries\containers\structuremap\StructureMap.dll
+
+ False
+ ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll
diff --git a/Samples/Azure/AzureThumbnailCreator/ServiceConfiguration.cscfg b/Samples/Azure/AzureThumbnailCreator/ServiceConfiguration.cscfg
index 14fa3c53956..52b7233eca9 100644
--- a/Samples/Azure/AzureThumbnailCreator/ServiceConfiguration.cscfg
+++ b/Samples/Azure/AzureThumbnailCreator/ServiceConfiguration.cscfg
@@ -6,7 +6,6 @@
-
@@ -21,7 +20,7 @@
-
+
diff --git a/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.build.csdef b/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.build.csdef
index 476d0c71abc..b38ee29b240 100644
--- a/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.build.csdef
+++ b/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.build.csdef
@@ -20,7 +20,6 @@
-
diff --git a/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.csdef b/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.csdef
index 97d7874d43f..5a55cbbaa14 100644
--- a/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.csdef
+++ b/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.csdef
@@ -11,7 +11,6 @@
-
diff --git a/lib/NHibernate.Drivers.Azure.TableStorage.dll b/lib/NHibernate.Drivers.Azure.TableStorage.dll
index 2539dcd3f12..6974bd20ca1 100644
Binary files a/lib/NHibernate.Drivers.Azure.TableStorage.dll and b/lib/NHibernate.Drivers.Azure.TableStorage.dll differ
diff --git a/lib/NHibernate.Drivers.Azure.TableStorage.pdb b/lib/NHibernate.Drivers.Azure.TableStorage.pdb
index 5647454651d..39d9fa15bd6 100644
Binary files a/lib/NHibernate.Drivers.Azure.TableStorage.pdb and b/lib/NHibernate.Drivers.Azure.TableStorage.pdb differ
diff --git a/nant.build b/nant.build
index af363b873e0..ca6f0407450 100644
--- a/nant.build
+++ b/nant.build
@@ -372,6 +372,7 @@
+
diff --git a/packages/repositories.config b/packages/repositories.config
index 9d0c668d7e0..9839a7cd742 100644
--- a/packages/repositories.config
+++ b/packages/repositories.config
@@ -10,8 +10,6 @@
-
-
@@ -30,4 +28,6 @@
+
+
\ No newline at end of file
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/WindowsHost.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/WindowsHost.cs
index f3b8fa1a30b..b068b1f851d 100644
--- a/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/WindowsHost.cs
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/WindowsHost.cs
@@ -25,7 +25,7 @@ public WindowsHost(Type endpointType, string[] args)
args = AddProfilesFromConfiguration(args);
- genericHost = new GenericHost(specifier, args, new[] { typeof(Development), typeof(OnAzureStorage) });
+ genericHost = new GenericHost(specifier, args, new[] { typeof(Development), typeof(OnAzureTableStorage) });
}
///
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointLoader.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointLoader.cs
index 0b4e8f2ce2e..5becb077c27 100644
--- a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointLoader.cs
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointLoader.cs
@@ -40,6 +40,8 @@ public IEnumerable LoadEndpoints()
}
var blobContainer = client.GetContainerReference(container);
+ blobContainer.CreateIfNotExist();
+
return from b in blobContainer.ListBlobs()
where b.Uri.AbsolutePath.EndsWith(".zip")
select new EndpointToHost((CloudBlockBlob)b) ;
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.csproj b/src/azure/Hosting/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.csproj
index 1811a7b418c..1cbf0de6ca0 100644
--- a/src/azure/Hosting/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.csproj
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.csproj
@@ -47,6 +47,10 @@
False
..\..\..\..\lib\log4net.dll
+
+ False
+ ..\..\..\..\build\azure\NServiceBus.Azure\Microsoft.ServiceBus.dll
+
False
..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll
@@ -104,8 +108,12 @@
-
+
+
+
+
+
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnAzureStorageProfileHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnAzureStorageProfileHandler.cs
index 7f2ac8acf0f..4d1a7706111 100644
--- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnAzureStorageProfileHandler.cs
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnAzureStorageProfileHandler.cs
@@ -2,7 +2,7 @@
namespace NServiceBus.Hosting.Azure.Profiles.Handlers
{
- internal class OnAzureStorageProfileHandler : IHandleProfile
+ internal class OnAzureTableStorageProfileHandler : IHandleProfile
{
void IHandleProfile.ProfileActivated()
{
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithAppFabricQueuesProfileHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithAppFabricQueuesProfileHandler.cs
new file mode 100644
index 00000000000..f36d17b0e4f
--- /dev/null
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithAppFabricQueuesProfileHandler.cs
@@ -0,0 +1,14 @@
+using NServiceBus.Hosting.Profiles;
+
+namespace NServiceBus.Hosting.Azure.Profiles.Handlers
+{
+ internal class WithAppFabricQueuesProfileHandler : IHandleProfile
+ {
+ void IHandleProfile.ProfileActivated()
+ {
+ Configure.Instance
+ .AppFabricQueue();
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithStorageQueuesProfileHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithStorageQueuesProfileHandler.cs
new file mode 100644
index 00000000000..3ede58fafc4
--- /dev/null
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithStorageQueuesProfileHandler.cs
@@ -0,0 +1,14 @@
+using NServiceBus.Hosting.Profiles;
+
+namespace NServiceBus.Hosting.Azure.Profiles.Handlers
+{
+ internal class WithAzureStorageQueuesProfileHandler : IHandleProfile
+ {
+ void IHandleProfile.ProfileActivated()
+ {
+ Configure.Instance
+ .AzureMessageQueue();
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnAzureStorage.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnAzureTableStorage.cs
similarity index 63%
rename from src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnAzureStorage.cs
rename to src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnAzureTableStorage.cs
index 0e2668a412e..18ea98048ba 100644
--- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnAzureStorage.cs
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnAzureTableStorage.cs
@@ -1,9 +1,9 @@
namespace NServiceBus
{
///
- /// Indicates that the infrastructure should configure to run on top of azure storage
+ /// Indicates that the infrastructure should configure to run on top of azure table storage
///
- public class OnAzureStorage : IProfile
+ public class OnAzureTableStorage : IProfile
{
}
}
\ No newline at end of file
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAppFabricQueues.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAppFabricQueues.cs
new file mode 100644
index 00000000000..8547a003009
--- /dev/null
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAppFabricQueues.cs
@@ -0,0 +1,6 @@
+namespace NServiceBus
+{
+ public class WithAppFabricQueues : IProfile
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureStorageQueues.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureStorageQueues.cs
new file mode 100644
index 00000000000..6cc0b4742db
--- /dev/null
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureStorageQueues.cs
@@ -0,0 +1,6 @@
+namespace NServiceBus
+{
+ public class WithAzureStorageQueues : IProfile
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/RoleHost/Entrypoint.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/RoleHost/Entrypoint.cs
index 80570ec2dbd..809846c231b 100644
--- a/src/azure/Hosting/NServiceBus.Hosting.Azure/RoleHost/Entrypoint.cs
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/RoleHost/Entrypoint.cs
@@ -51,7 +51,7 @@ public override bool OnStart()
}
else
{
- host = new GenericHost(specifier, requestedProfiles, new[] { typeof(Development), typeof(OnAzureStorage) });
+ host = new GenericHost(specifier, requestedProfiles, new[] { typeof(Development), typeof(OnAzureTableStorage) });
}
return true;
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/ClientRoleHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/ClientRoleHandler.cs
index 35b41ee08c2..9046495dae0 100644
--- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/ClientRoleHandler.cs
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/ClientRoleHandler.cs
@@ -25,7 +25,6 @@ public ConfigUnicastBus ConfigureRole(IConfigureThisEndpoint specifier)
}
return instance
- .AzureMessageQueue()
.JsonSerializer()
.IsTransactional(true)
.UnicastBus()
diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/WorkerRoleHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/WorkerRoleHandler.cs
index ccb458793a8..3ece5a8e025 100644
--- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/WorkerRoleHandler.cs
+++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/WorkerRoleHandler.cs
@@ -26,12 +26,10 @@ public ConfigUnicastBus ConfigureRole(IConfigureThisEndpoint specifier)
}
return instance
- .AzureMessageQueue()
.JsonSerializer()
.IsTransactional(true)
.UnicastBus()
- .ImpersonateSender(false)
- .LoadMessageHandlers();
+ .ImpersonateSender(false);
}
diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/ConfigureAppFabricQueue.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/ConfigureAppFabricQueue.cs
index de741dfd2d9..fc6350500f6 100644
--- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/ConfigureAppFabricQueue.cs
+++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/ConfigureAppFabricQueue.cs
@@ -1,6 +1,5 @@
using System.Configuration;
using Microsoft.ServiceBus;
-using Microsoft.ServiceBus.Description;
using Microsoft.ServiceBus.Messaging;
using NServiceBus.Config;
using NServiceBus.ObjectBuilder;
@@ -10,20 +9,19 @@ namespace NServiceBus
{
public static class ConfigureAppFabricQueue
{
- public static Configure AppFabricMessageQueue(this Configure config)
+ public static Configure AppFabricQueue(this Configure config)
{
var configSection = Configure.GetConfigSection();
if (configSection == null)
throw new ConfigurationErrorsException("No AppFabricQueueConfig configuration section found");
-
- var credentials = TransportClientCredentialBase.CreateSharedSecretCredential(configSection.IssuerName, configSection.IssuerKey);
- var managementUri = ServiceBusEnvironment.CreateServiceUri("https", configSection.ServiceNamespace, string.Empty);
- var runtimeUri = ServiceBusEnvironment.CreateServiceUri("sb", configSection.ServiceNamespace, string.Empty);
- var namespaceClient = new ServiceBusNamespaceClient(managementUri, credentials);
- var factory = MessagingFactory.Create(runtimeUri, credentials);
+
+ var credentials = TokenProvider.CreateSharedSecretTokenProvider(configSection.IssuerName, configSection.IssuerKey);
+ var serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", configSection.ServiceNamespace, string.Empty);
+ var namespaceClient = new NamespaceManager(serviceUri, credentials);
+ var factory = MessagingFactory.Create(serviceUri, credentials);
- config.Configurer.RegisterSingleton(namespaceClient);
+ config.Configurer.RegisterSingleton(namespaceClient);
config.Configurer.RegisterSingleton(factory);
config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance);
diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/NServiceBus.Unicast.Queuing.AppFabric.Config.csproj b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/NServiceBus.Unicast.Queuing.AppFabric.Config.csproj
index 571889e0ee2..e221fe21b42 100644
--- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/NServiceBus.Unicast.Queuing.AppFabric.Config.csproj
+++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/NServiceBus.Unicast.Queuing.AppFabric.Config.csproj
@@ -31,12 +31,9 @@
4
-
- False
- ..\..\..\..\packages\WindowsAzure.ServiceBus.0.6.0.0\lib\net40\Microsoft.ServiceBus.dll
-
-
- ..\..\..\..\packages\WindowsAzure.ServiceBus.0.6.0.0\lib\net40\Microsoft.ServiceBus.Messaging.dll
+
+ True
+ ..\..\..\..\packages\WindowsAzure.ServiceBus.1.5.0.0\lib\net40-full\Microsoft.ServiceBus.dll
..\..\..\..\build\output\NServiceBus.dll
diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/app.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/app.config
index e2aa2399f7b..296f244cdf6 100644
--- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/app.config
+++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/app.config
@@ -4,25 +4,25 @@
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/packages.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/packages.config
index 0ec9bcb3ac7..f308d534c26 100644
--- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/packages.config
+++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/AppFabricQueue.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/AppFabricQueue.cs
index 568a043cbf8..6c4643ccf61 100644
--- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/AppFabricQueue.cs
+++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/AppFabricQueue.cs
@@ -3,7 +3,6 @@
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
-using System.ServiceModel;
using System.Transactions;
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;
@@ -13,17 +12,16 @@ namespace NServiceBus.Unicast.Queuing.AppFabric
{
public class AppFabricQueue : IReceiveMessages, ISendMessages
{
- private readonly Dictionary senders = new Dictionary();
+ private readonly Dictionary senders = new Dictionary();
private static readonly object SenderLock = new Object();
private readonly MessagingFactory factory;
- private readonly ServiceBusNamespaceClient namespaceClient;
- private MessageReceiver receiver;
+ private readonly NamespaceManager namespaceClient;
private bool useTransactions;
private QueueClient queueClient;
private string queueName;
- public AppFabricQueue(MessagingFactory factory, ServiceBusNamespaceClient namespaceClient)
+ public AppFabricQueue(MessagingFactory factory, NamespaceManager namespaceClient)
{
this.factory = factory;
this.namespaceClient = namespaceClient;
@@ -40,18 +38,16 @@ public void Init(Address address, bool transactional)
try
{
queueName = address.Queue;
- var description = new QueueDescription {RequiresSession = false, RequiresDuplicateDetection = false, MaxQueueSizeInBytes = 104857600};
- namespaceClient.CreateQueue(queueName, description);
+ var description = new QueueDescription(queueName) { RequiresSession = false, RequiresDuplicateDetection = false, MaxSizeInMegabytes = 1024 };
+ namespaceClient.CreateQueue(description);
}
catch (MessagingEntityAlreadyExistsException)
{
// the queue already exists, which is ok
}
- queueClient = factory.CreateQueueClient(queueName);
- receiver = queueClient.CreateReceiver(ReceiveMode.PeekLock);
- receiver.Faulted += (o, args) => receiver = queueClient.CreateReceiver(ReceiveMode.PeekLock);
-
+ queueClient = factory.CreateQueueClient(queueName, ReceiveMode.PeekLock);
+
useTransactions = transactional;
}
@@ -64,8 +60,8 @@ public bool HasMessage()
public TransportMessage Receive()
{
- BrokeredMessage message;
- if(receiver.TryReceive(out message))
+ BrokeredMessage message = queueClient.Receive();
+ if(message != null)
{
var rawMessage = message.GetBody();
var t = DeserializeMessage(rawMessage);
@@ -98,17 +94,16 @@ public void Send(TransportMessage message, Address address)
{
var destination = address.Queue;
- MessageSender sender;
- if(!senders.TryGetValue(destination, out sender) || sender.State == CommunicationState.Faulted)
+ QueueClient sender;
+ if (!senders.TryGetValue(destination, out sender) )
{
lock (SenderLock)
{
- if (!senders.TryGetValue(destination, out sender) || sender.State == CommunicationState.Faulted)
+ if (!senders.TryGetValue(destination, out sender) )
{
try
{
- var c = factory.CreateQueueClient(destination);
- sender = c.CreateSender();
+ sender = factory.CreateQueueClient(destination);
senders[destination] = sender;
}
catch (MessagingEntityNotFoundException)
@@ -122,7 +117,7 @@ public void Send(TransportMessage message, Address address)
message.Id = Guid.NewGuid().ToString();
var rawMessage = SerializeMessage(message);
- var brokeredMessage = BrokeredMessage.CreateMessage(rawMessage);
+ var brokeredMessage = new BrokeredMessage(rawMessage);
if (Transaction.Current == null)
sender.Send(brokeredMessage);
@@ -139,8 +134,6 @@ private static byte[] SerializeMessage(TransportMessage originalMessage)
formatter.Serialize(stream, originalMessage);
return stream.ToArray();
}
-
-
}
private static TransportMessage DeserializeMessage(byte[] rawMessage)
diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/NServiceBus.Unicast.Queuing.AppFabric.csproj b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/NServiceBus.Unicast.Queuing.AppFabric.csproj
index 1bb584ad9c3..78931120b92 100644
--- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/NServiceBus.Unicast.Queuing.AppFabric.csproj
+++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/NServiceBus.Unicast.Queuing.AppFabric.csproj
@@ -31,12 +31,9 @@
4
-
- False
- ..\..\..\..\packages\WindowsAzure.ServiceBus.0.6.0.0\lib\net40\Microsoft.ServiceBus.dll
-
-
- ..\..\..\..\packages\WindowsAzure.ServiceBus.0.6.0.0\lib\net40\Microsoft.ServiceBus.Messaging.dll
+
+ True
+ ..\..\..\..\packages\WindowsAzure.ServiceBus.1.5.0.0\lib\net40-full\Microsoft.ServiceBus.dll
..\..\..\..\build\output\NServiceBus.dll
diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/SendResourceManager.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/SendResourceManager.cs
index bc3a59b2875..473bdda2474 100644
--- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/SendResourceManager.cs
+++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/SendResourceManager.cs
@@ -6,10 +6,10 @@ namespace NServiceBus.Unicast.Queuing.AppFabric
{
public class SendResourceManager : IEnlistmentNotification
{
- private readonly MessageSender sender;
+ private readonly QueueClient sender;
private readonly BrokeredMessage message;
- public SendResourceManager(MessageSender sender, BrokeredMessage message)
+ public SendResourceManager(QueueClient sender, BrokeredMessage message)
{
this.sender = sender;
this.message = message;
@@ -22,15 +22,7 @@ public void Prepare(PreparingEnlistment preparingEnlistment)
public void Commit(Enlistment enlistment)
{
- try
- {
- sender.Send(message);
- }
- catch (Exception)
- {
-
- throw;
- }
+ sender.Send(message);
enlistment.Done();
}
diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/app.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/app.config
new file mode 100644
index 00000000000..296f244cdf6
--- /dev/null
+++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/app.config
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/packages.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/packages.config
index 0ec9bcb3ac7..f308d534c26 100644
--- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/packages.config
+++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/src/azure/Queueing/queuing.sln b/src/azure/Queueing/queuing.sln
index 1bde207994d..4720fbd4320 100644
--- a/src/azure/Queueing/queuing.sln
+++ b/src/azure/Queueing/queuing.sln
@@ -11,6 +11,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.Azure.Tests", "NServiceBus.Unicast.Queuing.Azure.Tests\NServiceBus.Unicast.Queuing.Azure.Tests.csproj", "{D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.AppFabric", "NServiceBus.Unicast.Queuing.AppFabric\NServiceBus.Unicast.Queuing.AppFabric.csproj", "{911C5871-B059-4F8D-99B3-86F13CDEFC86}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.AppFabric.Config", "NServiceBus.Unicast.Queuing.AppFabric.Config\NServiceBus.Unicast.Queuing.AppFabric.Config.csproj", "{350CA11F-E647-47F6-B9A3-1E1653B8D4B0}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -29,6 +33,14 @@ Global
{D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Release|Any CPU.Build.0 = Release|Any CPU
+ {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -37,5 +49,7 @@ Global
{D12E0534-9C6F-4E39-AC68-4212FF13E7F1} = {A46EEB01-F4EE-4842-9B23-2EA81EA82114}
{87C365D3-7D4A-4686-A042-5E7B83869CBF} = {A46EEB01-F4EE-4842-9B23-2EA81EA82114}
{D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD} = {A46EEB01-F4EE-4842-9B23-2EA81EA82114}
+ {911C5871-B059-4F8D-99B3-86F13CDEFC86} = {AADC7038-53DD-416B-8DEC-3FDA4D15DAED}
+ {350CA11F-E647-47F6-B9A3-1E1653B8D4B0} = {AADC7038-53DD-416B-8DEC-3FDA4D15DAED}
EndGlobalSection
EndGlobal
diff --git a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/SessionFactoryBuilder.cs b/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/SessionFactoryBuilder.cs
index 7b82bba6259..3f4b29a03ba 100644
--- a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/SessionFactoryBuilder.cs
+++ b/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/SessionFactoryBuilder.cs
@@ -1,41 +1,41 @@
-using System;
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using NHibernate;
-using NHibernate.Context;
+using NHibernate.Context;
using NHibernate.Drivers.Azure.TableStorage.Mapping;
using NHibernate.Mapping.ByCode;
using NHibernate.Tool.hbm2ddl;
-using NServiceBus.SagaPersisters.NHibernate.AutoPersistence;
-using Configuration=NHibernate.Cfg.Configuration;
-
-namespace NServiceBus.SagaPersisters.Azure.Config.Internal
-{
- ///
- /// Builder class for the NHibernate Session Factory
- ///
- public class SessionFactoryBuilder
- {
- private readonly IEnumerable typesToScan;
-
- ///
- /// Constructor that accepts the types to scan for saga data classes
- ///
- ///
- public SessionFactoryBuilder(IEnumerable typesToScan)
- {
- this.typesToScan = typesToScan;
- }
-
- ///
- /// Builds the session factory with the given properties. Database is updated if updateSchema is set
- ///
- ///
- ///
- ///
- public ISessionFactory Build(IDictionary nhibernateProperties, bool updateSchema)
+using NServiceBus.SagaPersisters.NHibernate.AutoPersistence;
+using Configuration=NHibernate.Cfg.Configuration;
+
+namespace NServiceBus.SagaPersisters.Azure.Config.Internal
+{
+ ///
+ /// Builder class for the NHibernate Session Factory
+ ///
+ public class SessionFactoryBuilder
+ {
+ private readonly IEnumerable typesToScan;
+
+ ///
+ /// Constructor that accepts the types to scan for saga data classes
+ ///
+ ///
+ public SessionFactoryBuilder(IEnumerable typesToScan)
+ {
+ this.typesToScan = typesToScan;
+ }
+
+ ///
+ /// Builds the session factory with the given properties. Database is updated if updateSchema is set
+ ///
+ ///
+ ///
+ ///
+ public ISessionFactory Build(IDictionary nhibernateProperties, bool updateSchema)
{
var scannedAssemblies = typesToScan.Select(t => t.Assembly).Distinct();
@@ -110,5 +110,5 @@ private static void ApplyDefaultsTo(Configuration configuration)
configuration.SetProperty("current_session_context_class", typeof(ThreadStaticSessionContext).AssemblyQualifiedName);
}
- }
+ }
}
\ No newline at end of file
diff --git a/src/core/NServiceBus/Address.cs b/src/core/NServiceBus/Address.cs
index 114702c8e65..4e1c24cc226 100644
--- a/src/core/NServiceBus/Address.cs
+++ b/src/core/NServiceBus/Address.cs
@@ -38,8 +38,8 @@ public static void InitializeLocalAddress(string queue)
///
public static void OverrideDefaultMachine(string machineName)
{
- if (Local != null)
- throw new InvalidOperationException("The local address has already been initialized, changing the default machine name is no longer possible.");
+ //if (Local != null)
+ // throw new InvalidOperationException("The local address has already been initialized, changing the default machine name is no longer possible.");
defaultMachine = machineName;
}
@@ -51,8 +51,8 @@ public static void OverrideDefaultMachine(string machineName)
///
public static void InitializeAddressMode(AddressMode mode)
{
- if (Local != null)
- throw new InvalidOperationException("The local address has already been initialized, switching address modes is no longer possible.");
+ //if (Local != null)
+ // throw new InvalidOperationException("The local address has already been initialized, switching address modes is no longer possible.");
addressMode = mode;
}