diff --git a/.gitignore b/.gitignore
index 57c9036..1ad4251 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,4 +29,5 @@ _ReSharper*/
[Tt]est[Rr]esult*
.hg/
BuildOutput/*
-packages/*
\ No newline at end of file
+packages/*
+/.vs/
diff --git a/ProjectExtensions.Azure.ServiceBus.sln b/ProjectExtensions.Azure.ServiceBus.sln
index bd20d21..1d4f078 100644
--- a/ProjectExtensions.Azure.ServiceBus.sln
+++ b/ProjectExtensions.Azure.ServiceBus.sln
@@ -1,6 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
+# Visual Studio Version 17
+VisualStudioVersion = 17.5.33530.505
+MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectExtensions.Azure.ServiceBus", "src\ProjectExtensions.Azure.ServiceBus\ProjectExtensions.Azure.ServiceBus.csproj", "{8C8A8531-95AE-41CD-B2AC-6651F104245E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectExtensions.Azure.ServiceBus.Tests.Unit", "src\Tests\ProjectExtensions.Azure.ServiceBus.Tests.Unit\ProjectExtensions.Azure.ServiceBus.Tests.Unit.csproj", "{7B5EB3D2-771D-467C-B467-60BF2065890D}"
diff --git a/packages/repositories.config b/packages/repositories.config
deleted file mode 100644
index f21a521..0000000
--- a/packages/repositories.config
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Autofac/Container/AutofacAzureBusContainer.cs b/src/ProjectExtensions.Azure.ServiceBus.Autofac/Container/AutofacAzureBusContainer.cs
index 5007215..182f78a 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Autofac/Container/AutofacAzureBusContainer.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.Autofac/Container/AutofacAzureBusContainer.cs
@@ -1,8 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Autofac;
+using Autofac;
using ProjectExtensions.Azure.ServiceBus.Container;
+using System;
+using System.Collections.Generic;
namespace ProjectExtensions.Azure.ServiceBus.Autofac.Container {
///
@@ -70,12 +69,14 @@ public override void RegisterConfiguration() {
/// Build the container if needed.
///
public override void Build() {
- if (container == null) {
- container = builder.Build();
- }
- else {
- builder.Update(container);
- }
+ //NOTE: Determine if we need to rebuild the container. This is a workaround for a bug in Autofac.
+ container = builder.Build();
+ //if (container == null) {
+ // container = builder.Build();
+ //}
+ //else {
+ // builder.Update(container);
+ //}
builder = new ContainerBuilder();
registeredTypes.Clear();
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Autofac/Container/AutofacBusConfigurationBuilderExtensions.cs b/src/ProjectExtensions.Azure.ServiceBus.Autofac/Container/AutofacBusConfigurationBuilderExtensions.cs
index 887cec7..38b6068 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Autofac/Container/AutofacBusConfigurationBuilderExtensions.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.Autofac/Container/AutofacBusConfigurationBuilderExtensions.cs
@@ -15,6 +15,6 @@ public static BusConfigurationBuilder UseAutofacContainer(this BusConfigurationB
builder.Configuration.Container = new AutofacAzureBusContainer(container);
return builder;
}
-
+
}
}
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Autofac/ProjectExtensions.Azure.ServiceBus.Autofac.csproj b/src/ProjectExtensions.Azure.ServiceBus.Autofac/ProjectExtensions.Azure.ServiceBus.Autofac.csproj
index d7486ab..2f701b4 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Autofac/ProjectExtensions.Azure.ServiceBus.Autofac.csproj
+++ b/src/ProjectExtensions.Azure.ServiceBus.Autofac/ProjectExtensions.Azure.ServiceBus.Autofac.csproj
@@ -1,73 +1,31 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {11192756-9ABB-4C2B-8FE5-2DBD4DC0DC36}
+ net7.0
Library
- Properties
- ProjectExtensions.Azure.ServiceBus.Autofac
- ProjectExtensions.Azure.ServiceBus.Autofac
- v4.0
- 512
+ false
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
bin\Debug\ProjectExtensions.Azure.ServiceBus.Autofac.XML
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
bin\Release\ProjectExtensions.Azure.ServiceBus.Autofac.XML
-
-
- False
- ..\..\packages\Autofac.3.3.0\lib\net40\Autofac.dll
-
-
-
-
-
-
-
-
-
Properties\CommonAssemblyInfo.cs
-
-
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
+
-
+
+ 7.0.1
+
+
+
+
+ all
+
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Autofac/Properties/AssemblyInfo.cs b/src/ProjectExtensions.Azure.ServiceBus.Autofac/Properties/AssemblyInfo.cs
index 9ca652d..5f5784f 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Autofac/Properties/AssemblyInfo.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.Autofac/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
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
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Autofac/packages.config b/src/ProjectExtensions.Azure.ServiceBus.Autofac/packages.config
deleted file mode 100644
index 9cc8406..0000000
--- a/src/ProjectExtensions.Azure.ServiceBus.Autofac/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Container/CastleWindsorBusConfigurationBuilderExtensions.cs b/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Container/CastleWindsorBusConfigurationBuilderExtensions.cs
index 6b660e7..9ddc53f 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Container/CastleWindsorBusConfigurationBuilderExtensions.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Container/CastleWindsorBusConfigurationBuilderExtensions.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Castle.Windsor;
+using Castle.Windsor;
namespace ProjectExtensions.Azure.ServiceBus.CastleWindsor.Container {
///
@@ -15,7 +11,7 @@ public static class CastleWindsorBusConfigurationBuilderExtensions {
///
/// Castle Windsor container used in your application. This is optional. A new container will be created if one is not provided
///
- public static BusConfigurationBuilder UseCastleWindsorContainer(this BusConfigurationBuilder builder, IWindsorContainer container = null) {
+ public static BusConfigurationBuilder UseCastleWindsorContainer(this BusConfigurationBuilder builder, IWindsorContainer container = null) {
builder.Configuration.Container = new CastleWindsorBusContainer(container);
return builder;
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Container/CastleWindsorBusContainer.cs b/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Container/CastleWindsorBusContainer.cs
index a1f2a6a..180c6f6 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Container/CastleWindsorBusContainer.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Container/CastleWindsorBusContainer.cs
@@ -1,10 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Castle.MicroKernel.Registration;
+using Castle.MicroKernel.Registration;
using Castle.Windsor;
using ProjectExtensions.Azure.ServiceBus.Container;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.CastleWindsor.Container {
///
@@ -12,7 +9,7 @@ namespace ProjectExtensions.Azure.ServiceBus.CastleWindsor.Container {
///
public class CastleWindsorBusContainer : AzureBusContainerBase {
IWindsorContainer container;
-
+
///
/// Constructor.
///
@@ -26,7 +23,7 @@ public CastleWindsorBusContainer(IWindsorContainer container = null) {
///
///
///
- public override T Resolve() {
+ public override T Resolve() {
return container.Resolve();
}
@@ -48,7 +45,8 @@ public override object Resolve(Type t) {
public override void Register(Type serviceType, Type implementationType, bool perInstance = false) {
if (perInstance) {
container.Register(Component.For(serviceType).ImplementedBy(implementationType).LifestyleTransient());
- } else {
+ }
+ else {
container.Register(Component.For(serviceType).ImplementedBy(implementationType).LifestyleSingleton());
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/ProjectExtensions.Azure.ServiceBus.CastleWindsor.csproj b/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/ProjectExtensions.Azure.ServiceBus.CastleWindsor.csproj
index a7fc2a6..a588780 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/ProjectExtensions.Azure.ServiceBus.CastleWindsor.csproj
+++ b/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/ProjectExtensions.Azure.ServiceBus.CastleWindsor.csproj
@@ -1,77 +1,34 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {69CAB6DE-C753-42F9-9E8F-935B975DBCA2}
+ net7.0
Library
- Properties
- ProjectExtensions.Azure.ServiceBus.CastleWindsor
- ProjectExtensions.Azure.ServiceBus.CastleWindsor
- v4.0
- 512
+ false
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
bin\Debug\ProjectExtensions.Azure.ServiceBus.CastleWindsor.XML
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
bin\Release\ProjectExtensions.Azure.ServiceBus.CastleWindsor.XML
-
-
- False
- ..\..\packages\Castle.Core.3.2.2\lib\net40-client\Castle.Core.dll
-
-
- False
- ..\..\packages\Castle.Windsor.3.2.1\lib\net40\Castle.Windsor.dll
-
-
-
-
-
-
-
-
-
Properties\CommonAssemblyInfo.cs
-
-
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
+
-
+
+ 5.1.1
+
+
+ 5.1.2
+
+
+
+
+ all
+
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Properties/AssemblyInfo.cs b/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Properties/AssemblyInfo.cs
index a1191f1..cf0f6f9 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Properties/AssemblyInfo.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
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
diff --git a/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/packages.config b/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/packages.config
deleted file mode 100644
index 5672125..0000000
--- a/src/ProjectExtensions.Azure.ServiceBus.CastleWindsor/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Ninject/Container/NinjectAzureBusContainer.cs b/src/ProjectExtensions.Azure.ServiceBus.Ninject/Container/NinjectAzureBusContainer.cs
index 6c38531..5da7e89 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Ninject/Container/NinjectAzureBusContainer.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.Ninject/Container/NinjectAzureBusContainer.cs
@@ -1,14 +1,11 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Ninject;
-using Ninject.Activation;
+using Ninject;
using Ninject.Parameters;
using ProjectExtensions.Azure.ServiceBus.Container;
+using System;
+using System.Collections.Generic;
namespace ProjectExtensions.Azure.ServiceBus.Ninject.Container {
-
+
///
/// Implementation of for Ninject.
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Ninject/Container/NinjectBusConfigurationBuilderExtensions.cs b/src/ProjectExtensions.Azure.ServiceBus.Ninject/Container/NinjectBusConfigurationBuilderExtensions.cs
index 82e43dc..835943f 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Ninject/Container/NinjectBusConfigurationBuilderExtensions.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.Ninject/Container/NinjectBusConfigurationBuilderExtensions.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Ninject;
+using Ninject;
namespace ProjectExtensions.Azure.ServiceBus.Ninject.Container {
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Ninject/ProjectExtensions.Azure.ServiceBus.Ninject.csproj b/src/ProjectExtensions.Azure.ServiceBus.Ninject/ProjectExtensions.Azure.ServiceBus.Ninject.csproj
index db55b4e..d611504 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Ninject/ProjectExtensions.Azure.ServiceBus.Ninject.csproj
+++ b/src/ProjectExtensions.Azure.ServiceBus.Ninject/ProjectExtensions.Azure.ServiceBus.Ninject.csproj
@@ -1,76 +1,34 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {18285A92-F031-45A5-97BB-FE3841DAB434}
+ net7.0
Library
- Properties
- ProjectExtensions.Azure.ServiceBus.Ninject
- ProjectExtensions.Azure.ServiceBus.Ninject
- v4.0
- 512
+ false
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
bin\Debug\ProjectExtensions.Azure.ServiceBus.Ninject.XML
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
bin\Release\ProjectExtensions.Azure.ServiceBus.Ninject.XML
-
-
- False
- ..\..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll
-
-
-
-
-
-
-
-
-
Properties\CommonAssemblyInfo.cs
-
-
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
+
-
+
+
+ 3.3.6
+
+
+
+ all
+
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Ninject/Properties/AssemblyInfo.cs b/src/ProjectExtensions.Azure.ServiceBus.Ninject/Properties/AssemblyInfo.cs
index ab70da1..981a426 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Ninject/Properties/AssemblyInfo.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.Ninject/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Ninject/packages.config b/src/ProjectExtensions.Azure.ServiceBus.Ninject/packages.config
deleted file mode 100644
index 78fda83..0000000
--- a/src/ProjectExtensions.Azure.ServiceBus.Ninject/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Container/StructureMapAzureBusContainer.cs b/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Container/StructureMapAzureBusContainer.cs
index 07cd153..195c31e 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Container/StructureMapAzureBusContainer.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Container/StructureMapAzureBusContainer.cs
@@ -1,7 +1,7 @@
-using System;
-using ProjectExtensions.Azure.ServiceBus.Container;
+using ProjectExtensions.Azure.ServiceBus.Container;
using StructureMap;
using StructureMap.Pipeline;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.StructureMap.Container {
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Container/StructureMapBusConfigurationBuilderExtensions.cs b/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Container/StructureMapBusConfigurationBuilderExtensions.cs
index 18bc7c2..df3bd9b 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Container/StructureMapBusConfigurationBuilderExtensions.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Container/StructureMapBusConfigurationBuilderExtensions.cs
@@ -11,7 +11,7 @@ public static class StructureMapBusConfigurationBuilderExtensions {
///
/// Structure Map container used in your application. This is optional. A new container will be created if one is not provided
///
- public static BusConfigurationBuilder UseStructureMapContainer(this BusConfigurationBuilder builder, IContainer container = null) {
+ public static BusConfigurationBuilder UseStructureMapContainer(this BusConfigurationBuilder builder, IContainer container = null) {
builder.Configuration.Container = new StructureMapAzureBusContainer(container);
return builder;
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus.StructureMap/ProjectExtensions.Azure.ServiceBus.StructureMap.csproj b/src/ProjectExtensions.Azure.ServiceBus.StructureMap/ProjectExtensions.Azure.ServiceBus.StructureMap.csproj
index 2c666c7..6ca51e0 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.StructureMap/ProjectExtensions.Azure.ServiceBus.StructureMap.csproj
+++ b/src/ProjectExtensions.Azure.ServiceBus.StructureMap/ProjectExtensions.Azure.ServiceBus.StructureMap.csproj
@@ -1,76 +1,31 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {5C526602-9D47-4E02-B3A6-745E9D573994}
+ net7.0
Library
- Properties
- ProjectExtensions.Azure.ServiceBus.StructureMap
- ProjectExtensions.Azure.ServiceBus.StructureMap
- v4.0
- 512
+ false
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
bin\Debug\ProjectExtensions.Azure.ServiceBus.StructureMap.XML
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
bin\Release\ProjectExtensions.Azure.ServiceBus.StructureMap.XML
-
-
- ..\..\packages\Unity.2.1.505.0\lib\NET35\Microsoft.Practices.Unity.dll
-
-
- False
- ..\..\packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll
-
-
-
-
-
-
-
-
-
Properties\CommonAssemblyInfo.cs
-
-
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
+
-
+
+
+ 4.7.1
+
+
+
+ all
+
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Properties/AssemblyInfo.cs b/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Properties/AssemblyInfo.cs
index 456e119..9db1aca 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Properties/AssemblyInfo.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.StructureMap/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
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
diff --git a/src/ProjectExtensions.Azure.ServiceBus.StructureMap/packages.config b/src/ProjectExtensions.Azure.ServiceBus.StructureMap/packages.config
deleted file mode 100644
index 7113b45..0000000
--- a/src/ProjectExtensions.Azure.ServiceBus.StructureMap/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Unity/Container/UnityAzureBusContainer.cs b/src/ProjectExtensions.Azure.ServiceBus.Unity/Container/UnityAzureBusContainer.cs
index 74eaf15..f5903a2 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Unity/Container/UnityAzureBusContainer.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.Unity/Container/UnityAzureBusContainer.cs
@@ -1,9 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Practices.Unity;
-using ProjectExtensions.Azure.ServiceBus.Container;
+using ProjectExtensions.Azure.ServiceBus.Container;
+using System;
+using Unity;
+using Unity.Lifetime;
namespace ProjectExtensions.Azure.ServiceBus.Unity.Container {
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Unity/Container/UnityBusConfigurationBuilderExtensions.cs b/src/ProjectExtensions.Azure.ServiceBus.Unity/Container/UnityBusConfigurationBuilderExtensions.cs
index 195352d..387dcd3 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Unity/Container/UnityBusConfigurationBuilderExtensions.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.Unity/Container/UnityBusConfigurationBuilderExtensions.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Practices.Unity;
-using ProjectExtensions.Azure.ServiceBus;
-using ProjectExtensions.Azure.ServiceBus.Unity.Container;
+using Unity;
namespace ProjectExtensions.Azure.ServiceBus.Unity.Container {
///
@@ -17,7 +11,7 @@ public static class UnityBusConfigurationBuilderExtensions {
///
/// Unity container used in your application. This is optional. A new container will be created if one is not provided
///
- public static BusConfigurationBuilder UseUnityContainer(this BusConfigurationBuilder builder, IUnityContainer container = null) {
+ public static BusConfigurationBuilder UseUnityContainer(this BusConfigurationBuilder builder, IUnityContainer container = null) {
builder.Configuration.Container = new UnityAzureBusContainer(container);
return builder;
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Unity/ProjectExtensions.Azure.ServiceBus.Unity.csproj b/src/ProjectExtensions.Azure.ServiceBus.Unity/ProjectExtensions.Azure.ServiceBus.Unity.csproj
index 4e8e008..76961bc 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Unity/ProjectExtensions.Azure.ServiceBus.Unity.csproj
+++ b/src/ProjectExtensions.Azure.ServiceBus.Unity/ProjectExtensions.Azure.ServiceBus.Unity.csproj
@@ -1,78 +1,26 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {B505DEAA-0CCA-4E26-9CA6-AB2820C85FC7}
+ net7.0
Library
- Properties
- ProjectExtensions.Azure.ServiceBus.Unity
- ProjectExtensions.Azure.ServiceBus.Unity
- v4.0
- 512
+ false
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
bin\Debug\ProjectExtensions.Azure.ServiceBus.Unity.XML
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
bin\Release\ProjectExtensions.Azure.ServiceBus.Unity.XML
-
- False
- ..\..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll
-
-
- False
- ..\..\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.dll
-
-
- False
- ..\..\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.Configuration.dll
-
-
-
-
-
-
-
-
+
-
-
-
+
+
+
+ 5.11.10
+
+
+ all
+
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Unity/Properties/AssemblyInfo.cs b/src/ProjectExtensions.Azure.ServiceBus.Unity/Properties/AssemblyInfo.cs
index 1951dd0..6ebd967 100644
--- a/src/ProjectExtensions.Azure.ServiceBus.Unity/Properties/AssemblyInfo.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus.Unity/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
diff --git a/src/ProjectExtensions.Azure.ServiceBus.Unity/packages.config b/src/ProjectExtensions.Azure.ServiceBus.Unity/packages.config
deleted file mode 100644
index d437344..0000000
--- a/src/ProjectExtensions.Azure.ServiceBus.Unity/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus/AnonymousDisposable.cs b/src/ProjectExtensions.Azure.ServiceBus/AnonymousDisposable.cs
index 448cd3f..e4cde1f 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/AnonymousDisposable.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/AnonymousDisposable.cs
@@ -1,9 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using NLog;
+using System;
using System.Threading;
-using NLog;
namespace ProjectExtensions.Azure.ServiceBus {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/AzureBus.cs b/src/ProjectExtensions.Azure.ServiceBus/AzureBus.cs
index 5284a71..d5b79e9 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/AzureBus.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/AzureBus.cs
@@ -1,13 +1,11 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
+using Microsoft.Practices.TransientFaultHandling;
using NLog;
-using System.Linq.Expressions;
-using Microsoft.Practices.TransientFaultHandling;
using ProjectExtensions.Azure.ServiceBus.Helpers;
using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
namespace ProjectExtensions.Azure.ServiceBus {
@@ -76,7 +74,7 @@ public void RegisterAssembly(Assembly assembly) {
///
/// The message to publish.
public void Publish(T message) {
- sender.Send(message, default(IDictionary));
+ sender.Send(message, default);
}
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/AzureSenderReceiverBase.cs b/src/ProjectExtensions.Azure.ServiceBus/AzureSenderReceiverBase.cs
index 9606772..9452dce 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/AzureSenderReceiverBase.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/AzureSenderReceiverBase.cs
@@ -1,15 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.ServiceBus;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus.Messaging;
-using Microsoft.ServiceBus;
using NLog;
-using Microsoft.Practices.TransientFaultHandling;
-using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.ServiceBus;
-using ProjectExtensions.Azure.ServiceBus.TransientFaultHandling.ServiceBus;
-using System.Net;
using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using ProjectExtensions.Azure.ServiceBus.TransientFaultHandling.ServiceBus;
+using System;
namespace ProjectExtensions.Azure.ServiceBus {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusMessagingFactoryFactory.cs b/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusMessagingFactoryFactory.cs
index 267a414..91a02d3 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusMessagingFactoryFactory.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusMessagingFactoryFactory.cs
@@ -1,14 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus.Messaging;
-using Microsoft.Practices.TransientFaultHandling;
-using Microsoft.ServiceBus;
+using NLog;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
using ProjectExtensions.Azure.ServiceBus.Wrappers;
using System.IO;
-using NLog;
namespace ProjectExtensions.Azure.ServiceBus.AzureServiceBusFactories {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusNamespaceManagerFactory.cs b/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusNamespaceManagerFactory.cs
index e9022eb..dc18007 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusNamespaceManagerFactory.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusNamespaceManagerFactory.cs
@@ -1,12 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
-using Microsoft.ServiceBus.Messaging;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus;
-using Microsoft.Practices.TransientFaultHandling;
+using Microsoft.ServiceBus.Messaging;
using NLog;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
namespace ProjectExtensions.Azure.ServiceBus.AzureServiceBusFactories {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusTokenProvider.cs b/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusTokenProvider.cs
index 032b3de..c518eef 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusTokenProvider.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/AzureServiceBusFactories/ServiceBusTokenProvider.cs
@@ -1,10 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus;
-using Microsoft.Practices.TransientFaultHandling;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.AzureServiceBusFactories {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/BrokeredMessageWrapper.cs b/src/ProjectExtensions.Azure.ServiceBus/BrokeredMessageWrapper.cs
index 7b61fde..eb3420f 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/BrokeredMessageWrapper.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/BrokeredMessageWrapper.cs
@@ -1,8 +1,6 @@
-using System;
+using Microsoft.ServiceBus.Messaging;
+using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus.Messaging;
namespace ProjectExtensions.Azure.ServiceBus {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/BusConfiguration.cs b/src/ProjectExtensions.Azure.ServiceBus/BusConfiguration.cs
index e027b88..9fd69ad 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/BusConfiguration.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/BusConfiguration.cs
@@ -1,16 +1,14 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
+using Microsoft.Practices.TransientFaultHandling;
+using ProjectExtensions.Azure.ServiceBus.AzureServiceBusFactories;
using ProjectExtensions.Azure.ServiceBus.Container;
-using ProjectExtensions.Azure.ServiceBus.Serialization;
-using Microsoft.Practices.TransientFaultHandling;
+using ProjectExtensions.Azure.ServiceBus.Factories;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
using ProjectExtensions.Azure.ServiceBus.Receiver;
using ProjectExtensions.Azure.ServiceBus.Sender;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
-using ProjectExtensions.Azure.ServiceBus.AzureServiceBusFactories;
-using ProjectExtensions.Azure.ServiceBus.Factories;
+using ProjectExtensions.Azure.ServiceBus.Serialization;
+using System;
+using System.Collections.Generic;
+using System.Reflection;
namespace ProjectExtensions.Azure.ServiceBus {
@@ -19,7 +17,7 @@ namespace ProjectExtensions.Azure.ServiceBus {
///
public class BusConfiguration : IBusConfiguration {
static readonly BusConfiguration configuration = new BusConfiguration();
-
+
IAzureBusContainer container;
List registeredAssemblies = new List();
List registeredSubscribers = new List();
@@ -41,8 +39,7 @@ private BusConfiguration() {
/// Gets the singleton instance
///
public static IBusConfiguration Instance {
- get
- {
+ get {
return configuration;
}
}
@@ -68,7 +65,7 @@ public IAzureBusContainer Container {
return container;
}
set {
- if (container != null) {
+ if (container != null) {
throw new NotSupportedException("The container can only be set once.");
}
Guard.ArgumentNotNull(value, "Container");
@@ -76,7 +73,7 @@ public IAzureBusContainer Container {
}
}
-
+
///
/// DefaultSerializer
///
@@ -203,7 +200,7 @@ public void Configure() {
container.Register(typeof(IServiceBusSerializer), typeof(JsonServiceBusSerializer));
}
container.Build();
-
+
//Set the Bus property so that the receiver will register the end points
this.Bus = container.Bus;
this.Bus.Initialize();
diff --git a/src/ProjectExtensions.Azure.ServiceBus/BusConfigurationBuilder.cs b/src/ProjectExtensions.Azure.ServiceBus/BusConfigurationBuilder.cs
index ea76f63..0fd278c 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/BusConfigurationBuilder.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/BusConfigurationBuilder.cs
@@ -1,13 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
+using Microsoft.Practices.TransientFaultHandling;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
using ProjectExtensions.Azure.ServiceBus.Serialization;
+using System;
using System.Configuration;
-using Microsoft.Practices.TransientFaultHandling;
-using ProjectExtensions.Azure.ServiceBus.Helpers;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using System.Reflection;
namespace ProjectExtensions.Azure.ServiceBus {
@@ -106,7 +102,7 @@ public BusConfigurationBuilder ReadFromConfigFile() {
throw new ArgumentNullException("ServiceBusNamespace", "The ServiceBusNamespace must be set.");
}
configuration.ServiceBusNamespace = setting;
-
+
setting = ConfigurationManager.AppSettings["ServiceBusTopic"];
if (!string.IsNullOrWhiteSpace(setting)) {
configuration.TopicName = setting;
diff --git a/src/ProjectExtensions.Azure.ServiceBus/CloudEnvironment.cs b/src/ProjectExtensions.Azure.ServiceBus/CloudEnvironment.cs
index 8d8cd1e..e674cf6 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/CloudEnvironment.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/CloudEnvironment.cs
@@ -1,23 +1,20 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Web;
+using ProjectExtensions.Azure.ServiceBus;
namespace ProjectExtensions.Azure.ServiceBus {
static class CloudEnvironment {
-
+
///
/// Ensures that the HttpContext object is safe to use in the given context and returns an object that rolls the HttpContext object back to its original state.
///
/// An object that needs to be explicitly disposed so that HttpContext can return back to its original state.
public static IDisposable EnsureSafeHttpContext() {
- HttpContext oldHttpContext = HttpContext.Current;
- HttpContext.Current = null;
+ var oldHttpContext = HttpContextHelper.Current;
+ //HttpContextHelper.Current = null;
return new AnonymousDisposable(() => {
- HttpContext.Current = oldHttpContext;
+ //HttpContextHelper.Current = oldHttpContext;
});
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Container/AzureBusContainerBase.cs b/src/ProjectExtensions.Azure.ServiceBus/Container/AzureBusContainerBase.cs
index b1f0224..0dfb602 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Container/AzureBusContainerBase.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Container/AzureBusContainerBase.cs
@@ -1,11 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Serialization;
+using ProjectExtensions.Azure.ServiceBus.Serialization;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.Container {
-
+
///
/// Base class for all Containers.
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Container/IAzureBusContainer.cs b/src/ProjectExtensions.Azure.ServiceBus/Container/IAzureBusContainer.cs
index 3af3ff5..7a5398b 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Container/IAzureBusContainer.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Container/IAzureBusContainer.cs
@@ -1,8 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Serialization;
+using ProjectExtensions.Azure.ServiceBus.Serialization;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.Container {
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Exceptions/TopicDeletedException.cs b/src/ProjectExtensions.Azure.ServiceBus/Exceptions/TopicDeletedException.cs
index ff74e91..a7c3ddb 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Exceptions/TopicDeletedException.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Exceptions/TopicDeletedException.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
namespace ProjectExtensions.Azure.ServiceBus.Exceptions {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/ExtensionMethods.cs b/src/ProjectExtensions.Azure.ServiceBus/ExtensionMethods.cs
index d6c3d5f..4315209 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/ExtensionMethods.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/ExtensionMethods.cs
@@ -1,8 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using NLog;
+using NLog;
+using System;
namespace ProjectExtensions.Azure.ServiceBus {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Factories/GenericServiceBusConfigurationFactory.cs b/src/ProjectExtensions.Azure.ServiceBus/Factories/GenericServiceBusConfigurationFactory.cs
index e7d4fc0..496df0e 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Factories/GenericServiceBusConfigurationFactory.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Factories/GenericServiceBusConfigurationFactory.cs
@@ -1,11 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using Microsoft.Practices.TransientFaultHandling;
using ProjectExtensions.Azure.ServiceBus.Interfaces;
-using Microsoft.Practices.TransientFaultHandling;
-using Microsoft.ServiceBus;
-using Microsoft.ServiceBus.Messaging;
namespace ProjectExtensions.Azure.ServiceBus.Factories {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Helpers/BusHelper.cs b/src/ProjectExtensions.Azure.ServiceBus/Helpers/BusHelper.cs
index 7265732..7fce761 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Helpers/BusHelper.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Helpers/BusHelper.cs
@@ -1,9 +1,6 @@
-using System;
-using System.Collections.Generic;
+using Microsoft.Practices.TransientFaultHandling;
+using System;
using System.Linq;
-using System.Text;
-using Microsoft.Practices.TransientFaultHandling;
-using NLog;
namespace ProjectExtensions.Azure.ServiceBus.Helpers {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Helpers/MD5Helper.cs b/src/ProjectExtensions.Azure.ServiceBus/Helpers/MD5Helper.cs
index ac5b203..333fd02 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Helpers/MD5Helper.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Helpers/MD5Helper.cs
@@ -1,11 +1,9 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Security.Cryptography;
+using System.Text;
namespace ProjectExtensions.Azure.ServiceBus.Helpers {
-
+
class MD5Helper {
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Helpers/ReflectionHelper.cs b/src/ProjectExtensions.Azure.ServiceBus/Helpers/ReflectionHelper.cs
index 6a48e9e..bf56d73 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Helpers/ReflectionHelper.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Helpers/ReflectionHelper.cs
@@ -1,9 +1,6 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
using System.Linq.Expressions;
+using System.Reflection;
namespace ProjectExtensions.Azure.ServiceBus.Helpers {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/HttpContextHelper.cs b/src/ProjectExtensions.Azure.ServiceBus/HttpContextHelper.cs
new file mode 100644
index 0000000..ac6784a
--- /dev/null
+++ b/src/ProjectExtensions.Azure.ServiceBus/HttpContextHelper.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Diagnostics;
+
+#if NET || NETCOREAPP
+using Microsoft.AspNetCore.Http;
+#else
+using System.Web;
+#endif
+
+namespace ProjectExtensions.Azure.ServiceBus
+{
+ ///
+ /// Temporary helper class for retrieving the current . This temporary
+ /// workaround should be removed in the future and should be retrieved
+ /// from the current controller, middleware, or page instead.
+#if NET || NETCOREAPP
+ ///
+ /// If working in another component, the current can be retrieved from an
+ /// retrieved via dependency injection.
+#endif
+ ///
+ internal static class HttpContextHelper
+ {
+ private const string Message = "Prefer accessing HttpContext via injection";
+
+ ///
+ /// Gets the current . Returns null if there is no current .
+ ///
+#if NET || NETCOREAPP
+#if NET5_0_OR_GREATER
+ [Obsolete(Message, error: false, DiagnosticId = "HttpContextCurrent", UrlFormat = "https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-context")]
+#else
+ [Obsolete(Message, error: false)]
+#endif
+ public static HttpContext Current => HttpContextAccessor.HttpContext;
+
+ private static readonly HttpContextAccessor HttpContextAccessor = new HttpContextAccessor();
+#else
+#pragma warning disable UA0005 // Do not use HttpContext.Current
+ [Obsolete(Message, error: false)]
+ public static HttpContext Current => HttpContext.Current;
+#pragma warning restore UA0005 // Do not use HttpContext.Current
+#endif
+ }
+}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/IBrokeredMessage.cs b/src/ProjectExtensions.Azure.ServiceBus/IBrokeredMessage.cs
index 2c8e05a..e909c26 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/IBrokeredMessage.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/IBrokeredMessage.cs
@@ -1,9 +1,7 @@
-using System;
+//DO NOT Change the namespace.
+using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-//DO NOT Change the namespace.
namespace ProjectExtensions.Azure.ServiceBus {
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/IBus.cs b/src/ProjectExtensions.Azure.ServiceBus/IBus.cs
index 420851b..7ef09aa 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/IBus.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/IBus.cs
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Reflection;
//DO NOT Change the namespace.
diff --git a/src/ProjectExtensions.Azure.ServiceBus/IBusConfiguration.cs b/src/ProjectExtensions.Azure.ServiceBus/IBusConfiguration.cs
index 3f32c25..10b9533 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/IBusConfiguration.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/IBusConfiguration.cs
@@ -1,8 +1,8 @@
-using System;
+using ProjectExtensions.Azure.ServiceBus.Container;
+using ProjectExtensions.Azure.ServiceBus.Serialization;
+using System;
using System.Collections.Generic;
using System.Reflection;
-using ProjectExtensions.Azure.ServiceBus.Container;
-using ProjectExtensions.Azure.ServiceBus.Serialization;
//DO NOT Change the namespace.
namespace ProjectExtensions.Azure.ServiceBus {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/IMessageHandler.cs b/src/ProjectExtensions.Azure.ServiceBus/IMessageHandler.cs
index bcd6e2c..990bc05 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/IMessageHandler.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/IMessageHandler.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-//DO NOT Change the namespace.
+//DO NOT Change the namespace.
namespace ProjectExtensions.Azure.ServiceBus {
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/IMessageSentResult.cs b/src/ProjectExtensions.Azure.ServiceBus/IMessageSentResult.cs
index 7db911e..42a3654 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/IMessageSentResult.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/IMessageSentResult.cs
@@ -1,6 +1,6 @@
-using System;
+//DO NOT Change the namespace.
+using System;
-//DO NOT Change the namespace.
namespace ProjectExtensions.Azure.ServiceBus {
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/IReceivedMessage.cs b/src/ProjectExtensions.Azure.ServiceBus/IReceivedMessage.cs
index 0f133ba..dcca16b 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/IReceivedMessage.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/IReceivedMessage.cs
@@ -1,11 +1,8 @@
-using System;
+//DO NOT Change the namespace.
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-//DO NOT Change the namespace.
namespace ProjectExtensions.Azure.ServiceBus {
-
+
///
/// Main interface that is passed to the Handlers.
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IMessagingFactory.cs b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IMessagingFactory.cs
index 68d0600..ff51a42 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IMessagingFactory.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IMessagingFactory.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus.Messaging;
-using Microsoft.ServiceBus;
+using Microsoft.ServiceBus.Messaging;
using System.IO;
namespace ProjectExtensions.Azure.ServiceBus.Interfaces {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/INamespaceManager.cs b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/INamespaceManager.cs
index efb5890..4979f2a 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/INamespaceManager.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/INamespaceManager.cs
@@ -1,12 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus.Messaging;
-using Microsoft.ServiceBus;
+using Microsoft.ServiceBus.Messaging;
namespace ProjectExtensions.Azure.ServiceBus.Interfaces {
-
+
///
/// Interface used to abstract the NamespaceManager
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusConfigurationFactory.cs b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusConfigurationFactory.cs
index 0f94fab..53e5b3b 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusConfigurationFactory.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusConfigurationFactory.cs
@@ -1,13 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus;
-using Microsoft.ServiceBus.Messaging;
-using System.IO;
+namespace ProjectExtensions.Azure.ServiceBus.Interfaces {
-namespace ProjectExtensions.Azure.ServiceBus.Interfaces {
-
interface IServiceBusConfigurationFactory {
IMessagingFactory MessageFactory {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusSetupConfiguration.cs b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusSetupConfiguration.cs
index 17aa50a..d5fc352 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusSetupConfiguration.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusSetupConfiguration.cs
@@ -1,9 +1,7 @@
-using System;
+using ProjectExtensions.Azure.ServiceBus.Serialization;
+using System;
using System.Collections.Generic;
-using System.Linq;
using System.Reflection;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Serialization;
namespace ProjectExtensions.Azure.ServiceBus.Interfaces {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusTokenProvider.cs b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusTokenProvider.cs
index 2c7f6ea..0a773a3 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusTokenProvider.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/IServiceBusTokenProvider.cs
@@ -1,13 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus;
+using Microsoft.ServiceBus;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.Interfaces {
-
+
interface IServiceBusTokenProvider {
-
+
TokenProvider TokenProvider {
get;
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/ISubscriptionClient.cs b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/ISubscriptionClient.cs
index 5af0a40..0904789 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/ISubscriptionClient.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/ISubscriptionClient.cs
@@ -1,11 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus.Messaging;
+using Microsoft.ServiceBus.Messaging;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.Interfaces {
-
+
interface ISubscriptionClient {
int PrefetchCount {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/ITopicClient.cs b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/ITopicClient.cs
index 0508f3c..0e864e8 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Interfaces/ITopicClient.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Interfaces/ITopicClient.cs
@@ -1,14 +1,9 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus.Messaging;
namespace ProjectExtensions.Azure.ServiceBus.Interfaces {
-
+
interface ITopicClient {
- IAsyncResult BeginSend(IBrokeredMessage message, AsyncCallback callback, object state);
- void EndSend(IAsyncResult result);
+ void Send(IBrokeredMessage message);
void Close();
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/MessageHandlerConfigurationAttribute.cs b/src/ProjectExtensions.Azure.ServiceBus/MessageHandlerConfigurationAttribute.cs
index 46a0930..f1c9b5f 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/MessageHandlerConfigurationAttribute.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/MessageHandlerConfigurationAttribute.cs
@@ -1,9 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus.Messaging;
-using Microsoft.Practices.TransientFaultHandling;
+using System;
+using System.Text;
namespace ProjectExtensions.Azure.ServiceBus {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/ProjectExtensions.Azure.ServiceBus.csproj b/src/ProjectExtensions.Azure.ServiceBus/ProjectExtensions.Azure.ServiceBus.csproj
index 663c59c..1205032 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/ProjectExtensions.Azure.ServiceBus.csproj
+++ b/src/ProjectExtensions.Azure.ServiceBus/ProjectExtensions.Azure.ServiceBus.csproj
@@ -1,177 +1,58 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
Library
- Properties
- ProjectExtensions.Azure.ServiceBus
- ProjectExtensions.Azure.ServiceBus
- v4.0
- 512
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
bin\Debug\ProjectExtensions.Azure.ServiceBus.XML
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
bin\Release\ProjectExtensions.Azure.ServiceBus.XML
+
+ net7.0
+ false
+
-
- False
- ..\..\packages\WindowsAzure.ServiceBus.2.4.9.0\lib\net40-full\Microsoft.ServiceBus.dll
-
-
- False
- ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
..\..\lib\Microsoft.WindowsAzure.StorageClient.dll
-
- False
- ..\..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll
-
-
- False
- ..\..\packages\NLog.2.1.0\lib\net40\NLog.dll
-
-
-
-
-
-
-
-
-
-
-
-
Properties\CommonAssemblyInfo.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
Designer
-
-
-
-
-
-
-
-
-
+
+
+
+ 3.2.3
+
+
+ 13.0.3
+
+
+ 5.1.3
+
+
+
+ 6.2.2
+
+
+
+
+
+
+ all
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureBusReceiver.cs b/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureBusReceiver.cs
index c6fa5b0..36aee05 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureBusReceiver.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureBusReceiver.cs
@@ -1,19 +1,13 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus.Messaging;
-using System.Threading.Tasks;
-using System.IO;
-using ProjectExtensions.Azure.ServiceBus.Serialization;
-using System.Threading;
-using System.Reflection;
using NLog;
-using Microsoft.Practices.TransientFaultHandling;
-using System.Net;
using ProjectExtensions.Azure.ServiceBus.Interfaces;
-using ProjectExtensions.Azure.ServiceBus.Wrappers;
+using ProjectExtensions.Azure.ServiceBus.Serialization;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
namespace ProjectExtensions.Azure.ServiceBus.Receiver {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureBusReceiverState.cs b/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureBusReceiverState.cs
index ab3da6c..df076ce 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureBusReceiverState.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureBusReceiverState.cs
@@ -1,10 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
using System.Threading;
-using Microsoft.ServiceBus.Messaging;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
namespace ProjectExtensions.Azure.ServiceBus.Receiver {
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureReceiveState.cs b/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureReceiveState.cs
index 4d24171..803f90a 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureReceiveState.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureReceiveState.cs
@@ -1,14 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-using Microsoft.ServiceBus.Messaging;
+using Microsoft.Practices.TransientFaultHandling;
using ProjectExtensions.Azure.ServiceBus.Serialization;
-using Microsoft.Practices.TransientFaultHandling;
+using System.Reflection;
namespace ProjectExtensions.Azure.ServiceBus.Receiver {
-
+
class AzureReceiveState {
public AzureReceiveState(AzureBusReceiverState data, MethodInfo methodInfo,
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureReceiverHelper.cs b/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureReceiverHelper.cs
index a7b81d5..73f61f9 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureReceiverHelper.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Receiver/AzureReceiverHelper.cs
@@ -1,17 +1,13 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Practices.TransientFaultHandling;
+using Microsoft.Practices.TransientFaultHandling;
+using Microsoft.ServiceBus.Messaging;
using NLog;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
using ProjectExtensions.Azure.ServiceBus.Serialization;
-using System.Threading;
-using Microsoft.ServiceBus.Messaging;
+using System;
+using System.Collections.Generic;
using System.IO;
-using System.Diagnostics;
-using ProjectExtensions.Azure.ServiceBus.TransientFaultHandling.ServiceBus;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
using System.Reflection;
+using System.Threading;
namespace ProjectExtensions.Azure.ServiceBus.Receiver {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Receiver/ReceivedMessage.cs b/src/ProjectExtensions.Azure.ServiceBus/Receiver/ReceivedMessage.cs
index 3f95cfa..73e3661 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Receiver/ReceivedMessage.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Receiver/ReceivedMessage.cs
@@ -1,9 +1,5 @@
-using System;
+using Microsoft.Practices.TransientFaultHandling;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus.Messaging;
-using Microsoft.Practices.TransientFaultHandling;
namespace ProjectExtensions.Azure.ServiceBus.Receiver {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Sender/AzureBusSender.cs b/src/ProjectExtensions.Azure.ServiceBus/Sender/AzureBusSender.cs
index 77e09e0..265f605 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Sender/AzureBusSender.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Sender/AzureBusSender.cs
@@ -1,16 +1,13 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus.Messaging;
-using ProjectExtensions.Azure.ServiceBus.Serialization;
using NLog;
-using Microsoft.Practices.TransientFaultHandling;
+using ProjectExtensions.Azure.ServiceBus.Exceptions;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using ProjectExtensions.Azure.ServiceBus.Serialization;
using System.Diagnostics;
+using System.Collections.Generic;
+using System;
using System.Threading;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
-using ProjectExtensions.Azure.ServiceBus.Exceptions;
namespace ProjectExtensions.Azure.ServiceBus.Sender {
@@ -121,7 +118,7 @@ public void SendAsync(T methodObj, object methodState, Action(T methodObj, object methodState, Action {
try {
+ //NOTE: Refactor to no longer call the end action
failureException = null; //we may retry so we must null out the error.
// Complete the asynchronous operation. This may throw an exception that will be handled internally by the retry policy.
- logger.Debug("sendAction EndSend Begin Type={0} Serializer={1} MessageId={2}", obj.GetType().FullName, serializer.GetType().FullName, message.MessageId);
- defaultClient.EndSend(ar);
- logger.Debug("sendAction EndSend End Type={0} Serializer={1} MessageId={2}", obj.GetType().FullName, serializer.GetType().FullName, message.MessageId);
+ //logger.Debug("sendAction EndSend Begin Type={0} Serializer={1} MessageId={2}", obj.GetType().FullName, serializer.GetType().FullName, message.MessageId);
+ //defaultClient.EndSend(ar);
+ //logger.Debug("sendAction EndSend End Type={0} Serializer={1} MessageId={2}", obj.GetType().FullName, serializer.GetType().FullName, message.MessageId);
}
catch (Exception ex) {
failureException = ex;
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Sender/MessageSentResult.cs b/src/ProjectExtensions.Azure.ServiceBus/Sender/MessageSentResult.cs
index 27daa23..161e5cf 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Sender/MessageSentResult.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Sender/MessageSentResult.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
namespace ProjectExtensions.Azure.ServiceBus.Sender {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Serialization/IServiceBusSerializer.cs b/src/ProjectExtensions.Azure.ServiceBus/Serialization/IServiceBusSerializer.cs
index 9c13f1a..3f0e4e2 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Serialization/IServiceBusSerializer.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Serialization/IServiceBusSerializer.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.IO;
namespace ProjectExtensions.Azure.ServiceBus.Serialization {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Serialization/JsonServiceBusSerializer.cs b/src/ProjectExtensions.Azure.ServiceBus/Serialization/JsonServiceBusSerializer.cs
index a1224b6..f720f72 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Serialization/JsonServiceBusSerializer.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Serialization/JsonServiceBusSerializer.cs
@@ -1,10 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using Newtonsoft.Json;
+using Newtonsoft.Json;
using NLog;
+using System;
+using System.IO;
namespace ProjectExtensions.Azure.ServiceBus.Serialization {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Serialization/ServiceBusSerializerBase.cs b/src/ProjectExtensions.Azure.ServiceBus/Serialization/ServiceBusSerializerBase.cs
index fc2af10..1f1f537 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Serialization/ServiceBusSerializerBase.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Serialization/ServiceBusSerializerBase.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.IO;
namespace ProjectExtensions.Azure.ServiceBus.Serialization {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Serialization/XmlServiceBusSerializer.cs b/src/ProjectExtensions.Azure.ServiceBus/Serialization/XmlServiceBusSerializer.cs
index 92f4bad..70daba1 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Serialization/XmlServiceBusSerializer.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Serialization/XmlServiceBusSerializer.cs
@@ -1,11 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using NLog;
+using NLog;
+using System;
using System.IO;
-using System.Xml.Serialization;
using System.Xml;
+using System.Xml.Serialization;
namespace ProjectExtensions.Azure.ServiceBus.Serialization {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/ServiceBusEnpointData.cs b/src/ProjectExtensions.Azure.ServiceBus/ServiceBusEnpointData.cs
index 5531742..713e9b2 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/ServiceBusEnpointData.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/ServiceBusEnpointData.cs
@@ -1,10 +1,8 @@
-using System;
-using System.Collections.Generic;
+using ProjectExtensions.Azure.ServiceBus.Helpers;
+using ProjectExtensions.Azure.ServiceBus.Receiver;
+using System;
using System.Linq;
-using System.Text;
using System.Reflection;
-using ProjectExtensions.Azure.ServiceBus.Helpers;
-using ProjectExtensions.Azure.ServiceBus.Receiver;
namespace ProjectExtensions.Azure.ServiceBus {
@@ -41,7 +39,7 @@ public string SubscriptionName {
public string SubscriptionNameDebug {
get {
if (_subscriptionNameDebug == null) {
- _subscriptionNameDebug = DeclaredType.FullName.Replace("`1", "") + "<" + MessageType.FullName + "> - " + SubscriptionName;
+ _subscriptionNameDebug = DeclaredType.FullName.Replace("`1", "") + "<" + MessageType.FullName + "> - " + SubscriptionName;
}
return _subscriptionNameDebug;
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/ServiceBusSetupConfiguration.cs b/src/ProjectExtensions.Azure.ServiceBus/ServiceBusSetupConfiguration.cs
index 6f8e013..cc4abef 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/ServiceBusSetupConfiguration.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/ServiceBusSetupConfiguration.cs
@@ -1,10 +1,8 @@
-using System;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using ProjectExtensions.Azure.ServiceBus.Serialization;
+using System;
using System.Collections.Generic;
-using System.Linq;
using System.Reflection;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
-using ProjectExtensions.Azure.ServiceBus.Serialization;
namespace ProjectExtensions.Azure.ServiceBus {
@@ -82,7 +80,7 @@ public string ServiceBusIssuerKey {
///
public string ServicePath {
get;
- set;
+ set;
}
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/SingletonMessageHandlerAttribute.cs b/src/ProjectExtensions.Azure.ServiceBus/SingletonMessageHandlerAttribute.cs
index 2ed5cbe..7c37ece 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/SingletonMessageHandlerAttribute.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/SingletonMessageHandlerAttribute.cs
@@ -6,5 +6,5 @@ namespace ProjectExtensions.Azure.ServiceBus {
///
[Obsolete("Use the Singleton property of MessageHandlerConfiguration", true)]
[AttributeUsage(AttributeTargets.Class)]
- public class SingletonMessageHandlerAttribute : Attribute {}
+ public class SingletonMessageHandlerAttribute : Attribute { }
}
\ No newline at end of file
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/ExponentialBackoff.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/ExponentialBackoff.cs
index e0149f3..a6ed8b1 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/ExponentialBackoff.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/ExponentialBackoff.cs
@@ -9,15 +9,13 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.TransientFaultHandling
-{
+namespace Microsoft.Practices.TransientFaultHandling {
using System;
///
/// A retry strategy with back-off parameters for calculating the exponential delay between retries.
///
- public class ExponentialBackoff : RetryStrategy
- {
+ public class ExponentialBackoff : RetryStrategy {
private readonly int retryCount;
private readonly TimeSpan minBackoff;
private readonly TimeSpan maxBackoff;
@@ -27,8 +25,7 @@ public class ExponentialBackoff : RetryStrategy
/// Initializes a new instance of the class.
///
public ExponentialBackoff()
- : this(DefaultClientRetryCount, DefaultMinBackoff, DefaultMaxBackoff, DefaultClientBackoff)
- {
+ : this(DefaultClientRetryCount, DefaultMinBackoff, DefaultMaxBackoff, DefaultClientBackoff) {
}
///
@@ -39,8 +36,7 @@ public ExponentialBackoff()
/// The maximum back-off time.
/// The value that will be used for calculating a random delta in the exponential delay between retries.
public ExponentialBackoff(int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
- : this(null, retryCount, minBackoff, maxBackoff, deltaBackoff, DefaultFirstFastRetry)
- {
+ : this(null, retryCount, minBackoff, maxBackoff, deltaBackoff, DefaultFirstFastRetry) {
}
///
@@ -52,8 +48,7 @@ public ExponentialBackoff(int retryCount, TimeSpan minBackoff, TimeSpan maxBacko
/// The maximum back-off time.
/// The value that will be used for calculating a random delta in the exponential delay between retries.
public ExponentialBackoff(string name, int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
- : this(name, retryCount, minBackoff, maxBackoff, deltaBackoff, DefaultFirstFastRetry)
- {
+ : this(name, retryCount, minBackoff, maxBackoff, deltaBackoff, DefaultFirstFastRetry) {
}
///
@@ -69,8 +64,7 @@ public ExponentialBackoff(string name, int retryCount, TimeSpan minBackoff, Time
/// whereas the subsequent retries will remain subject to retry interval.
///
public ExponentialBackoff(string name, int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff, bool firstFastRetry)
- : base(name, firstFastRetry)
- {
+ : base(name, firstFastRetry) {
Guard.ArgumentNotNegativeValue(retryCount, "retryCount");
Guard.ArgumentNotNegativeValue(minBackoff.Ticks, "minBackoff");
Guard.ArgumentNotNegativeValue(maxBackoff.Ticks, "maxBackoff");
@@ -87,12 +81,9 @@ public ExponentialBackoff(string name, int retryCount, TimeSpan minBackoff, Time
/// Returns the corresponding ShouldRetry delegate.
///
/// The ShouldRetry delegate.
- public override ShouldRetry GetShouldRetry()
- {
- return delegate(int currentRetryCount, Exception lastException, out TimeSpan retryInterval)
- {
- if (currentRetryCount < this.retryCount)
- {
+ public override ShouldRetry GetShouldRetry() {
+ return delegate (int currentRetryCount, Exception lastException, out TimeSpan retryInterval) {
+ if (currentRetryCount < this.retryCount) {
var random = new Random();
var delta = (int)((Math.Pow(2.0, currentRetryCount) - 1.0) * random.Next((int)(this.deltaBackoff.TotalMilliseconds * 0.8), (int)(this.deltaBackoff.TotalMilliseconds * 1.2)));
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/FixedInterval.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/FixedInterval.cs
index bc12af3..f943611 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/FixedInterval.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/FixedInterval.cs
@@ -9,15 +9,13 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.TransientFaultHandling
-{
+namespace Microsoft.Practices.TransientFaultHandling {
using System;
///
/// A RetryPolicy with a specified number of retry attempts and a default fixed time interval between retries.
///
- public class FixedInterval : RetryStrategy
- {
+ public class FixedInterval : RetryStrategy {
private readonly int retryCount;
private readonly TimeSpan retryInterval;
@@ -25,8 +23,7 @@ public class FixedInterval : RetryStrategy
/// Initializes a new instance of the class.
///
public FixedInterval()
- : this(DefaultClientRetryCount)
- {
+ : this(DefaultClientRetryCount) {
}
///
@@ -34,8 +31,7 @@ public FixedInterval()
///
/// The number of retry attempts.
public FixedInterval(int retryCount)
- : this(retryCount, DefaultRetryInterval)
- {
+ : this(retryCount, DefaultRetryInterval) {
}
///
@@ -44,8 +40,7 @@ public FixedInterval(int retryCount)
/// The number of retry attempts.
/// The time interval between retries.
public FixedInterval(int retryCount, TimeSpan retryInterval)
- : this(null, retryCount, retryInterval, DefaultFirstFastRetry)
- {
+ : this(null, retryCount, retryInterval, DefaultFirstFastRetry) {
}
///
@@ -55,8 +50,7 @@ public FixedInterval(int retryCount, TimeSpan retryInterval)
/// The number of retry attempts.
/// The time interval between retries.
public FixedInterval(string name, int retryCount, TimeSpan retryInterval)
- : this(name, retryCount, retryInterval, DefaultFirstFastRetry)
- {
+ : this(name, retryCount, retryInterval, DefaultFirstFastRetry) {
}
///
@@ -67,8 +61,7 @@ public FixedInterval(string name, int retryCount, TimeSpan retryInterval)
/// The time interval between retries.
/// a value indicating whether or not the very first retry attempt will be made immediately whereas the subsequent retries will remain subject to retry interval.
public FixedInterval(string name, int retryCount, TimeSpan retryInterval, bool firstFastRetry)
- : base(name, firstFastRetry)
- {
+ : base(name, firstFastRetry) {
Guard.ArgumentNotNegativeValue(retryCount, "retryCount");
Guard.ArgumentNotNegativeValue(retryInterval.Ticks, "retryInterval");
@@ -80,21 +73,16 @@ public FixedInterval(string name, int retryCount, TimeSpan retryInterval, bool f
/// Returns the corresponding ShouldRetry delegate.
///
/// The ShouldRetry delegate.
- public override ShouldRetry GetShouldRetry()
- {
- if (this.retryCount == 0)
- {
- return delegate(int currentRetryCount, Exception lastException, out TimeSpan interval)
- {
+ public override ShouldRetry GetShouldRetry() {
+ if (this.retryCount == 0) {
+ return delegate (int currentRetryCount, Exception lastException, out TimeSpan interval) {
interval = TimeSpan.Zero;
return false;
};
}
-
- return delegate(int currentRetryCount, Exception lastException, out TimeSpan interval)
- {
- if (currentRetryCount < this.retryCount)
- {
+
+ return delegate (int currentRetryCount, Exception lastException, out TimeSpan interval) {
+ if (currentRetryCount < this.retryCount) {
interval = this.retryInterval;
return true;
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/Guard.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/Guard.cs
index f9520c6..83c7396 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/Guard.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/Guard.cs
@@ -9,8 +9,7 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.TransientFaultHandling
-{
+namespace Microsoft.Practices.TransientFaultHandling {
#region Using statements
using System;
using System.Globalization;
@@ -21,8 +20,7 @@ namespace Microsoft.Practices.TransientFaultHandling
///
/// Implements the common guard methods.
///
- public static class Guard
- {
+ public static class Guard {
///
/// Checks a string argument to ensure it isn't null or empty.
///
@@ -30,12 +28,10 @@ public static class Guard
/// The name of the argument.
/// The return value should be ignored. It is intended to be used only when validating arguments during instance creation (e.g. when calling base constructor).
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated with method.")]
- public static bool ArgumentNotNullOrEmptyString(string argumentValue, string argumentName)
- {
+ public static bool ArgumentNotNullOrEmptyString(string argumentValue, string argumentName) {
ArgumentNotNull(argumentValue, argumentName);
- if (argumentValue.Length == 0)
- {
+ if (argumentValue.Length == 0) {
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionMessages.StringCannotBeEmpty, argumentName));
}
@@ -48,10 +44,8 @@ public static bool ArgumentNotNullOrEmptyString(string argumentValue, string arg
/// The argument value to check.
/// The name of the argument.
/// /// The return value should be ignored. It is intended to be used only when validating arguments during instance creation (e.g. when calling base constructor).
- public static bool ArgumentNotNull(object argumentValue, string argumentName)
- {
- if (argumentValue == null)
- {
+ public static bool ArgumentNotNull(object argumentValue, string argumentName) {
+ if (argumentValue == null) {
throw new ArgumentNullException(argumentName);
}
@@ -64,10 +58,8 @@ public static bool ArgumentNotNull(object argumentValue, string argumentName)
/// The type of the argument.
/// The value of the argument.
/// The name of the argument for diagnostic purposes.
- public static void ArgumentNotDefaultValue(T argumentValue, string argumentName)
- {
- if (!IsValueDefined(argumentValue))
- {
+ public static void ArgumentNotDefaultValue(T argumentValue, string argumentName) {
+ if (!IsValueDefined(argumentValue)) {
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionMessages.ArgumentCannotBeDefault, argumentName));
}
}
@@ -77,10 +69,8 @@ public static void ArgumentNotDefaultValue(T argumentValue, string argumentNa
///
/// The value of the argument.
/// The name of the argument for diagnostic purposes.
- public static void ArgumentNotZeroOrNegativeValue(int argumentValue, string argumentName)
- {
- if (argumentValue <= 0)
- {
+ public static void ArgumentNotZeroOrNegativeValue(int argumentValue, string argumentName) {
+ if (argumentValue <= 0) {
throw new ArgumentOutOfRangeException(argumentName, argumentValue, string.Format(CultureInfo.CurrentCulture, ExceptionMessages.ArgumentCannotBeZeroOrNegative, argumentName));
}
}
@@ -90,10 +80,8 @@ public static void ArgumentNotZeroOrNegativeValue(int argumentValue, string argu
///
/// The value of the argument.
/// The name of the argument for diagnostic purposes.
- public static void ArgumentNotNegativeValue(int argumentValue, string argumentName)
- {
- if (argumentValue < 0)
- {
+ public static void ArgumentNotNegativeValue(int argumentValue, string argumentName) {
+ if (argumentValue < 0) {
throw new ArgumentOutOfRangeException(argumentName, argumentValue, string.Format(CultureInfo.CurrentCulture, ExceptionMessages.ArgumentCannotBeNegative, argumentName));
}
}
@@ -103,10 +91,8 @@ public static void ArgumentNotNegativeValue(int argumentValue, string argumentNa
///
/// The value of the argument.
/// The name of the argument for diagnostic purposes.
- public static void ArgumentNotNegativeValue(long argumentValue, string argumentName)
- {
- if (argumentValue < 0)
- {
+ public static void ArgumentNotNegativeValue(long argumentValue, string argumentName) {
+ if (argumentValue < 0) {
throw new ArgumentOutOfRangeException(argumentName, argumentValue, string.Format(CultureInfo.CurrentCulture, ExceptionMessages.ArgumentCannotBeNegative, argumentName));
}
}
@@ -117,10 +103,8 @@ public static void ArgumentNotNegativeValue(long argumentValue, string argumentN
/// The value of the argument.
/// The ceiling value of the argument.
/// The name of the argument for diagnostic purposes.
- public static void ArgumentNotGreaterThan(double argumentValue, double ceilingValue, string argumentName)
- {
- if (argumentValue > ceilingValue)
- {
+ public static void ArgumentNotGreaterThan(double argumentValue, double ceilingValue, string argumentName) {
+ if (argumentValue > ceilingValue) {
throw new ArgumentOutOfRangeException(argumentName, argumentValue, string.Format(CultureInfo.CurrentCulture, ExceptionMessages.ArgumentCannotBeGreaterThanBaseline, argumentName, ceilingValue));
}
}
@@ -131,10 +115,8 @@ public static void ArgumentNotGreaterThan(double argumentValue, double ceilingVa
/// The Enum type the value should correspond to.
/// The value to check for.
/// The name of the argument holding the value.
- public static void EnumValueIsDefined(Type enumType, object value, string argumentName)
- {
- if (Enum.IsDefined(enumType, value) == false)
- {
+ public static void EnumValueIsDefined(Type enumType, object value, string argumentName) {
+ if (Enum.IsDefined(enumType, value) == false) {
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionMessages.InvalidEnumValue, argumentName, enumType));
}
}
@@ -146,10 +128,8 @@ public static void EnumValueIsDefined(Type enumType, object value, string argume
/// The argument type.
/// The type it must be assignable from.
/// The argument name.
- public static void TypeIsAssignableFromType(Type assignee, Type providedType, string argumentName)
- {
- if (providedType != null && !providedType.IsAssignableFrom(assignee))
- {
+ public static void TypeIsAssignableFromType(Type assignee, Type providedType, string argumentName) {
+ if (providedType != null && !providedType.IsAssignableFrom(assignee)) {
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionMessages.TypeNotCompatible, assignee, providedType), argumentName);
}
}
@@ -161,14 +141,11 @@ public static void TypeIsAssignableFromType(Type assignee, Type providedType, st
/// The type of the value to be checked.
/// The value to be checked.
/// True if the value is defined or false if it's null or represents a default value for its type.
- private static bool IsValueDefined(T value)
- {
- if (typeof(T).IsValueType)
- {
+ private static bool IsValueDefined(T value) {
+ if (typeof(T).IsValueType) {
return !value.Equals(default(T));
}
- else
- {
+ else {
return value != null;
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/ITransientErrorDetectionStrategy.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/ITransientErrorDetectionStrategy.cs
index 31cb1e1..f0f8185 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/ITransientErrorDetectionStrategy.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/ITransientErrorDetectionStrategy.cs
@@ -9,8 +9,7 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.TransientFaultHandling
-{
+namespace Microsoft.Practices.TransientFaultHandling {
#region Using statements
using System;
#endregion
@@ -18,8 +17,7 @@ namespace Microsoft.Practices.TransientFaultHandling
///
/// Defines an interface which must be implemented by custom components responsible for detecting specific transient conditions.
///
- public interface ITransientErrorDetectionStrategy
- {
+ public interface ITransientErrorDetectionStrategy {
///
/// Determines whether the specified exception represents a transient failure that can be compensated by a retry.
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/Incremental.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/Incremental.cs
index f0cb96f..c77963d 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/Incremental.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/Incremental.cs
@@ -9,15 +9,13 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.TransientFaultHandling
-{
+namespace Microsoft.Practices.TransientFaultHandling {
using System;
///
/// A RetryPolicy with a specified number of retry attempts and an incremental time interval between retries.
///
- public class Incremental : RetryStrategy
- {
+ public class Incremental : RetryStrategy {
private readonly int retryCount;
private readonly TimeSpan initialInterval;
private readonly TimeSpan increment;
@@ -26,8 +24,7 @@ public class Incremental : RetryStrategy
/// Initializes a new instance of the class.
///
public Incremental()
- : this(DefaultClientRetryCount, DefaultRetryInterval, DefaultRetryIncrement)
- {
+ : this(DefaultClientRetryCount, DefaultRetryInterval, DefaultRetryIncrement) {
}
///
@@ -37,8 +34,7 @@ public Incremental()
/// The initial interval that will apply for the first retry.
/// The incremental time value that will be used for calculating the progressive delay between retries.
public Incremental(int retryCount, TimeSpan initialInterval, TimeSpan increment)
- : this(null, retryCount, initialInterval, increment)
- {
+ : this(null, retryCount, initialInterval, increment) {
}
///
@@ -49,8 +45,7 @@ public Incremental(int retryCount, TimeSpan initialInterval, TimeSpan increment)
/// The initial interval that will apply for the first retry.
/// The incremental time value that will be used for calculating the progressive delay between retries.
public Incremental(string name, int retryCount, TimeSpan initialInterval, TimeSpan increment)
- : this(name, retryCount, initialInterval, increment, DefaultFirstFastRetry)
- {
+ : this(name, retryCount, initialInterval, increment, DefaultFirstFastRetry) {
}
///
@@ -62,8 +57,7 @@ public Incremental(string name, int retryCount, TimeSpan initialInterval, TimeSp
/// The incremental time value that will be used for calculating the progressive delay between retries.
/// a value indicating whether or not the very first retry attempt will be made immediately whereas the subsequent retries will remain subject to retry interval.
public Incremental(string name, int retryCount, TimeSpan initialInterval, TimeSpan increment, bool firstFastRetry)
- : base(name, firstFastRetry)
- {
+ : base(name, firstFastRetry) {
Guard.ArgumentNotNegativeValue(retryCount, "retryCount");
Guard.ArgumentNotNegativeValue(initialInterval.Ticks, "initialInterval");
Guard.ArgumentNotNegativeValue(increment.Ticks, "increment");
@@ -77,12 +71,9 @@ public Incremental(string name, int retryCount, TimeSpan initialInterval, TimeSp
/// Returns the corresponding ShouldRetry delegate.
///
/// The ShouldRetry delegate.
- public override ShouldRetry GetShouldRetry()
- {
- return delegate(int currentRetryCount, Exception lastException, out TimeSpan retryInterval)
- {
- if (currentRetryCount < this.retryCount)
- {
+ public override ShouldRetry GetShouldRetry() {
+ return delegate (int currentRetryCount, Exception lastException, out TimeSpan retryInterval) {
+ if (currentRetryCount < this.retryCount) {
retryInterval = TimeSpan.FromMilliseconds(this.initialInterval.TotalMilliseconds + (this.increment.TotalMilliseconds * currentRetryCount));
return true;
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryLimitExceededException.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryLimitExceededException.cs
index c6ffa9f..650e0e4 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryLimitExceededException.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryLimitExceededException.cs
@@ -9,8 +9,7 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.TransientFaultHandling
-{
+namespace Microsoft.Practices.TransientFaultHandling {
#region Using references
using System;
using System.Runtime.Serialization;
@@ -22,14 +21,12 @@ namespace Microsoft.Practices.TransientFaultHandling
/// exception to notify the retry policy that no further retry attempts are required.
///
[Serializable]
- public sealed class RetryLimitExceededException : Exception
- {
+ public sealed class RetryLimitExceededException : Exception {
///
/// Initializes a new instance of the class with a default error message.
///
public RetryLimitExceededException()
- : this(ExceptionMessages.RetryLimitExceeded)
- {
+ : this(ExceptionMessages.RetryLimitExceeded) {
}
///
@@ -37,8 +34,7 @@ public RetryLimitExceededException()
///
/// The message that describes the error.
public RetryLimitExceededException(string message)
- : base(message)
- {
+ : base(message) {
}
///
@@ -47,8 +43,7 @@ public RetryLimitExceededException(string message)
///
/// The exception that is the cause of the current exception.
public RetryLimitExceededException(Exception innerException)
- : base(innerException != null ? innerException.Message : ExceptionMessages.RetryLimitExceeded, innerException)
- {
+ : base(innerException != null ? innerException.Message : ExceptionMessages.RetryLimitExceeded, innerException) {
}
///
@@ -57,8 +52,7 @@ public RetryLimitExceededException(Exception innerException)
/// The message that describes the error.
/// The exception that is the cause of the current exception.
public RetryLimitExceededException(string message, Exception innerException)
- : base(message, innerException)
- {
+ : base(message, innerException) {
}
///
@@ -69,8 +63,7 @@ public RetryLimitExceededException(string message, Exception innerException)
/// The parameter is null.
/// The class name is null or is zero (0).
private RetryLimitExceededException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
+ : base(info, context) {
}
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryPolicy.Generic.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryPolicy.Generic.cs
index 920710b..b8092e3 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryPolicy.Generic.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryPolicy.Generic.cs
@@ -9,23 +9,20 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.TransientFaultHandling
-{
+namespace Microsoft.Practices.TransientFaultHandling {
using System;
///
/// Provides a generic version of the class.
///
/// The type implementing the interface that is responsible for detecting transient conditions.
- public class RetryPolicy : RetryPolicy where T : ITransientErrorDetectionStrategy, new()
- {
+ public class RetryPolicy : RetryPolicy where T : ITransientErrorDetectionStrategy, new() {
///
/// Initializes a new instance of the RetryPolicy class with the specified number of retry attempts and parameters defining the progressive delay between retries.
///
/// The retry strategy to use for this retry policy.
public RetryPolicy(RetryStrategy retryStrategy)
- : base(new T(), retryStrategy)
- {
+ : base(new T(), retryStrategy) {
}
///
@@ -33,8 +30,7 @@ public RetryPolicy(RetryStrategy retryStrategy)
///
/// The number of retry attempts.
public RetryPolicy(int retryCount)
- : base(new T(), retryCount)
- {
+ : base(new T(), retryCount) {
}
///
@@ -43,8 +39,7 @@ public RetryPolicy(int retryCount)
/// The number of retry attempts.
/// The interval between retries.
public RetryPolicy(int retryCount, TimeSpan retryInterval)
- : base(new T(), retryCount, retryInterval)
- {
+ : base(new T(), retryCount, retryInterval) {
}
///
@@ -55,8 +50,7 @@ public RetryPolicy(int retryCount, TimeSpan retryInterval)
/// The maximum back-off time.
/// The time value that will be used for calculating a random delta in the exponential delay between retries.
public RetryPolicy(int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
- : base(new T(), retryCount, minBackoff, maxBackoff, deltaBackoff)
- {
+ : base(new T(), retryCount, minBackoff, maxBackoff, deltaBackoff) {
}
///
@@ -66,8 +60,7 @@ public RetryPolicy(int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, Tim
/// The initial interval that will apply for the first retry.
/// The incremental time value that will be used for calculating the progressive delay between retries.
public RetryPolicy(int retryCount, TimeSpan initialInterval, TimeSpan increment)
- : base(new T(), retryCount, initialInterval, increment)
- {
+ : base(new T(), retryCount, initialInterval, increment) {
}
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryPolicy.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryPolicy.cs
index 79dc9b3..0f25acd 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryPolicy.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryPolicy.cs
@@ -9,16 +9,14 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.TransientFaultHandling
-{
+namespace Microsoft.Practices.TransientFaultHandling {
using System;
using System.Threading;
///
/// Provides the base implementation of the retry mechanism for unreliable actions and transient conditions.
///
- public class RetryPolicy
- {
+ public class RetryPolicy {
///
/// Returns a default policy that does no retries, it just invokes action exactly once.
///
@@ -47,15 +45,13 @@ public class RetryPolicy
///
/// The that is responsible for detecting transient conditions.
/// The retry strategy to use for this retry policy.
- public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, RetryStrategy retryStrategy)
- {
+ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, RetryStrategy retryStrategy) {
Guard.ArgumentNotNull(errorDetectionStrategy, "errorDetectionStrategy");
Guard.ArgumentNotNull(retryStrategy, "retryPolicy");
this.ErrorDetectionStrategy = errorDetectionStrategy;
- if (errorDetectionStrategy == null)
- {
+ if (errorDetectionStrategy == null) {
throw new InvalidOperationException("The error detection strategy type must implement the ITransientErrorDetectionStrategy interface.");
}
@@ -68,8 +64,7 @@ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, Retr
/// The that is responsible for detecting transient conditions.
/// The number of retry attempts.
public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int retryCount)
- : this(errorDetectionStrategy, new FixedInterval(retryCount))
- {
+ : this(errorDetectionStrategy, new FixedInterval(retryCount)) {
}
///
@@ -79,8 +74,7 @@ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int
/// The number of retry attempts.
/// The interval between retries.
public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int retryCount, TimeSpan retryInterval)
- : this(errorDetectionStrategy, new FixedInterval(retryCount, retryInterval))
- {
+ : this(errorDetectionStrategy, new FixedInterval(retryCount, retryInterval)) {
}
///
@@ -92,8 +86,7 @@ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int
/// The maximum back-off time.
/// The time value that will be used for calculating a random delta in the exponential delay between retries.
public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
- : this(errorDetectionStrategy, new ExponentialBackoff(retryCount, minBackoff, maxBackoff, deltaBackoff))
- {
+ : this(errorDetectionStrategy, new ExponentialBackoff(retryCount, minBackoff, maxBackoff, deltaBackoff)) {
}
///
@@ -104,8 +97,7 @@ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int
/// The initial interval that will apply for the first retry.
/// The incremental time value that will be used for calculating the progressive delay between retries.
public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int retryCount, TimeSpan initialInterval, TimeSpan increment)
- : this(errorDetectionStrategy, new Incremental(retryCount, initialInterval, increment))
- {
+ : this(errorDetectionStrategy, new Incremental(retryCount, initialInterval, increment)) {
}
///
@@ -127,8 +119,7 @@ public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int
/// Repetitively executes the specified action while it satisfies the current retry policy.
///
/// A delegate representing the executable action which doesn't return any results.
- public virtual void ExecuteAction(Action action)
- {
+ public virtual void ExecuteAction(Action action) {
Guard.ArgumentNotNull(action, "action");
this.ExecuteAction(() => { action(); return default(object); });
@@ -141,8 +132,7 @@ public virtual void ExecuteAction(Action action)
/// A delegate representing the executable action which returns the result of type R.
/// The result from the action.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated with Guard")]
- public virtual TResult ExecuteAction(Func func)
- {
+ public virtual TResult ExecuteAction(Func func) {
Guard.ArgumentNotNull(func, "func");
int retryCount = 0;
@@ -151,49 +141,41 @@ public virtual TResult ExecuteAction(Func func)
var shouldRetry = this.RetryStrategy.GetShouldRetry();
- for (;;)
+ for (; ; )
{
lastError = null;
- try
- {
+ try {
return func();
}
- catch (RetryLimitExceededException limitExceededEx)
- {
+ catch (RetryLimitExceededException limitExceededEx) {
// The user code can throw a RetryLimitExceededException to force the exit from the retry loop.
// The RetryLimitExceeded exception can have an inner exception attached to it. This is the exception
// which we will have to throw up the stack so that callers can handle it.
- if (limitExceededEx.InnerException != null)
- {
+ if (limitExceededEx.InnerException != null) {
throw limitExceededEx.InnerException;
}
- else
- {
+ else {
return default(TResult);
}
}
- catch (Exception ex)
- {
+ catch (Exception ex) {
lastError = ex;
- if (!(this.ErrorDetectionStrategy.IsTransient(lastError) && shouldRetry(retryCount++, lastError, out delay)))
- {
+ if (!(this.ErrorDetectionStrategy.IsTransient(lastError) && shouldRetry(retryCount++, lastError, out delay))) {
throw;
}
}
// Perform an extra check in the delay interval. Should prevent from accidentally ending up with the value of -1 that will block a thread indefinitely.
// In addition, any other negative numbers will cause an ArgumentOutOfRangeException fault that will be thrown by Thread.Sleep.
- if (delay.TotalMilliseconds < 0)
- {
+ if (delay.TotalMilliseconds < 0) {
delay = TimeSpan.Zero;
}
this.OnRetrying(retryCount, lastError, delay);
- if (retryCount > 1 || !this.RetryStrategy.FastFirstRetry)
- {
+ if (retryCount > 1 || !this.RetryStrategy.FastFirstRetry) {
Thread.Sleep(delay);
}
}
@@ -206,8 +188,7 @@ public virtual TResult ExecuteAction(Func func)
/// The end method of the async pattern.
/// The action to perform when the async operation is done.
/// The fault handler delegate that will be triggered if the operation cannot be successfully invoked despite retry attempts.
- public virtual void ExecuteAction(Action beginAction, Action endAction, Action successHandler, Action faultHandler)
- {
+ public virtual void ExecuteAction(Action beginAction, Action endAction, Action successHandler, Action faultHandler) {
Guard.ArgumentNotNull(endAction, "endAction");
successHandler = successHandler ?? (() => { });
@@ -227,8 +208,7 @@ public virtual void ExecuteAction(Action beginAction, ActionThe action to perform when the async operation is done.
/// The fault handler delegate that will be triggered if the operation cannot be successfully invoked despite retry attempts.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Needs to catch all exceptions to test them.")]
- public virtual void ExecuteAction(Action beginAction, Func endAction, Action successHandler, Action faultHandler)
- {
+ public virtual void ExecuteAction(Action beginAction, Func endAction, Action successHandler, Action faultHandler) {
Guard.ArgumentNotNull(beginAction, "beginAction");
Guard.ArgumentNotNull(endAction, "endAction");
successHandler = successHandler ?? (_ => { });
@@ -242,12 +222,10 @@ public virtual void ExecuteAction(Action beginAction, Fu
// Configure a custom callback delegate that invokes the end operation and the success handler if the operation succeedes
endInvoke =
- ar =>
- {
+ ar => {
var result = default(TResult);
- if (executeWithRetry(() => result = endAction(ar)))
- {
+ if (executeWithRetry(() => result = endAction(ar))) {
successHandler(result);
}
};
@@ -256,42 +234,33 @@ public virtual void ExecuteAction(Action beginAction, Fu
// If the action succeeds (i.e. does not throw an exception) it returns true.
// If the action throws, it analizes it for retries. If a retry is required, it restarts the async operation; otherwise, it invokes the fault handler.
executeWithRetry =
- a =>
- {
- try
- {
+ a => {
+ try {
// Invoke the callback delegate which can throw an exception if the main async operation has completed with a fault.
a();
return true;
}
- catch (Exception ex)
- {
+ catch (Exception ex) {
// Capture the original exception for analysis.
var lastError = ex;
// Handling of RetryLimitExceededException needs to be done separately. This exception type indicates the application's intent to exit from the retry loop.
- if (lastError is RetryLimitExceededException)
- {
- if (lastError.InnerException != null)
- {
+ if (lastError is RetryLimitExceededException) {
+ if (lastError.InnerException != null) {
faultHandler(lastError.InnerException);
}
- else
- {
+ else {
faultHandler(lastError);
}
}
- else
- {
+ else {
var delay = TimeSpan.Zero;
// Check if we should continue retrying on this exception. If not, invoke the fault handler so that user code can take control.
- if (!(this.ErrorDetectionStrategy.IsTransient(lastError) && shouldRetry(retryCount++, lastError, out delay)))
- {
+ if (!(this.ErrorDetectionStrategy.IsTransient(lastError) && shouldRetry(retryCount++, lastError, out delay))) {
faultHandler(lastError);
}
- else
- {
+ else {
// Perform an extra check in the delay interval. Should prevent from accidentally ending up with the value of -1 that will block a thread indefinitely.
// In addition, any other negative numbers will cause an ArgumentOutOfRangeException fault that will be thrown by Thread.Sleep.
@@ -303,8 +272,7 @@ public virtual void ExecuteAction(Action beginAction, Fu
this.OnRetrying(retryCount, lastError, delay);
// Sleep for the defined interval before repetitively executing the main async operation.
- if (retryCount > 1 || !this.RetryStrategy.FastFirstRetry)
- {
+ if (retryCount > 1 || !this.RetryStrategy.FastFirstRetry) {
Thread.Sleep(delay);
}
@@ -326,10 +294,8 @@ public virtual void ExecuteAction(Action beginAction, Fu
/// The current retry attempt count.
/// The exception which caused the retry conditions to occur.
/// The delay indicating how long the current thread will be suspended for before the next iteration will be invoked.
- protected virtual void OnRetrying(int retryCount, Exception lastError, TimeSpan delay)
- {
- if (this.Retrying != null)
- {
+ protected virtual void OnRetrying(int retryCount, Exception lastError, TimeSpan delay) {
+ if (this.Retrying != null) {
this.Retrying(this, new RetryingEventArgs(retryCount, delay, lastError));
}
}
@@ -339,15 +305,13 @@ protected virtual void OnRetrying(int retryCount, Exception lastError, TimeSpan
/// Implements a strategy that ignores any transient errors.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Instantiated through generics")]
- private sealed class TransientErrorIgnoreStrategy : ITransientErrorDetectionStrategy
- {
+ private sealed class TransientErrorIgnoreStrategy : ITransientErrorDetectionStrategy {
///
/// Always return false.
///
/// The exception.
/// Returns false.
- public bool IsTransient(Exception ex)
- {
+ public bool IsTransient(Exception ex) {
return false;
}
}
@@ -356,15 +320,13 @@ public bool IsTransient(Exception ex)
/// Implements a strategy that treats all exceptions as transient errors.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Instantiated through generics")]
- private sealed class TransientErrorCatchAllStrategy : ITransientErrorDetectionStrategy
- {
+ private sealed class TransientErrorCatchAllStrategy : ITransientErrorDetectionStrategy {
///
/// Always return true.
///
/// The exception.
/// Returns true.
- public bool IsTransient(Exception ex)
- {
+ public bool IsTransient(Exception ex) {
return true;
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryStrategy.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryStrategy.cs
index 92b7cc4..afa0a22 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryStrategy.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryStrategy.cs
@@ -9,8 +9,7 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.TransientFaultHandling
-{
+namespace Microsoft.Practices.TransientFaultHandling {
using System;
///
@@ -25,8 +24,7 @@ namespace Microsoft.Practices.TransientFaultHandling
///
/// Base Abstract RetryStrategy
///
- public abstract class RetryStrategy
- {
+ public abstract class RetryStrategy {
#region Public members
///
/// The default number of retry attempts.
@@ -105,8 +103,7 @@ public abstract class RetryStrategy
/// The name of the retry strategy.
/// a value indicating whether or not the very first retry attempt will be made immediately
/// whereas the subsequent retries will remain subject to retry interval.
- protected RetryStrategy(string name, bool firstFastRetry)
- {
+ protected RetryStrategy(string name, bool firstFastRetry) {
this.Name = name;
this.FastFirstRetry = firstFastRetry;
}
@@ -116,7 +113,7 @@ protected RetryStrategy(string name, bool firstFastRetry)
/// whereas the subsequent retries will remain subject to retry interval.
///
public bool FastFirstRetry { get; set; }
-
+
///
/// Gets the name of the retry strategy.
///
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryingEventArgs.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryingEventArgs.cs
index 45b11bc..e713352 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryingEventArgs.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling.Core/RetryingEventArgs.cs
@@ -9,23 +9,20 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.TransientFaultHandling
-{
+namespace Microsoft.Practices.TransientFaultHandling {
using System;
///
/// Contains information required for the event.
///
- public class RetryingEventArgs : EventArgs
- {
+ public class RetryingEventArgs : EventArgs {
///
/// Initializes a new instance of the class.
///
/// The current retry attempt count.
/// The delay indicating how long the current thread will be suspended for before the next iteration will be invoked.
/// The exception which caused the retry conditions to occur.
- public RetryingEventArgs(int currentRetryCount, TimeSpan delay, Exception lastException)
- {
+ public RetryingEventArgs(int currentRetryCount, TimeSpan delay, Exception lastException) {
Guard.ArgumentNotNull(lastException, "lastException");
this.CurrentRetryCount = currentRetryCount;
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/AzureStorage/AzureStorageExtensions.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/AzureStorage/AzureStorageExtensions.cs
index d61826b..5d2da23 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/AzureStorage/AzureStorageExtensions.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/AzureStorage/AzureStorageExtensions.cs
@@ -9,38 +9,32 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.AzureStorage
-{
+namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.AzureStorage {
using Microsoft.Practices.TransientFaultHandling;
///
/// Extends the RetryStrategy to allow using the retry strategies from the Transient Fault Handling Application Block with Windows Azure Store.
///
- public static class AzureStorageExtensions
- {
+ public static class AzureStorageExtensions {
///
/// Wrap a Transient Fault Handling Application Block retry strategy into a Microsoft.WindowsAzure.StorageClient.RetryPolicy.
///
/// The Transient Fault Handling Application Block retry strategy to wrap.
/// Returns a wrapped Transient Fault Handling Application Block retry strategy into a Microsoft.WindowsAzure.StorageClient.RetryPolicy.
- public static Microsoft.WindowsAzure.StorageClient.RetryPolicy AsAzureStorageClientRetryPolicy(this RetryStrategy retryStrategy)
- {
+ public static Microsoft.WindowsAzure.StorageClient.RetryPolicy AsAzureStorageClientRetryPolicy(this RetryStrategy retryStrategy) {
Guard.ArgumentNotNull(retryStrategy, "retryStrategy");
return () => new ShouldRetryWrapper(retryStrategy.GetShouldRetry()).ShouldRetry;
}
- private class ShouldRetryWrapper
- {
+ private class ShouldRetryWrapper {
private readonly ShouldRetry shouldRetry;
- public ShouldRetryWrapper(ShouldRetry shouldRetry)
- {
+ public ShouldRetryWrapper(ShouldRetry shouldRetry) {
this.shouldRetry = shouldRetry;
}
- public bool ShouldRetry(int retryCount, System.Exception lastException, out System.TimeSpan delay)
- {
+ public bool ShouldRetry(int retryCount, System.Exception lastException, out System.TimeSpan delay) {
return this.shouldRetry(retryCount, lastException, out delay);
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/AzureStorage/StorageTransientErrorDetectionStrategy.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/AzureStorage/StorageTransientErrorDetectionStrategy.cs
index 55b0621..d6b61d3 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/AzureStorage/StorageTransientErrorDetectionStrategy.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/AzureStorage/StorageTransientErrorDetectionStrategy.cs
@@ -9,83 +9,68 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.AzureStorage
-{
+namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.AzureStorage {
#region Using references
+ using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Properties;
+ using Microsoft.Practices.TransientFaultHandling;
+ using Microsoft.WindowsAzure.StorageClient;
using System;
- using System.Data.Services.Client;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
- using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Properties;
- using Microsoft.Practices.TransientFaultHandling;
- using Microsoft.WindowsAzure.StorageClient;
-
#endregion
///
/// Provides the transient error detection logic that can recognize transient faults when dealing with Windows Azure storage services.
///
- public class StorageTransientErrorDetectionStrategy : ITransientErrorDetectionStrategy
- {
+ public class StorageTransientErrorDetectionStrategy : ITransientErrorDetectionStrategy {
///
/// Determines whether the specified exception represents a transient failure that can be compensated by a retry.
///
/// The exception object to be verified.
/// True if the specified exception is considered as transient, otherwise false.
- public bool IsTransient(Exception ex)
- {
+ public bool IsTransient(Exception ex) {
return ex != null && (CheckIsTransient(ex) || (ex.InnerException != null && CheckIsTransient(ex.InnerException)));
}
- private static bool CheckIsTransient(Exception ex)
- {
+ private static bool CheckIsTransient(Exception ex) {
var webException = ex as WebException;
- if (webException != null && (webException.Status == WebExceptionStatus.ProtocolError || webException.Status == WebExceptionStatus.ConnectionClosed))
- {
+ if (webException != null && (webException.Status == WebExceptionStatus.ProtocolError || webException.Status == WebExceptionStatus.ConnectionClosed)) {
return true;
}
- var dataServiceException = ex as DataServiceRequestException;
+ //var dataServiceException = ex as DataServiceRequestException;
- if (dataServiceException != null)
- {
- if (IsErrorStringMatch(GetErrorCode(dataServiceException), StorageErrorCodeStrings.InternalError, StorageErrorCodeStrings.ServerBusy, StorageErrorCodeStrings.OperationTimedOut, TableErrorCodeStrings.TableServerOutOfMemory))
- {
- return true;
- }
- }
+ //if (dataServiceException != null) {
+ // if (IsErrorStringMatch(GetErrorCode(dataServiceException), StorageErrorCodeStrings.InternalError, StorageErrorCodeStrings.ServerBusy, StorageErrorCodeStrings.OperationTimedOut, TableErrorCodeStrings.TableServerOutOfMemory)) {
+ // return true;
+ // }
+ //}
var serverException = ex as StorageServerException;
- if (serverException != null)
- {
- if (IsErrorCodeMatch(serverException, StorageErrorCode.ServiceInternalError, StorageErrorCode.ServiceTimeout))
- {
+ if (serverException != null) {
+ if (IsErrorCodeMatch(serverException, StorageErrorCode.ServiceInternalError, StorageErrorCode.ServiceTimeout)) {
return true;
}
- if (IsErrorStringMatch(serverException, StorageErrorCodeStrings.InternalError, StorageErrorCodeStrings.ServerBusy, StorageErrorCodeStrings.OperationTimedOut))
- {
+ if (IsErrorStringMatch(serverException, StorageErrorCodeStrings.InternalError, StorageErrorCodeStrings.ServerBusy, StorageErrorCodeStrings.OperationTimedOut)) {
return true;
}
}
var storageException = ex as StorageClientException;
- if (storageException != null)
- {
- if (IsErrorStringMatch(storageException, StorageErrorCodeStrings.InternalError, StorageErrorCodeStrings.ServerBusy, TableErrorCodeStrings.TableServerOutOfMemory))
- {
+ if (storageException != null) {
+ if (IsErrorStringMatch(storageException, StorageErrorCodeStrings.InternalError, StorageErrorCodeStrings.ServerBusy, TableErrorCodeStrings.TableServerOutOfMemory)) {
return true;
}
}
- if (ex is TimeoutException)
- {
+ if (ex is TimeoutException) {
return true;
}
@@ -93,33 +78,27 @@ private static bool CheckIsTransient(Exception ex)
}
#region Private members
- private static string GetErrorCode(DataServiceRequestException ex)
- {
- if (ex != null && ex.InnerException != null)
- {
- var regEx = new Regex(Resources.GetErrorCodeRegEx, RegexOptions.IgnoreCase);
- var match = regEx.Match(ex.InnerException.Message);
-
- return match.Groups[1].Value;
- }
- else
- {
- return null;
- }
- }
-
- private static bool IsErrorCodeMatch(StorageException ex, params StorageErrorCode[] codes)
- {
+ //private static string GetErrorCode(DataServiceRequestException ex) {
+ // if (ex != null && ex.InnerException != null) {
+ // var regEx = new Regex(Resources.GetErrorCodeRegEx, RegexOptions.IgnoreCase);
+ // var match = regEx.Match(ex.InnerException.Message);
+
+ // return match.Groups[1].Value;
+ // }
+ // else {
+ // return null;
+ // }
+ //}
+
+ private static bool IsErrorCodeMatch(StorageException ex, params StorageErrorCode[] codes) {
return ex != null && codes.Contains(ex.ErrorCode);
}
- private static bool IsErrorStringMatch(StorageException ex, params string[] errorStrings)
- {
+ private static bool IsErrorStringMatch(StorageException ex, params string[] errorStrings) {
return ex != null && ex.ExtendedErrorInformation != null && errorStrings.Contains(ex.ExtendedErrorInformation.ErrorCode);
}
- private static bool IsErrorStringMatch(string exceptionErrorString, params string[] errorStrings)
- {
+ private static bool IsErrorStringMatch(string exceptionErrorString, params string[] errorStrings) {
return errorStrings.Contains(exceptionErrorString);
}
#endregion
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/Configuration/TransientFaultHandlingDesignTime.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/Configuration/TransientFaultHandlingDesignTime.cs
index 3c45460..9abb79f 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/Configuration/TransientFaultHandlingDesignTime.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/Configuration/TransientFaultHandlingDesignTime.cs
@@ -9,12 +9,9 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration
-{
- internal static class TransientFaultHandlingDesignTime
- {
- public static class ViewModelTypeNames
- {
+namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration {
+ internal static class TransientFaultHandlingDesignTime {
+ public static class ViewModelTypeNames {
public const string RetryPolicyConfigurationSettingsViewModel =
"Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration.Design.ViewModel.RetryPolicyConfigurationSettingsViewModel, Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration";
@@ -25,16 +22,14 @@ public static class ViewModelTypeNames
"Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration.Design.ViewModel.TimeSpanElementConfigurationProperty, Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration";
}
- public static class CommandTypeNames
- {
+ public static class CommandTypeNames {
public const string WellKnownRetryStrategyElementCollectionCommand = "Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration.Design.ViewModel.Commands.WellKnownRetryStrategyElementCollectionCommand, Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration";
}
///
/// Class that contains common editor types used by the designtime.
///
- public static class EditorTypes
- {
+ public static class EditorTypes {
///
/// Type name of the TimeSpanEditor class, declared in the Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling.Configuration Assembly.
///
@@ -46,8 +41,7 @@ public static class EditorTypes
public const string FrameworkElement = "System.Windows.FrameworkElement, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
}
- public static class ValidatorTypes
- {
+ public static class ValidatorTypes {
public const string NameValueCollectionValidator = "Microsoft.Practices.EnterpriseLibrary.Configuration.Design.Validation.NameValueCollectionValidator, Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime";
public const string ExponentialBackoffValidator = "Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration.Validation.ExponentialBackoffValidator, Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration";
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ExtensionMethods.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ExtensionMethods.cs
index 9da3ac2..90b49b2 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ExtensionMethods.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ExtensionMethods.cs
@@ -9,17 +9,15 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling
-{
+namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling {
#region Using statements
using System;
#endregion
-
+
///
/// Provides a set of extension methods that supplement various .NET Framework classes with value-add functionality.
///
- public static class ExtensionMethods
- {
+ public static class ExtensionMethods {
///
/// Verifies whether the specified exception object contains an inner exception of the specified type .
///
@@ -27,15 +25,12 @@ public static class ExtensionMethods
/// The exception object to be inspected.
/// The instance of the inner exception of the specified type if found, otherwise null.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
- public static Exception GetInnerException(this Exception ex)
- {
+ public static Exception GetInnerException(this Exception ex) {
var innerEx = ex != null ? ex.InnerException : null;
var exceptionType = typeof(T);
- while (innerEx != null)
- {
- if (exceptionType.IsAssignableFrom(innerEx.GetType()))
- {
+ while (innerEx != null) {
+ if (exceptionType.IsAssignableFrom(innerEx.GetType())) {
return innerEx;
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryManager.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryManager.cs
index 37e2fda..fcc6d63 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryManager.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryManager.cs
@@ -9,8 +9,7 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling
-{
+namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling {
using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.AzureStorage;
using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.ServiceBus;
using Microsoft.Practices.TransientFaultHandling;
@@ -18,8 +17,7 @@ namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandl
///
/// Non-static entry point to the retry functionality.
///
- public abstract class RetryManager
- {
+ public abstract class RetryManager {
///
/// Initializes a new instance of the class.
///
@@ -29,8 +27,7 @@ public abstract class RetryManager
/// The default retry strategy for Windows Azure Service Bus.
/// The default retry strategy for Windows Azure Caching.
/// The default retry strategy for Windows Azure Storage.
- protected RetryManager(string defaultRetryStrategyName, string defaultSqlConnectionStrategyName, string defaultSqlCommandStrategyName, string defaultAzureServiceBusStrategyName, string defaultAzureCachingStrategyName, string defaultAzureStorageStrategyName)
- {
+ protected RetryManager(string defaultRetryStrategyName, string defaultSqlConnectionStrategyName, string defaultSqlCommandStrategyName, string defaultAzureServiceBusStrategyName, string defaultAzureCachingStrategyName, string defaultAzureStorageStrategyName) {
this.DefaultRetryStrategyName = defaultRetryStrategyName;
this.DefaultSqlConnectionStrategyName = string.IsNullOrEmpty(defaultSqlConnectionStrategyName) ? this.DefaultRetryStrategyName : defaultSqlConnectionStrategyName;
this.DefaultSqlCommandStrategyName = string.IsNullOrEmpty(defaultSqlCommandStrategyName) ? this.DefaultRetryStrategyName : defaultSqlCommandStrategyName;
@@ -75,8 +72,7 @@ protected RetryManager(string defaultRetryStrategyName, string defaultSqlConnect
/// The type implementing the interface that is responsible for detecting transient conditions.
/// A new retry policy with the specified error detection strategy and the default retry strategy defined in the config
public virtual RetryPolicy GetRetryPolicy()
- where T : ITransientErrorDetectionStrategy, new()
- {
+ where T : ITransientErrorDetectionStrategy, new() {
return new RetryPolicy(this.GetRetryStrategy());
}
@@ -87,8 +83,7 @@ public virtual RetryPolicy GetRetryPolicy()
/// The retry strategy name as defined in the config.
/// A new retry policy with the specified error detection strategy and the default retry strategy defined in the config
public virtual RetryPolicy GetRetryPolicy(string retryStrategyName)
- where T : ITransientErrorDetectionStrategy, new()
- {
+ where T : ITransientErrorDetectionStrategy, new() {
return new RetryPolicy(this.GetRetryStrategy(retryStrategyName));
}
@@ -96,8 +91,7 @@ public virtual RetryPolicy GetRetryPolicy(string retryStrategyName)
/// Return the default retry strategy defined in the config.
///
/// The retry strategy matching the default strategy.
- public RetryStrategy GetRetryStrategy()
- {
+ public RetryStrategy GetRetryStrategy() {
return this.GetRetryStrategy(this.DefaultRetryStrategyName);
}
@@ -113,8 +107,7 @@ public RetryStrategy GetRetryStrategy()
///
/// The default SqlConnection retry strategy (or the default strategy if no default could be found).
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "As designed")]
- public RetryStrategy GetDefaultSqlConnectionRetryStrategy()
- {
+ public RetryStrategy GetDefaultSqlConnectionRetryStrategy() {
return GetRetryStrategy(this.DefaultSqlConnectionStrategyName);
}
@@ -123,8 +116,7 @@ public RetryStrategy GetDefaultSqlConnectionRetryStrategy()
///
/// The default SqlConnection retry strategy (or the default strategy if no default could be found).
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "As designed")]
- public virtual RetryStrategy GetDefaultSqlCommandRetryStrategy()
- {
+ public virtual RetryStrategy GetDefaultSqlCommandRetryStrategy() {
return GetRetryStrategy(this.DefaultSqlCommandStrategyName);
}
@@ -133,8 +125,7 @@ public virtual RetryStrategy GetDefaultSqlCommandRetryStrategy()
///
/// The default Windows Azure Service retry strategy (or the default strategy if no default could be found).
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "As designed")]
- public virtual RetryStrategy GetDefaultAzureServiceBusRetryStrategy()
- {
+ public virtual RetryStrategy GetDefaultAzureServiceBusRetryStrategy() {
return GetRetryStrategy(this.DefaultAzureServiceBusStrategyName);
}
@@ -143,8 +134,7 @@ public virtual RetryStrategy GetDefaultAzureServiceBusRetryStrategy()
///
/// The default Windows Azure Caching retry strategy (or the default strategy if no default could be found).
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "As designed")]
- public virtual RetryStrategy GetDefaultAzureCachingRetryStrategy()
- {
+ public virtual RetryStrategy GetDefaultAzureCachingRetryStrategy() {
return GetRetryStrategy(this.DefaultAzureCachingStrategyName);
}
@@ -153,8 +143,7 @@ public virtual RetryStrategy GetDefaultAzureCachingRetryStrategy()
///
/// The default Windows Azure Storage retry strategy (or the default strategy if no default could be found).
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "As designed")]
- public virtual RetryStrategy GetDefaultAzureStorageRetryStrategy()
- {
+ public virtual RetryStrategy GetDefaultAzureStorageRetryStrategy() {
return GetRetryStrategy(this.DefaultAzureStorageStrategyName);
}
@@ -163,8 +152,7 @@ public virtual RetryStrategy GetDefaultAzureStorageRetryStrategy()
///
/// The retry policy for Windows Azure Service Bus with the corresponding default strategy (or the default strategy if no retry strategy definition assigned to Windows Azure Service Bus was found).
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "As designed")]
- public virtual RetryPolicy GetDefaultAzureServiceBusRetryPolicy()
- {
+ public virtual RetryPolicy GetDefaultAzureServiceBusRetryPolicy() {
return new RetryPolicy(this.GetDefaultAzureServiceBusRetryStrategy());
}
@@ -173,8 +161,7 @@ public virtual RetryPolicy GetDefaultAzureServiceBusRetryPolicy()
///
/// The retry policy for Windows Azure Storage with the corresponding default strategy (or the default strategy if no retry strategy definition assigned to Windows Azure Storage was found).
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "As designed")]
- public virtual RetryPolicy GetDefaultAzureStorageRetryPolicy()
- {
+ public virtual RetryPolicy GetDefaultAzureStorageRetryPolicy() {
return new RetryPolicy(this.GetDefaultAzureStorageRetryStrategy());
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryManagerImpl.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryManagerImpl.cs
index 2c3fb1c..e4b023a 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryManagerImpl.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryManagerImpl.cs
@@ -9,22 +9,20 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling
-{
+namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling {
+ using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Properties;
+ using Microsoft.Practices.TransientFaultHandling;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
- using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Properties;
- using Microsoft.Practices.TransientFaultHandling;
///
/// Non-static entry point to the retry functionality.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "As designed. Naming convention.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Impl", Justification = "As designed. Naming convention.")]
- public class RetryManagerImpl : RetryManager
- {
+ public class RetryManagerImpl : RetryManager {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Used as read only")]
private readonly IDictionary retryStrategies;
@@ -39,8 +37,7 @@ public class RetryManagerImpl : RetryManager
/// The default retry strategy for Windows Azure Caching.
/// The default retry strategy for Windows Azure Storage.
public RetryManagerImpl(IEnumerable retryStrategies, string defaultRetryStrategyName, string defaultSqlConnectionStrategyName, string defaultSqlCommandStrategyName, string defaultAzureServiceBusStrategyName, string defaultAzureCachingStrategyName, string defaultAzureStorageStrategyName)
- : this(retryStrategies.ToDictionary(p => p.Name), defaultRetryStrategyName, defaultSqlConnectionStrategyName, defaultSqlCommandStrategyName, defaultAzureServiceBusStrategyName, defaultAzureCachingStrategyName, defaultAzureStorageStrategyName)
- {
+ : this(retryStrategies.ToDictionary(p => p.Name), defaultRetryStrategyName, defaultSqlConnectionStrategyName, defaultSqlCommandStrategyName, defaultAzureServiceBusStrategyName, defaultAzureCachingStrategyName, defaultAzureStorageStrategyName) {
}
///
@@ -54,8 +51,7 @@ public RetryManagerImpl(IEnumerable retryStrategies, string defau
/// The default retry strategy for Windows Azure Caching.
/// The default retry strategy for Windows Azure Storage.
public RetryManagerImpl(IDictionary retryStrategies, string defaultRetryStrategyName, string defaultSqlConnectionStrategyName, string defaultSqlCommandStrategyName, string defaultAzureServiceBusStrategyName, string defaultAzureCachingStrategyName, string defaultAzureStorageStrategyName)
- : base(defaultRetryStrategyName, defaultSqlConnectionStrategyName, defaultSqlCommandStrategyName, defaultAzureServiceBusStrategyName, defaultAzureCachingStrategyName, defaultAzureStorageStrategyName)
- {
+ : base(defaultRetryStrategyName, defaultSqlConnectionStrategyName, defaultSqlCommandStrategyName, defaultAzureServiceBusStrategyName, defaultAzureCachingStrategyName, defaultAzureStorageStrategyName) {
this.retryStrategies = retryStrategies;
}
@@ -64,14 +60,12 @@ public RetryManagerImpl(IDictionary retryStrategies, stri
///
/// The retry Strategy Name.
/// The retry matching the specified name.
- public override RetryStrategy GetRetryStrategy(string retryStrategyName)
- {
+ public override RetryStrategy GetRetryStrategy(string retryStrategyName) {
Guard.ArgumentNotNullOrEmptyString(retryStrategyName, "retryStrategyName");
RetryStrategy retryStrategy;
- if (!this.retryStrategies.TryGetValue(retryStrategyName, out retryStrategy))
- {
+ if (!this.retryStrategies.TryGetValue(retryStrategyName, out retryStrategy)) {
throw new ArgumentOutOfRangeException(string.Format(CultureInfo.CurrentCulture, Resources.RetryStrategyNotFound, retryStrategyName));
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryPolicyException.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryPolicyException.cs
index e832496..ba740e9 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryPolicyException.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/RetryPolicyException.cs
@@ -9,8 +9,7 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling
-{
+namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling {
using System;
using System.Runtime.Serialization;
@@ -18,13 +17,11 @@ namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandl
/// Represents an error that occurs while using the Transient Fault Handling Application Block.
///
[Serializable]
- public class RetryPolicyException : Exception
- {
+ public class RetryPolicyException : Exception {
///
/// Initializes a new instance of the class.
///
- public RetryPolicyException()
- {
+ public RetryPolicyException() {
}
///
@@ -32,8 +29,7 @@ public RetryPolicyException()
///
/// The message that describes the error.
public RetryPolicyException(string message)
- : base(message)
- {
+ : base(message) {
}
///
@@ -42,8 +38,7 @@ public RetryPolicyException(string message)
///
/// The message that describes the error.
/// The inner exception reference.
- public RetryPolicyException(string message, Exception inner) : base(message, inner)
- {
+ public RetryPolicyException(string message, Exception inner) : base(message, inner) {
}
///
@@ -53,8 +48,7 @@ public RetryPolicyException(string message, Exception inner) : base(message, inn
/// The that contains contextual information about the source or destination.
protected RetryPolicyException(
SerializationInfo info,
- StreamingContext context) : base(info, context)
- {
+ StreamingContext context) : base(info, context) {
}
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ServiceBus/ServiceBusTransientErrorDetectionStrategy.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ServiceBus/ServiceBusTransientErrorDetectionStrategy.cs
index 42944f9..326713e 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ServiceBus/ServiceBusTransientErrorDetectionStrategy.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ServiceBus/ServiceBusTransientErrorDetectionStrategy.cs
@@ -9,8 +9,10 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
-namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.ServiceBus
-{
+namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.ServiceBus {
+ using Microsoft.Practices.TransientFaultHandling;
+ using Microsoft.ServiceBus;
+ using Microsoft.ServiceBus.Messaging;
using System;
using System.IdentityModel.Tokens;
using System.Net;
@@ -18,15 +20,11 @@ namespace Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandl
using System.Security;
using System.ServiceModel;
using System.Text.RegularExpressions;
- using Microsoft.Practices.TransientFaultHandling;
- using Microsoft.ServiceBus;
- using Microsoft.ServiceBus.Messaging;
///
/// Provides the transient error detection logic that can recognize transient faults when dealing with Windows Azure Service Bus.
///
- public class ServiceBusTransientErrorDetectionStrategy : ITransientErrorDetectionStrategy
- {
+ public class ServiceBusTransientErrorDetectionStrategy : ITransientErrorDetectionStrategy {
///
/// Provides a compiled regular expression used for extracting the error code from the message.
///
@@ -37,8 +35,7 @@ public class ServiceBusTransientErrorDetectionStrategy : ITransientErrorDetectio
///
/// The exception object to be verified.
/// True if the specified exception is considered as transient, otherwise false.
- public bool IsTransient(Exception ex)
- {
+ public bool IsTransient(Exception ex) {
return ex != null && (CheckIsTransientInternal(ex) || (ex.InnerException != null && CheckIsTransientInternal(ex.InnerException)));
}
@@ -48,85 +45,67 @@ public bool IsTransient(Exception ex)
/// The error to check.
///
protected virtual bool CheckIsTransientInternal(Exception ex) {
- return CheckIsTransient(ex);
+ return CheckIsTransient(ex);
}
// SecuritySafeCritical because it references MessageLockLostException, MessagingCommunicationException,
// MessagingEntityAlreadyExistsException, MessagingEntityNotFoundException, ServerBusyException, ServerErrorException
[SecuritySafeCritical]
- private static bool CheckIsTransient(Exception ex)
- {
- if (ex is FaultException)
- {
+ private static bool CheckIsTransient(Exception ex) {
+ if (ex is FaultException) {
return false;
}
- else if (ex is MessagingEntityNotFoundException)
- {
+ else if (ex is MessagingEntityNotFoundException) {
return false;
}
- else if (ex is MessagingEntityAlreadyExistsException)
- {
+ else if (ex is MessagingEntityAlreadyExistsException) {
return false;
}
- else if (ex is MessageLockLostException)
- {
+ else if (ex is MessageLockLostException) {
return false;
}
- else if (ex is CommunicationObjectFaultedException)
- {
+ else if (ex is CommunicationObjectFaultedException) {
return false;
}
- else if (ex is MessagingCommunicationException)
- {
- return true;
- }
- else if (ex is TimeoutException)
- {
+ else if (ex is MessagingCommunicationException) {
return true;
}
- else if (ex is WebException)
- {
+ else if (ex is TimeoutException) {
return true;
}
- else if (ex is SecurityTokenException)
- {
+ else if (ex is WebException) {
return true;
}
- else if (ex is ServerTooBusyException)
- {
+ //else if (ex is SecurityTokenException) {
+ // return true;
+ //}
+ else if (ex is ServerTooBusyException) {
return true;
}
- else if (ex is ServerBusyException)
- {
+ else if (ex is ServerBusyException) {
return true;
}
- else if (ex is ServerErrorException)
- {
+ else if (ex is ServerErrorException) {
return true;
}
- else if (ex is ProtocolException)
- {
+ else if (ex is ProtocolException) {
return true;
}
- else if (ex is EndpointNotFoundException)
- {
+ else if (ex is EndpointNotFoundException) {
// This exception may occur when a listener and a consumer are being
// initialized out of sync (e.g. consumer is reaching to a listener that
// is still in the process of setting up the Service Host).
return true;
}
- else if (ex is CommunicationException)
- {
+ else if (ex is CommunicationException) {
return true;
}
- else if (ex is SocketException)
- {
+ else if (ex is SocketException) {
var socketFault = ex as SocketException;
return socketFault.SocketErrorCode == SocketError.TimedOut;
}
- else if (ex is UnauthorizedAccessException)
- {
+ else if (ex is UnauthorizedAccessException) {
// Need to provide some resilience against the following fault that was seen a few times:
// System.UnauthorizedAccessException: The token provider was unable to provide a security token while accessing 'https://mysbns-sb.accesscontrol.windows.net/WRAPv0.9/'.
// Token provider returned message: 'Error:Code:500:SubCode:T9002:Detail:An internal network error occured. Please try again.'.
@@ -136,8 +115,7 @@ private static bool CheckIsTransient(Exception ex)
var match = acsErrorCodeRegEx.Match(ex.Message);
var errorCode = 0;
- if (match.Success && match.Groups.Count > 1 && int.TryParse(match.Groups[1].Value, out errorCode))
- {
+ if (match.Success && match.Groups.Count > 1 && int.TryParse(match.Groups[1].Value, out errorCode)) {
return errorCode == (int)HttpStatusCode.InternalServerError;
}
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ServiceBus/ServiceBusTransientErrorToDetermineExistanceDetectionStrategy.cs b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ServiceBus/ServiceBusTransientErrorToDetermineExistanceDetectionStrategy.cs
index 25989ab..6a9bb57 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ServiceBus/ServiceBusTransientErrorToDetermineExistanceDetectionStrategy.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/TransientFaultHandling/ServiceBus/ServiceBusTransientErrorToDetermineExistanceDetectionStrategy.cs
@@ -1,13 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.ServiceBus;
-using System.Net;
+using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.ServiceBus;
using Microsoft.ServiceBus.Messaging;
+using System;
+using System.Net;
namespace ProjectExtensions.Azure.ServiceBus.TransientFaultHandling.ServiceBus {
-
+
///
/// When we verify if an item exits, we consider a 404 to NOT be Transient.
///
@@ -23,7 +20,7 @@ protected override bool CheckIsTransientInternal(Exception ex) {
return false;
}
}
-
+
return base.CheckIsTransientInternal(ex);
}
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Wrappers/SubscriptionClientWrapper.cs b/src/ProjectExtensions.Azure.ServiceBus/Wrappers/SubscriptionClientWrapper.cs
index aeea1c3..4067e80 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Wrappers/SubscriptionClientWrapper.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Wrappers/SubscriptionClientWrapper.cs
@@ -1,10 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus.Messaging;
-using Microsoft.Practices.TransientFaultHandling;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.Wrappers {
@@ -38,16 +35,8 @@ public int PrefetchCount {
}
}
- public IAsyncResult BeginReceive(TimeSpan serverWaitTime, AsyncCallback callback, object state) {
- return client.BeginReceive(serverWaitTime, callback, state);
- }
-
- public IBrokeredMessage EndReceive(IAsyncResult result) {
- var msg = client.EndReceive(result);
- if (msg != null) {
- return new BrokeredMessageWrapper(msg);
- }
- return null;
+ public IBrokeredMessage BeginReceive(TimeSpan serverWaitTime) {
+ return new BrokeredMessageWrapper(client.Receive(serverWaitTime));
}
public void OnMessage(Action callback, OnMessageOptions onMessageOptions) {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/Wrappers/TopicClientWrapper.cs b/src/ProjectExtensions.Azure.ServiceBus/Wrappers/TopicClientWrapper.cs
index 6e5b04d..ab4a44b 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/Wrappers/TopicClientWrapper.cs
+++ b/src/ProjectExtensions.Azure.ServiceBus/Wrappers/TopicClientWrapper.cs
@@ -1,13 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus.Messaging;
-using Microsoft.Practices.TransientFaultHandling;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.Wrappers {
-
+
class TopicClientWrapper : ITopicClient {
TopicClient topicClient;
@@ -17,15 +14,11 @@ public TopicClientWrapper(TopicClient topicClient) {
this.topicClient = topicClient;
}
- public IAsyncResult BeginSend(IBrokeredMessage message, AsyncCallback callback, object state) {
+ public void Send(IBrokeredMessage message) {
if (!(message is BrokeredMessageWrapper)) {
throw new ArgumentOutOfRangeException("message", "message must be BrokeredMessage for Azure use");
}
- return topicClient.BeginSend((message as BrokeredMessageWrapper).GetMessage(), callback, state);
- }
-
- public void EndSend(IAsyncResult result) {
- topicClient.EndSend(result);
+ topicClient.Send((message as BrokeredMessageWrapper).GetMessage());
}
public void Close() {
diff --git a/src/ProjectExtensions.Azure.ServiceBus/app.config b/src/ProjectExtensions.Azure.ServiceBus/app.config
index 3fc5b41..a8fad14 100644
--- a/src/ProjectExtensions.Azure.ServiceBus/app.config
+++ b/src/ProjectExtensions.Azure.ServiceBus/app.config
@@ -1,32 +1,4 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
diff --git a/src/ProjectExtensions.Azure.ServiceBus/packages.config b/src/ProjectExtensions.Azure.ServiceBus/packages.config
deleted file mode 100644
index 4b836bf..0000000
--- a/src/ProjectExtensions.Azure.ServiceBus/packages.config
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingCastleWindsor/Bootstrapper.cs b/src/Samples/PubSubUsingCastleWindsor/Bootstrapper.cs
index 81a71ed..4fbf0b9 100644
--- a/src/Samples/PubSubUsingCastleWindsor/Bootstrapper.cs
+++ b/src/Samples/PubSubUsingCastleWindsor/Bootstrapper.cs
@@ -1,6 +1,5 @@
using ProjectExtensions.Azure.ServiceBus;
using ProjectExtensions.Azure.ServiceBus.CastleWindsor.Container;
-using PubSubUsingConfiguration;
namespace PubSubUsingConfiguration {
public static class Bootstrapper {
diff --git a/src/Samples/PubSubUsingCastleWindsor/Properties/AssemblyInfo.cs b/src/Samples/PubSubUsingCastleWindsor/Properties/AssemblyInfo.cs
index 948a5fc..b958800 100644
--- a/src/Samples/PubSubUsingCastleWindsor/Properties/AssemblyInfo.cs
+++ b/src/Samples/PubSubUsingCastleWindsor/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
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
diff --git a/src/Samples/PubSubUsingCastleWindsor/PubSubUsingCastleWindsor.csproj b/src/Samples/PubSubUsingCastleWindsor/PubSubUsingCastleWindsor.csproj
index 3b3f878..1926b76 100644
--- a/src/Samples/PubSubUsingCastleWindsor/PubSubUsingCastleWindsor.csproj
+++ b/src/Samples/PubSubUsingCastleWindsor/PubSubUsingCastleWindsor.csproj
@@ -1,75 +1,14 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {7635ABF3-31F7-408E-ACDB-FFDBE7DA6D10}
+ net7.0
Exe
- Properties
- PubSubUsingCastleWindsor
- PubSubUsingCastleWindsor
- v4.0
-
-
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
+ false
PubSubUsingConfiguration.Program
-
- False
- ..\..\..\packages\Castle.Core.3.2.2\lib\net40-client\Castle.Core.dll
-
-
- False
- ..\..\..\packages\Castle.Windsor.3.2.1\lib\net40\Castle.Windsor.dll
-
-
- False
- ..\..\..\packages\WindowsAzure.ServiceBus.2.4.9.0\lib\net40-full\Microsoft.ServiceBus.dll
-
-
- False
- ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
-
- False
- ..\..\..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll
-
-
- False
- ..\..\..\packages\NLog.2.1.0\lib\net40\NLog.dll
-
-
-
-
-
-
-
-
-
-
@@ -90,31 +29,42 @@
TestMessageSubscriber.cs
-
-
app.config
-
-
- {69CAB6DE-C753-42F9-9E8F-935B975DBCA2}
- ProjectExtensions.Azure.ServiceBus.CastleWindsor
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
+
+
+
+
+
+ 5.1.1
+
+
+ 5.1.2
+
+
+
+ 3.2.3
+
+
+ 13.0.3
+
+
+ 5.1.3
+
+
+
+ 6.2.2
+
+
+
+
+
+ all
+
-
-
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingCastleWindsor/packages.config b/src/Samples/PubSubUsingCastleWindsor/packages.config
deleted file mode 100644
index c34fb41..0000000
--- a/src/Samples/PubSubUsingCastleWindsor/packages.config
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingConfiguration/AnotherTestMessage.cs b/src/Samples/PubSubUsingConfiguration/AnotherTestMessage.cs
index c3b9c3a..94243e7 100644
--- a/src/Samples/PubSubUsingConfiguration/AnotherTestMessage.cs
+++ b/src/Samples/PubSubUsingConfiguration/AnotherTestMessage.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace PubSubUsingConfiguration {
+namespace PubSubUsingConfiguration {
public class AnotherTestMessage {
diff --git a/src/Samples/PubSubUsingConfiguration/AnotherTestMessageSubscriber.cs b/src/Samples/PubSubUsingConfiguration/AnotherTestMessageSubscriber.cs
index 6d6b2ae..0f99cc2 100644
--- a/src/Samples/PubSubUsingConfiguration/AnotherTestMessageSubscriber.cs
+++ b/src/Samples/PubSubUsingConfiguration/AnotherTestMessageSubscriber.cs
@@ -1,23 +1,196 @@
-using System;
+
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+Before:
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
+After:
+using Microsoft.ServiceBus.Messaging;
+using NLog;
+using ProjectExtensions.Azure.ServiceBus;
+using System;
+*/
+
+/* Unmerged change from project 'PubSubUsingStructureMap'
+Before:
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+After:
+using Microsoft.ServiceBus.Messaging;
+using NLog;
+using ProjectExtensions.Azure.ServiceBus;
+using System;
+*/
+
+/* Unmerged change from project 'PubSubUsingUnity'
+Before:
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+After:
+using Microsoft.ServiceBus.Messaging;
+using NLog;
+using ProjectExtensions.Azure.ServiceBus;
+using System;
+*/
+
+/* Unmerged change from project 'PubSubUsingNinject'
+Before:
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+After:
+using Microsoft.ServiceBus.Messaging;
+using NLog;
using ProjectExtensions.Azure.ServiceBus;
+using System;
+*/
+using Microsoft.ServiceBus.Messaging;
using NLog;
+using ProjectExtensions.Azure.ServiceBus;
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+Before:
+using System.Collections.Generic;
+
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+After:
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+*/
+
+/* Unmerged change from project 'PubSubUsingStructureMap'
+Before:
+using System.Collections.Generic;
+
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+After:
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+*/
+
+/* Unmerged change from project 'PubSubUsingUnity'
+Before:
+using System.Collections.Generic;
+
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+After:
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+*/
+
+/* Unmerged change from project 'PubSubUsingNinject'
+Before:
+using System.Collections.Generic;
+
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+After:
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+*/
+
+
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+Before:
+using NLog;
+After:
+using System.Diagnostics;
+*/
+
+/* Unmerged change from project 'PubSubUsingStructureMap'
+Before:
+using NLog;
+After:
+using System.Diagnostics;
+*/
+
+/* Unmerged change from project 'PubSubUsingUnity'
+Before:
+using NLog;
+After:
+using System.Diagnostics;
+*/
+
+/* Unmerged change from project 'PubSubUsingNinject'
+Before:
+using NLog;
+After:
using System.Diagnostics;
+*/
+using System
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+Before:
+using System.Linq;
+After:
+using System.Collections.Generic;
+using System.Linq;
+*/
+
+/* Unmerged change from project 'PubSubUsingStructureMap'
+Before:
+using System.Linq;
+After:
+using System.Collections.Generic;
+using System.Linq;
+*/
+
+/* Unmerged change from project 'PubSubUsingUnity'
+Before:
+using System.Linq;
+After:
+using System.Collections.Generic;
+using System.Linq;
+*/
+
+/* Unmerged change from project 'PubSubUsingNinject'
+Before:
+using System.Linq;
+After:
+using System.Collections.Generic;
+using System.Linq;
+*/
+;
+using System.Diagnostics;
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+Before:
+using Microsoft.ServiceBus.Messaging;
+After:
+using System.Text;
+*/
+
+/* Unmerged change from project 'PubSubUsingStructureMap'
+Before:
using Microsoft.ServiceBus.Messaging;
+After:
+using System.Text;
+*/
+
+/* Unmerged change from project 'PubSubUsingUnity'
+Before:
+using Microsoft.ServiceBus.Messaging;
+After:
+using System.Text;
+*/
+
+/* Unmerged change from project 'PubSubUsingNinject'
+Before:
+using Microsoft.ServiceBus.Messaging;
+After:
+using System.Text;
+*/
+
namespace PubSubUsingConfiguration {
[MessageHandlerConfiguration(
- DefaultMessageTimeToLive = 240,
- LockDuration = 120,
+ DefaultMessageTimeToLive = 240,
+ LockDuration = 120,
MaxConcurrentCalls = 4,
- MaxRetries = 2,
- PrefetchCount = 20,
+ MaxRetries = 2,
+ PrefetchCount = 20,
PauseTimeIfErrorWasThrown = 20000,
- ReceiveMode = ReceiveMode.PeekLock,
- Singleton=true)]
+ ReceiveMode = ReceiveMode.PeekLock,
+ Singleton = true)]
public class AnotherTestMessageSubscriber : IHandleCompetingMessages {
static Logger logger = LogManager.GetCurrentClassLogger();
diff --git a/src/Samples/PubSubUsingConfiguration/Bootstrapper.cs b/src/Samples/PubSubUsingConfiguration/Bootstrapper.cs
index 816992e..ed876b5 100644
--- a/src/Samples/PubSubUsingConfiguration/Bootstrapper.cs
+++ b/src/Samples/PubSubUsingConfiguration/Bootstrapper.cs
@@ -1,7 +1,7 @@
-using System.Configuration;
using Amazon.ServiceBus.DistributedMessages.Serializers;
using ProjectExtensions.Azure.ServiceBus;
using ProjectExtensions.Azure.ServiceBus.Autofac.Container;
+using System.Configuration;
namespace PubSubUsingConfiguration {
static internal class Bootstrapper {
diff --git a/src/Samples/PubSubUsingConfiguration/GZipXmlSerializer.cs b/src/Samples/PubSubUsingConfiguration/GZipXmlSerializer.cs
index d6c1dc6..e5de829 100644
--- a/src/Samples/PubSubUsingConfiguration/GZipXmlSerializer.cs
+++ b/src/Samples/PubSubUsingConfiguration/GZipXmlSerializer.cs
@@ -1,13 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using NLog;
using ProjectExtensions.Azure.ServiceBus.Serialization;
-using NLog;
+using System;
using System.IO;
-using System.Xml.Serialization;
using System.IO.Compression;
using System.Xml;
+using System.Xml.Serialization;
namespace Amazon.ServiceBus.DistributedMessages.Serializers {
diff --git a/src/Samples/PubSubUsingConfiguration/Program.cs b/src/Samples/PubSubUsingConfiguration/Program.cs
index a4ced70..3a7405d 100644
--- a/src/Samples/PubSubUsingConfiguration/Program.cs
+++ b/src/Samples/PubSubUsingConfiguration/Program.cs
@@ -1,9 +1,9 @@
-using System;
-using System.Collections.Generic;
-using ProjectExtensions.Azure.ServiceBus;
+using NLog;
using NLog.Config;
using NLog.Targets;
-using NLog;
+using ProjectExtensions.Azure.ServiceBus;
+using System;
+using System.Collections.Generic;
using System.Diagnostics;
using System.Transactions;
@@ -67,7 +67,7 @@ static void Main(string[] args) {
MessageId = DateTime.Now.ToString()
};
BusConfiguration.Instance.Bus.PublishAsync(message2, (result) => {
- if (!result.IsSuccess) {
+ if (!result.IsSuccess) {
//message failed.
}
Debug.WriteLine("async:" + result.TimeSpent);
diff --git a/src/Samples/PubSubUsingConfiguration/Properties/AssemblyInfo.cs b/src/Samples/PubSubUsingConfiguration/Properties/AssemblyInfo.cs
index ffc2f7c..064e775 100644
--- a/src/Samples/PubSubUsingConfiguration/Properties/AssemblyInfo.cs
+++ b/src/Samples/PubSubUsingConfiguration/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
diff --git a/src/Samples/PubSubUsingConfiguration/PubSubUsingConfiguration.csproj b/src/Samples/PubSubUsingConfiguration/PubSubUsingConfiguration.csproj
index fac1b65..16ab6e9 100644
--- a/src/Samples/PubSubUsingConfiguration/PubSubUsingConfiguration.csproj
+++ b/src/Samples/PubSubUsingConfiguration/PubSubUsingConfiguration.csproj
@@ -1,107 +1,48 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {2B545669-3B24-4805-B7B1-B7AA4E2B6A62}
+ net7.0
Exe
- Properties
- PubSubUsingConfiguration
- PubSubUsingConfiguration
- v4.0
-
-
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
+ false
-
- False
- ..\..\..\packages\Autofac.3.3.0\lib\net40\Autofac.dll
-
-
- False
- ..\..\..\packages\WindowsAzure.ServiceBus.2.4.9.0\lib\net40-full\Microsoft.ServiceBus.dll
-
-
- False
- ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
-
- False
- ..\..\..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll
-
-
- False
- ..\..\..\packages\NLog.2.1.0\lib\net40\NLog.dll
-
-
-
-
-
-
-
-
-
-
-
Properties\CommonAssemblyInfo.cs
-
-
-
-
-
-
-
-
-
- {11192756-9ABB-4C2B-8FE5-2DBD4DC0DC36}
- ProjectExtensions.Azure.ServiceBus.Autofac
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
+
+
+
+
+
+ 7.0.1
+
+
+
+ 3.2.3
+
+
+ 13.0.3
+
+
+ 5.1.3
+
+
+
+ 6.2.2
+
+
+
+
+
+
+ all
+
-
- Designer
-
-
- Designer
-
+
-
-
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingConfiguration/TestMessage.cs b/src/Samples/PubSubUsingConfiguration/TestMessage.cs
index 07e8968..3592312 100644
--- a/src/Samples/PubSubUsingConfiguration/TestMessage.cs
+++ b/src/Samples/PubSubUsingConfiguration/TestMessage.cs
@@ -1,12 +1,55 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+namespace PubSubUsingConfiguration {
-namespace PubSubUsingConfiguration {
+ /* Unmerged change from project 'PubSubUsingCastleWindsor'
+ Before:
+ public class TestMessage {
+
+ public string MessageId {
+ After:
+ public class TestMessage
+ {
+
+ public string MessageId {
+ */
+
+ /* Unmerged change from project 'PubSubUsingStructureMap'
+ Before:
+ public class TestMessage {
+
+ public string MessageId {
+ After:
+ public class TestMessage
+ {
+
+ public string MessageId {
+ */
+
+ /* Unmerged change from project 'PubSubUsingUnity'
+ Before:
+ public class TestMessage {
+
+ public string MessageId {
+ After:
+ public class TestMessage
+ {
+
+ public string MessageId {
+ */
+
+ /* Unmerged change from project 'PubSubUsingNinject'
+ Before:
+ public class TestMessage {
+
+ public string MessageId {
+ After:
+ public class TestMessage
+ {
+
+ public string MessageId {
+ */
public class TestMessage {
-
+
public string MessageId {
get;
set;
diff --git a/src/Samples/PubSubUsingConfiguration/TestMessageSubscriber.cs b/src/Samples/PubSubUsingConfiguration/TestMessageSubscriber.cs
index 2fe5a14..65aa295 100644
--- a/src/Samples/PubSubUsingConfiguration/TestMessageSubscriber.cs
+++ b/src/Samples/PubSubUsingConfiguration/TestMessageSubscriber.cs
@@ -1,14 +1,78 @@
-using System;
+
+/* Unmerged change from project 'PubSubUsingCastleWindsor'
+Before:
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProjectExtensions.Azure.ServiceBus;
using NLog;
+After:
+using NLog;
+using ProjectExtensions.Azure.ServiceBus;
+using System;
+using System.Collections.Generic;
+using System.Azure.ServiceBus;
+using System.Text;
+*/
+
+/* Unmerged change from project 'PubSubUsingStructureMap'
+Before:
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using ProjectExtensions.Azure.ServiceBus;
+using NLog;
+After:
+using NLog;
+using ProjectExtensions.Azure.ServiceBus;
+using System;
+using System.Collections.Generic;
+using System.Azure.ServiceBus;
+using System.Text;
+*/
+
+/* Unmerged change from project 'PubSubUsingUnity'
+Before:
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using ProjectExtensions.Azure.ServiceBus;
+using NLog;
+After:
+using NLog;
+using ProjectExtensions.Azure.ServiceBus;
+using System;
+using System.Collections.Generic;
+using System.Azure.ServiceBus;
+using System.Text;
+*/
+
+/* Unmerged change from project 'PubSubUsingNinject'
+Before:
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using ProjectExtensions.Azure.ServiceBus;
+using NLog;
+After:
+using NLog;
+using ProjectExtensions.Azure.ServiceBus;
+using System;
+using System.Collections.Generic;
+using System.Azure.ServiceBus;
+using System.Text;
+*/
+using NLog;
+using ProjectExtensions.Azure.ServiceBus;
namespace PubSubUsingConfiguration {
[MessageHandlerConfiguration(
- DeadLetterAfterMaxRetries=true,
+ DeadLetterAfterMaxRetries = true,
MaxRetries = 2,
PauseTimeIfErrorWasThrown = 15000,
Singleton = true)]
diff --git a/src/Samples/PubSubUsingConfiguration/app.config b/src/Samples/PubSubUsingConfiguration/app.config
index 9c7639a..76d2e43 100644
--- a/src/Samples/PubSubUsingConfiguration/app.config
+++ b/src/Samples/PubSubUsingConfiguration/app.config
@@ -1,47 +1,22 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
diff --git a/src/Samples/PubSubUsingConfiguration/appsettings.json b/src/Samples/PubSubUsingConfiguration/appsettings.json
new file mode 100644
index 0000000..412708c
--- /dev/null
+++ b/src/Samples/PubSubUsingConfiguration/appsettings.json
@@ -0,0 +1,6 @@
+{
+ "ServiceBusApplicationId": "Test1234",
+ "ServiceBusIssuerKey": "[your secret]",
+ "ServiceBusIssuerName": "owner",
+ "ServiceBusNamespace": "[your namespace]"
+}
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingConfiguration/packages.config b/src/Samples/PubSubUsingConfiguration/packages.config
deleted file mode 100644
index 16258a7..0000000
--- a/src/Samples/PubSubUsingConfiguration/packages.config
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingNinject/Properties/AssemblyInfo.cs b/src/Samples/PubSubUsingNinject/Properties/AssemblyInfo.cs
index fdb9c6f..1a8b47a 100644
--- a/src/Samples/PubSubUsingNinject/Properties/AssemblyInfo.cs
+++ b/src/Samples/PubSubUsingNinject/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
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
diff --git a/src/Samples/PubSubUsingNinject/PubSubUsingNinject.csproj b/src/Samples/PubSubUsingNinject/PubSubUsingNinject.csproj
index e6d29b8..5eed3a9 100644
--- a/src/Samples/PubSubUsingNinject/PubSubUsingNinject.csproj
+++ b/src/Samples/PubSubUsingNinject/PubSubUsingNinject.csproj
@@ -1,68 +1,11 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {E1182B9A-A509-4B56-AA80-7BD15D6B3D94}
+ net7.0
Exe
- Properties
- PubSubUsingNinject
- PubSubUsingNinject
- v4.0
-
-
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
+ false
-
- False
- ..\..\..\packages\WindowsAzure.ServiceBus.2.4.9.0\lib\net40-full\Microsoft.ServiceBus.dll
-
-
- False
- ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
-
- False
- ..\..\..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll
-
-
- False
- ..\..\..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll
-
-
- False
- ..\..\..\packages\NLog.2.1.0\lib\net40\NLog.dll
-
-
-
-
-
-
-
-
-
-
@@ -83,31 +26,39 @@
TestMessageSubscriber.cs
-
-
-
- {18285A92-F031-45A5-97BB-FE3841DAB434}
- ProjectExtensions.Azure.ServiceBus.Ninject
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
+
+
app.config
-
-
-
+
+
+
+ 3.2.3
+
+
+ 13.0.3
+
+
+ 3.3.6
+
+
+ 5.1.3
+
+
+
+ 6.2.2
+
+
+
+
+
+ all
+
+
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingNinject/packages.config b/src/Samples/PubSubUsingNinject/packages.config
deleted file mode 100644
index 33f70e8..0000000
--- a/src/Samples/PubSubUsingNinject/packages.config
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingStructureMap/Bootstrapper.cs b/src/Samples/PubSubUsingStructureMap/Bootstrapper.cs
index 6b6f74d..3673c3a 100644
--- a/src/Samples/PubSubUsingStructureMap/Bootstrapper.cs
+++ b/src/Samples/PubSubUsingStructureMap/Bootstrapper.cs
@@ -1,6 +1,5 @@
using ProjectExtensions.Azure.ServiceBus;
using ProjectExtensions.Azure.ServiceBus.StructureMap.Container;
-using PubSubUsingConfiguration;
namespace PubSubUsingConfiguration {
public static class Bootstrapper {
diff --git a/src/Samples/PubSubUsingStructureMap/Properties/AssemblyInfo.cs b/src/Samples/PubSubUsingStructureMap/Properties/AssemblyInfo.cs
index 791fca1..1ca9ff9 100644
--- a/src/Samples/PubSubUsingStructureMap/Properties/AssemblyInfo.cs
+++ b/src/Samples/PubSubUsingStructureMap/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
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
diff --git a/src/Samples/PubSubUsingStructureMap/PubSubUsingStructureMap.csproj b/src/Samples/PubSubUsingStructureMap/PubSubUsingStructureMap.csproj
index 235928c..c4c2d61 100644
--- a/src/Samples/PubSubUsingStructureMap/PubSubUsingStructureMap.csproj
+++ b/src/Samples/PubSubUsingStructureMap/PubSubUsingStructureMap.csproj
@@ -1,71 +1,14 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {59099F13-9153-477B-A35A-B4AB9413DF32}
+ net7.0
Exe
- Properties
- PubSubUsingStructureMap
- PubSubUsingStructureMap
- v4.0
-
-
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
+ false
PubSubUsingConfiguration.Program
-
- False
- ..\..\..\packages\WindowsAzure.ServiceBus.2.4.9.0\lib\net40-full\Microsoft.ServiceBus.dll
-
-
- False
- ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
-
- False
- ..\..\..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll
-
-
- False
- ..\..\..\packages\NLog.2.1.0\lib\net40\NLog.dll
-
-
- False
- ..\..\..\packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll
-
-
-
-
-
-
-
-
-
-
@@ -86,33 +29,39 @@
TestMessageSubscriber.cs
-
-
app.config
-
- Designer
-
-
- {5C526602-9D47-4E02-B3A6-745E9D573994}
- ProjectExtensions.Azure.ServiceBus.StructureMap
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
+
+
+
+
+
+
+ 3.2.3
+
+
+ 13.0.3
+
+
+ 5.1.3
+
+
+ 4.7.1
+
+
+
+ 6.2.2
+
+
+
+
+
+ all
+
-
-
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingStructureMap/packages.config b/src/Samples/PubSubUsingStructureMap/packages.config
deleted file mode 100644
index 7f44c98..0000000
--- a/src/Samples/PubSubUsingStructureMap/packages.config
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingUnity/Bootstrapper.cs b/src/Samples/PubSubUsingUnity/Bootstrapper.cs
index aab0e3d..a448648 100644
--- a/src/Samples/PubSubUsingUnity/Bootstrapper.cs
+++ b/src/Samples/PubSubUsingUnity/Bootstrapper.cs
@@ -1,6 +1,5 @@
using ProjectExtensions.Azure.ServiceBus;
using ProjectExtensions.Azure.ServiceBus.Unity.Container;
-using PubSubUsingConfiguration;
namespace PubSubUsingConfiguration {
public static class Bootstrapper {
diff --git a/src/Samples/PubSubUsingUnity/Properties/AssemblyInfo.cs b/src/Samples/PubSubUsingUnity/Properties/AssemblyInfo.cs
index 6768f01..a2ecc53 100644
--- a/src/Samples/PubSubUsingUnity/Properties/AssemblyInfo.cs
+++ b/src/Samples/PubSubUsingUnity/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
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
diff --git a/src/Samples/PubSubUsingUnity/PubSubUsingUnity.csproj b/src/Samples/PubSubUsingUnity/PubSubUsingUnity.csproj
index 9592149..b54dc91 100644
--- a/src/Samples/PubSubUsingUnity/PubSubUsingUnity.csproj
+++ b/src/Samples/PubSubUsingUnity/PubSubUsingUnity.csproj
@@ -1,79 +1,14 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {9D506199-4F64-4446-85B7-88A7A598F322}
+ net7.0
Exe
- Properties
- PubSubUsingUnity
- PubSubUsingUnity
- v4.0
-
-
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
+ false
PubSubUsingConfiguration.Program
-
- False
- ..\..\..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll
-
-
- False
- ..\..\..\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.dll
-
-
- False
- ..\..\..\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.Configuration.dll
-
-
- False
- ..\..\..\packages\WindowsAzure.ServiceBus.2.4.9.0\lib\net40-full\Microsoft.ServiceBus.dll
-
-
- False
- ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
-
- False
- ..\..\..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll
-
-
- False
- ..\..\..\packages\NLog.2.1.0\lib\net40\NLog.dll
-
-
-
-
-
-
-
-
-
-
@@ -94,33 +29,39 @@
TestMessageSubscriber.cs
-
-
app.config
-
- Designer
-
-
- {B505DEAA-0CCA-4E26-9CA6-AB2820C85FC7}
- ProjectExtensions.Azure.ServiceBus.Unity
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
+
+
+
+
+
+
+ 3.2.3
+
+
+ 13.0.3
+
+
+ 5.1.3
+
+
+
+ 5.11.10
+
+
+ 6.2.2
+
+
+
+
+
+ all
+
-
-
\ No newline at end of file
diff --git a/src/Samples/PubSubUsingUnity/packages.config b/src/Samples/PubSubUsingUnity/packages.config
deleted file mode 100644
index c440a3f..0000000
--- a/src/Samples/PubSubUsingUnity/packages.config
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/ProjectExtensions.Azure.ServiceBus.Tests.Integration.csproj b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/ProjectExtensions.Azure.ServiceBus.Tests.Integration.csproj
index 0aabd6b..d1142cf 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/ProjectExtensions.Azure.ServiceBus.Tests.Integration.csproj
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/ProjectExtensions.Azure.ServiceBus.Tests.Integration.csproj
@@ -1,71 +1,28 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {5CA360A8-B3D1-4470-BD73-11F96082E62C}
+ netstandard2.0
Library
- Properties
- ProjectExtensions.Azure.ServiceBus.Tests.Integration
- ProjectExtensions.Azure.ServiceBus.Tests.Integration
- v4.0
- 512
+ false
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- False
- ..\..\..\packages\Moq.4.2.1312.1622\lib\net40\Moq.dll
-
-
- False
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
-
-
- False
- ..\..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll
-
-
-
-
-
-
-
-
-
Properties\CommonAssemblyInfo.cs
-
-
+
+
+ 4.18.4
+
+
+ 3.13.3
+
+
+ 3.6.1
+
+
+
+ all
+
-
-
\ No newline at end of file
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/Properties/AssemblyInfo.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/Properties/AssemblyInfo.cs
index 865bc84..6dd3e4a 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/Properties/AssemblyInfo.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/packages.config b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/packages.config
deleted file mode 100644
index 74327b8..0000000
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Integration/packages.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Config.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Config.cs
index b4eec2a..298dd19 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Config.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Config.cs
@@ -1,14 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using Autofac;
using NUnit.Framework;
using ProjectExtensions.Azure.ServiceBus.Autofac.Container;
-using Autofac;
using ProjectExtensions.Azure.ServiceBus.Interfaces;
-using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Mocks;
using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Messages;
-using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Interfaces;
+using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Mocks;
+using System;
using System.Diagnostics;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit {
@@ -20,7 +16,7 @@ public class Config {
public void SetUp() {
var builder = new ContainerBuilder();
-
+
builder.RegisterType(typeof(MockSubscriptionClient)).As(typeof(ISubscriptionClient)).SingleInstance();
builder.RegisterType(typeof(MockTopicClient)).As(typeof(ITopicClient)).SingleInstance();
builder.RegisterType(typeof(MockNamespaceManager)).As(typeof(INamespaceManager)).SingleInstance();
@@ -40,7 +36,7 @@ public void SetUp() {
BusConfiguration.Instance.Bus.PublishAsync(new TestMessageForTesting(), (callback) => {
Debug.WriteLine("Time Spent:" + callback.TimeSpent);
Console.WriteLine("Time Spent:" + callback.TimeSpent);
- });
+ });
}
}
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Handlers/TestMessageForTestingHandler.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Handlers/TestMessageForTestingHandler.cs
index 047826f..44783f9 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Handlers/TestMessageForTestingHandler.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Handlers/TestMessageForTestingHandler.cs
@@ -1,17 +1,14 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Messages;
+using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Messages;
+using System;
using System.Diagnostics;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit.Handlers {
-
+
public class TestMessageForTestingHandler : IHandleMessages {
-
- public void Handle(IReceivedMessage message) {
- Debug.WriteLine("Received:" + message.BrokeredMessage.MessageId + " Value:" + message.Message.Id + " counter:" + message.Message.Counter);
- Console.WriteLine("Received:" + message.BrokeredMessage.MessageId + " Value:" + message.Message.Id + " counter:" + message.Message.Counter);
- }
- }
+
+ public void Handle(IReceivedMessage message) {
+ Debug.WriteLine("Received:" + message.BrokeredMessage.MessageId + " Value:" + message.Message.Id + " counter:" + message.Message.Counter);
+ Console.WriteLine("Received:" + message.BrokeredMessage.MessageId + " Value:" + message.Message.Id + " counter:" + message.Message.Counter);
+ }
+ }
}
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Interfaces/IMockServiceBus.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Interfaces/IMockServiceBus.cs
index aee950c..11ee403 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Interfaces/IMockServiceBus.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Interfaces/IMockServiceBus.cs
@@ -1,9 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.ServiceBus.Messaging;
+using Microsoft.ServiceBus.Messaging;
using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit.Interfaces {
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Messages/TestMessageForTesting.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Messages/TestMessageForTesting.cs
index 89d7536..59c6810 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Messages/TestMessageForTesting.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Messages/TestMessageForTesting.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit.Messages {
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockBrokeredMessage.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockBrokeredMessage.cs
index 6bf7492..2710b24 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockBrokeredMessage.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockBrokeredMessage.cs
@@ -1,9 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using Microsoft.Practices.TransientFaultHandling;
using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Interfaces;
-using Microsoft.Practices.TransientFaultHandling;
+using System;
+using System.Collections.Generic;
using System.IO;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit.Mocks {
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockIAsyncResult.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockIAsyncResult.cs
index ec1de31..c5df0a9 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockIAsyncResult.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockIAsyncResult.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit.Mocks {
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockMessagingFactory.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockMessagingFactory.cs
index 41f57eb..8fb5adb 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockMessagingFactory.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockMessagingFactory.cs
@@ -1,12 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus.Messaging;
-using System.IO;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Interfaces;
-using Microsoft.Practices.TransientFaultHandling;
+using System.IO;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit.Mocks {
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockNamespaceManager.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockNamespaceManager.cs
index 8b053e8..1a43ba4 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockNamespaceManager.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockNamespaceManager.cs
@@ -1,11 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Interfaces;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus.Messaging;
+using ProjectExtensions.Azure.ServiceBus.Interfaces;
using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Interfaces;
-using Microsoft.Practices.TransientFaultHandling;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit.Mocks {
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockServiceBus.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockServiceBus.cs
index 22b277e..6d4d1a0 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockServiceBus.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockServiceBus.cs
@@ -1,15 +1,14 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Interfaces;
+using Microsoft.Practices.TransientFaultHandling;
using Microsoft.ServiceBus.Messaging;
+using ProjectExtensions.Azure.ServiceBus.Helpers;
using ProjectExtensions.Azure.ServiceBus.Interfaces;
-using Microsoft.Practices.TransientFaultHandling;
+using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Interfaces;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-using ProjectExtensions.Azure.ServiceBus.Helpers;
-using System.Diagnostics;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit.Mocks {
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockSubscriptionClient.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockSubscriptionClient.cs
index 87c2aa6..56c07ab 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockSubscriptionClient.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockSubscriptionClient.cs
@@ -1,11 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using Microsoft.Practices.TransientFaultHandling;
+using Microsoft.ServiceBus.Messaging;
using ProjectExtensions.Azure.ServiceBus.Interfaces;
using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Interfaces;
-using Microsoft.ServiceBus.Messaging;
-using Microsoft.Practices.TransientFaultHandling;
+using System;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit.Mocks {
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockTopicClient.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockTopicClient.cs
index 1a7d853..3eebdce 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockTopicClient.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Mocks/MockTopicClient.cs
@@ -1,10 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using Microsoft.Practices.TransientFaultHandling;
using ProjectExtensions.Azure.ServiceBus.Interfaces;
using ProjectExtensions.Azure.ServiceBus.Tests.Unit.Interfaces;
-using Microsoft.Practices.TransientFaultHandling;
+using System;
+using System.Collections.Generic;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit.Mocks {
@@ -26,21 +24,11 @@ public MockTopicClient(IBus serviceBus, string path) {
this.Path = path;
}
- public IAsyncResult BeginSend(IBrokeredMessage message, AsyncCallback callback, object state) {
+ public void Send(IBrokeredMessage message) {
var retVal = new MockIAsyncResult() {
- AsyncState = state
+ AsyncState = null
};
_messages[retVal] = message;
- callback(retVal);
- return retVal;
- }
-
- public void EndSend(IAsyncResult result) {
- IBrokeredMessage message = null;
- if (!_messages.TryGetValue(result, out message)) {
- throw new ApplicationException("You must call EndSend with a valid IAsyncResult. Duplicate Calls are not allowed.");
- }
- serviceBus.SendMessage(message);
}
public void Close() {
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/ProjectExtensions.Azure.ServiceBus.Tests.Unit.csproj b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/ProjectExtensions.Azure.ServiceBus.Tests.Unit.csproj
index 5934833..ceae09d 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/ProjectExtensions.Azure.ServiceBus.Tests.Unit.csproj
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/ProjectExtensions.Azure.ServiceBus.Tests.Unit.csproj
@@ -1,109 +1,44 @@
-
-
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {7B5EB3D2-771D-467C-B467-60BF2065890D}
+ net7.0
Library
- Properties
- ProjectExtensions.Azure.ServiceBus.Tests.Unit
- ProjectExtensions.Azure.ServiceBus.Tests.Unit
- v4.0
- 512
+ false
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- False
- ..\..\..\packages\Autofac.3.3.0\lib\net40\Autofac.dll
-
-
- False
- ..\..\..\packages\WindowsAzure.ServiceBus.2.4.9.0\lib\net40-full\Microsoft.ServiceBus.dll
-
-
- False
- ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
-
- False
- ..\..\..\packages\Moq.4.2.1312.1622\lib\net40\Moq.dll
-
-
- False
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
-
-
- False
- ..\..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll
-
-
-
-
-
-
-
-
-
-
-
Properties\CommonAssemblyInfo.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ 7.0.1
+
+
+
+ 3.2.3
+
+
+ 4.18.4
+
+
+ 3.13.3
+
+
+ 3.6.1
+
+
+
+ 6.2.2
+
+
+
+
+
+ all
+
-
-
- {11192756-9ABB-4C2B-8FE5-2DBD4DC0DC36}
- ProjectExtensions.Azure.ServiceBus.Autofac
-
-
- {8C8A8531-95AE-41CD-B2AC-6651F104245E}
- ProjectExtensions.Azure.ServiceBus
-
+
+
-
-
\ No newline at end of file
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Properties/AssemblyInfo.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Properties/AssemblyInfo.cs
index 2e18ca6..54e14f7 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Properties/AssemblyInfo.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/SampleTest.cs b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/SampleTest.cs
index 09b11a1..f7fcc14 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/SampleTest.cs
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/SampleTest.cs
@@ -1,12 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using NUnit.Framework;
-using System.Threading;
+using NUnit.Framework;
namespace ProjectExtensions.Azure.ServiceBus.Tests.Unit {
-
+
[TestFixture]
public class SampleTest {
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/app.config b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/app.config
index 3fc5b41..a8fad14 100644
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/app.config
+++ b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/app.config
@@ -1,32 +1,4 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
diff --git a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/packages.config b/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/packages.config
deleted file mode 100644
index 79ac724..0000000
--- a/src/Tests/ProjectExtensions.Azure.ServiceBus.Tests.Unit/packages.config
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file