diff --git a/.gitignore b/.gitignore
index 85eca59..db52fce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,3 +36,14 @@
/ServiceFabric.ServiceBus.Services/obj/'Debug'
*.user
/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/Backup*
+/Backup
+/Backup1
+/ServiceFabric.ServiceBus.Clients/bin/Debug
+/ServiceFabric.ServiceBus.Clients/obj
+/ServiceFabric.ServiceBus.Services/obj
+/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/obj/x64
+/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/obj/x64
+/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/obj/x64
+/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/obj/x64
+/UpgradeLog.htm
+/UpgradeLog2.htm
diff --git a/README.md b/README.md
index 3eef41c..0cb840f 100644
--- a/README.md
+++ b/README.md
@@ -29,6 +29,10 @@ Provides a ServiceBusTopicCommunicationClient to be used with 'ServicePartitionC
## Release notes:
+v5.0.0
+ - Upgraded nuget packages (SF 2.6.204)
+ - Upgraded sln to VS2017
+
v4.6.0
- Upgraded nuget packages (SF 2.5.216)
diff --git a/ServiceFabric.ServiceBus.Clients.sln b/ServiceFabric.ServiceBus.Clients.sln
index ffec5c6..f15922e 100644
--- a/ServiceFabric.ServiceBus.Clients.sln
+++ b/ServiceFabric.ServiceBus.Clients.sln
@@ -1,10 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.24720.0
+# Visual Studio 15
+VisualStudioVersion = 15.0.26510.0
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ServiceFabric.ServiceBus.Clients", "ServiceFabric.ServiceBus.Clients\ServiceFabric.ServiceBus.Clients.xproj", "{F00FB0EE-57AB-4E6A-933D-C02A98E60C9E}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AEE7481C-A281-41EA-A7D4-A70C786E47A1}"
ProjectSection(SolutionItems) = preProject
ServiceFabric.ServiceBus.Clients\global.json = ServiceFabric.ServiceBus.Clients\global.json
@@ -12,16 +10,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServiceFabric.ServiceBus.Clients", "ServiceFabric.ServiceBus.Clients\ServiceFabric.ServiceBus.Clients.csproj", "{F00FB0EE-57AB-4E6A-933D-C02A98E60C9E}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {0C1AD577-93E3-437C-A0C7-5918E0F4D575}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0C1AD577-93E3-437C-A0C7-5918E0F4D575}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0C1AD577-93E3-437C-A0C7-5918E0F4D575}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0C1AD577-93E3-437C-A0C7-5918E0F4D575}.Release|Any CPU.Build.0 = Release|Any CPU
{F00FB0EE-57AB-4E6A-933D-C02A98E60C9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F00FB0EE-57AB-4E6A-933D-C02A98E60C9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F00FB0EE-57AB-4E6A-933D-C02A98E60C9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
diff --git a/ServiceFabric.ServiceBus.Clients/ServiceFabric.ServiceBus.Clients.csproj b/ServiceFabric.ServiceBus.Clients/ServiceFabric.ServiceBus.Clients.csproj
new file mode 100644
index 0000000..87f07ad
--- /dev/null
+++ b/ServiceFabric.ServiceBus.Clients/ServiceFabric.ServiceBus.Clients.csproj
@@ -0,0 +1,48 @@
+
+
+
+ Send BrokeredMessages to ServiceFabric Services through Service Bus. Optionally add this package to a project that will communicate to Reliable Services. Use in conjunction with ServiceFabric.ServiceBus.Services
+ 2017
+ 5.0.0
+ Loek Duys
+ net451;net46
+ x64
+ ServiceFabric.ServiceBus.Clients
+ ServiceFabric.ServiceBus.Clients
+ ServiceFabric;Service;Fabric;ServiceBus;Bus;Reliable
+ https://github.com/loekd/ServiceFabric.ServiceBus
+ https://github.com/loekd/ServiceFabric.ServiceBus/blob/master/LICENSE
+ true
+ git
+ https://github.com/loekd/ServiceFabric.ServiceBus.git
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ServiceFabric.ServiceBus.Clients/ServiceFabric.ServiceBus.Clients.xproj b/ServiceFabric.ServiceBus.Clients/ServiceFabric.ServiceBus.Clients.xproj
deleted file mode 100644
index 13906bc..0000000
--- a/ServiceFabric.ServiceBus.Clients/ServiceFabric.ServiceBus.Clients.xproj
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
- 14.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
-
- f00fb0ee-57ab-4e6a-933d-c02a98e60c9e
- ServiceFabric.ServiceBus.Clients
- ..\artifacts\obj\$(MSBuildProjectName)
- ..\artifacts\bin\$(MSBuildProjectName)
-
-
- 2.0
-
-
- True
-
-
- True
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Clients/project.json b/ServiceFabric.ServiceBus.Clients/project.json
deleted file mode 100644
index e31c4f2..0000000
--- a/ServiceFabric.ServiceBus.Clients/project.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "version": "4.6.0",
- "copyright": "2017",
- "packOptions": {
- "title": "ServiceFabric.ServiceBus.Clients",
- "requireLicenseAcceptance": true,
- "summary": "Adds Reliable communication to and between ServiceFabric Reliable Services, using Service Bus. Supports Queues, Topics and Batching. This is the optional Client Package for sending BrokeredMessages.",
- "tags": [ "ServiceFabric", "Service", "Fabric", "ServiceBus", "Bus", "Reliable" ],
- "projectUrl": "https://github.com/loekd/ServiceFabric.ServiceBus",
- "licenseUrl": "https://github.com/loekd/ServiceFabric.ServiceBus/blob/master/LICENSE",
- "repository": {
- "type": "git",
- "url": "https://github.com/loekd/ServiceFabric.ServiceBus.git"
- },
- "files": {
- "include": "content/**"
- }
- },
- "description": "Send BrokeredMessages to ServiceFabric Services through Service Bus. Optionally add this package to a project that will communicate to Reliable Services. Use in conjunction with ServiceFabric.ServiceBus.Services",
- "authors": [ "Loek Duys" ],
- "buildOptions": {
- "platform": "x64"
- },
- "frameworks": {
- "net451": {
- },
- "net460": {
- }
- },
- "dependencies": {
- "Microsoft.ServiceFabric.Services": "2.5.216",
- "Microsoft.WindowsAzure.ConfigurationManager": "3.2.3",
- "WindowsAzure.ServiceBus": "4.0.0"
- }
-}
diff --git a/ServiceFabric.ServiceBus.Clients/project.lock.json b/ServiceFabric.ServiceBus.Clients/project.lock.json
deleted file mode 100644
index 1ed6197..0000000
--- a/ServiceFabric.ServiceBus.Clients/project.lock.json
+++ /dev/null
@@ -1,226 +0,0 @@
-{
- "locked": false,
- "version": 2,
- "targets": {
- ".NETFramework,Version=v4.5.1": {
- "Microsoft.ServiceFabric/5.4.164": {
- "type": "package",
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Internal.Strings.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Internal.dll": {},
- "lib/net45/System.Fabric.Strings.dll": {},
- "lib/net45/System.Fabric.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Internal.Strings.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Internal.dll": {},
- "lib/net45/System.Fabric.Strings.dll": {},
- "lib/net45/System.Fabric.dll": {}
- }
- },
- "Microsoft.ServiceFabric.Data/2.4.164": {
- "type": "package",
- "dependencies": {
- "Microsoft.ServiceFabric": "[5.4.164]"
- },
- "frameworkAssemblies": [
- "System.Runtime.Serialization"
- ],
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Data.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Data.dll": {}
- }
- },
- "Microsoft.ServiceFabric.Services/2.4.164": {
- "type": "package",
- "dependencies": {
- "Microsoft.ServiceFabric": "[5.4.164]",
- "Microsoft.ServiceFabric.Data": "[2.4.164]"
- },
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Services.dll": {},
- "lib/net45/ServiceFabricServiceModel.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Services.dll": {},
- "lib/net45/ServiceFabricServiceModel.dll": {}
- }
- },
- "Microsoft.WindowsAzure.ConfigurationManager/3.2.3": {
- "type": "package",
- "compile": {
- "lib/net40/Microsoft.WindowsAzure.Configuration.dll": {}
- },
- "runtime": {
- "lib/net40/Microsoft.WindowsAzure.Configuration.dll": {}
- }
- },
- "WindowsAzure.ServiceBus/3.4.5": {
- "type": "package",
- "frameworkAssemblies": [
- "System.Runtime.Serialization",
- "System.ServiceModel",
- "System.Xml"
- ],
- "compile": {
- "lib/net45-full/Microsoft.ServiceBus.dll": {}
- },
- "runtime": {
- "lib/net45-full/Microsoft.ServiceBus.dll": {}
- }
- }
- },
- ".NETFramework,Version=v4.6": {
- "Microsoft.ServiceFabric/5.4.164": {
- "type": "package",
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Internal.Strings.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Internal.dll": {},
- "lib/net45/System.Fabric.Strings.dll": {},
- "lib/net45/System.Fabric.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Internal.Strings.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Internal.dll": {},
- "lib/net45/System.Fabric.Strings.dll": {},
- "lib/net45/System.Fabric.dll": {}
- }
- },
- "Microsoft.ServiceFabric.Data/2.4.164": {
- "type": "package",
- "dependencies": {
- "Microsoft.ServiceFabric": "[5.4.164]"
- },
- "frameworkAssemblies": [
- "System.Runtime.Serialization"
- ],
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Data.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Data.dll": {}
- }
- },
- "Microsoft.ServiceFabric.Services/2.4.164": {
- "type": "package",
- "dependencies": {
- "Microsoft.ServiceFabric": "[5.4.164]",
- "Microsoft.ServiceFabric.Data": "[2.4.164]"
- },
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Services.dll": {},
- "lib/net45/ServiceFabricServiceModel.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Services.dll": {},
- "lib/net45/ServiceFabricServiceModel.dll": {}
- }
- },
- "Microsoft.WindowsAzure.ConfigurationManager/3.2.3": {
- "type": "package",
- "compile": {
- "lib/net40/Microsoft.WindowsAzure.Configuration.dll": {}
- },
- "runtime": {
- "lib/net40/Microsoft.WindowsAzure.Configuration.dll": {}
- }
- },
- "WindowsAzure.ServiceBus/3.4.5": {
- "type": "package",
- "frameworkAssemblies": [
- "System.Runtime.Serialization",
- "System.ServiceModel",
- "System.Xml"
- ],
- "compile": {
- "lib/net45-full/Microsoft.ServiceBus.dll": {}
- },
- "runtime": {
- "lib/net45-full/Microsoft.ServiceBus.dll": {}
- }
- }
- }
- },
- "libraries": {
- "Microsoft.ServiceFabric/5.4.164": {
- "sha512": "tj8rj5mgFLEgheHoKF4wAwG+y9RZZkX7XP70lDrvniwXJqZd5FnOtYs0FyKUL9qAhZNwNZYJGKegmT0eh1NyGQ==",
- "type": "package",
- "path": "Microsoft.ServiceFabric/5.4.164",
- "files": [
- "Microsoft.ServiceFabric.5.4.164.nupkg.sha512",
- "Microsoft.ServiceFabric.nuspec",
- "lib/net45/Microsoft.ServiceFabric.Internal.Strings.dll",
- "lib/net45/Microsoft.ServiceFabric.Internal.dll",
- "lib/net45/System.Fabric.Strings.dll",
- "lib/net45/System.Fabric.dll",
- "lib/net45/System.Fabric.xml"
- ]
- },
- "Microsoft.ServiceFabric.Data/2.4.164": {
- "sha512": "tePPwdBUP3tVR6zKxeWbz+3W3AEgLKv/ZOKDefQuPiq/WaY4dq2kWEF6d1N1SE7TVnMdxK/mSLIueQkCyqzcVA==",
- "type": "package",
- "path": "Microsoft.ServiceFabric.Data/2.4.164",
- "files": [
- "Microsoft.ServiceFabric.Data.2.4.164.nupkg.sha512",
- "Microsoft.ServiceFabric.Data.nuspec",
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.dll",
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.xml",
- "lib/net45/Microsoft.ServiceFabric.Data.dll",
- "lib/net45/Microsoft.ServiceFabric.Data.xml"
- ]
- },
- "Microsoft.ServiceFabric.Services/2.4.164": {
- "sha512": "nwmO9kIYEDguExQaiJYAc5QMGzBnd8sAWaFocwEWMRF/y48ljnyICCeWyuc6tNQZTNkwMi9EtQ50cl3fENaqqw==",
- "type": "package",
- "path": "Microsoft.ServiceFabric.Services/2.4.164",
- "files": [
- "Microsoft.ServiceFabric.Services.2.4.164.nupkg.sha512",
- "Microsoft.ServiceFabric.Services.nuspec",
- "lib/net45/Microsoft.ServiceFabric.Services.dll",
- "lib/net45/Microsoft.ServiceFabric.Services.xml",
- "lib/net45/ServiceFabricServiceModel.dll"
- ]
- },
- "Microsoft.WindowsAzure.ConfigurationManager/3.2.3": {
- "sha512": "pAFC2gHAuubgaw7hqSDuaEVMqip/Z0niCFVpUZ1Hg+HUw4BuMQDZnNXCm+S9SU2zPwaH8l8hXaxDXSQI438gMA==",
- "type": "package",
- "path": "Microsoft.WindowsAzure.ConfigurationManager/3.2.3",
- "files": [
- "Microsoft.WindowsAzure.ConfigurationManager.3.2.3.nupkg.sha512",
- "Microsoft.WindowsAzure.ConfigurationManager.nuspec",
- "lib/net40/Microsoft.WindowsAzure.Configuration.dll",
- "lib/net40/Microsoft.WindowsAzure.Configuration.xml"
- ]
- },
- "WindowsAzure.ServiceBus/3.4.5": {
- "sha512": "8HZeLdBQtKVFyRxwhg06eJQmkta7Bz4Ic4CXIAZVQuiYx6iNXAZiv1ywls9MAEV19xMI9y7beegxEpBE1pEApw==",
- "type": "package",
- "path": "WindowsAzure.ServiceBus/3.4.5",
- "files": [
- "WindowsAzure.ServiceBus.3.4.5.nupkg.sha512",
- "WindowsAzure.ServiceBus.nuspec",
- "content/app.config.install.xdt",
- "content/web.config.install.xdt",
- "lib/net45-full/Microsoft.ServiceBus.dll",
- "lib/net45-full/Microsoft.ServiceBus.xml"
- ]
- }
- },
- "projectFileDependencyGroups": {
- "": [
- "Microsoft.ServiceFabric.Services >= 2.4.164",
- "Microsoft.WindowsAzure.ConfigurationManager >= 3.2.3",
- "WindowsAzure.ServiceBus >= 3.4.5"
- ],
- ".NETFramework,Version=v4.5.1": [],
- ".NETFramework,Version=v4.6": []
- },
- "tools": {},
- "projectFileToolGroups": {}
-}
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/MyServiceFabricApp.sfproj b/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/MyServiceFabricApp.sfproj
index 81b35f0..6a5db96 100644
--- a/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/MyServiceFabricApp.sfproj
+++ b/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/MyServiceFabricApp.sfproj
@@ -1,9 +1,10 @@
-
-
+
+
2ccc9939-69fe-4b46-9db7-4ec86b476012
- 1.4
+ 1.6
+ 1.5
@@ -39,5 +40,9 @@
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Service Fabric Tools\Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.targets
-
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/Scripts/Deploy-FabricApplication.ps1 b/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/Scripts/Deploy-FabricApplication.ps1
index 9b43f36..2897b10 100644
--- a/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/Scripts/Deploy-FabricApplication.ps1
+++ b/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/Scripts/Deploy-FabricApplication.ps1
@@ -14,7 +14,7 @@ Path to the file containing the publish profile.
.PARAMETER ApplicationPackagePath
Path to the folder of the packaged Service Fabric application.
-.PARAMETER DeloyOnly
+.PARAMETER DeployOnly
Indicates that the Service Fabric application should not be created or upgraded after registering the application type.
.PARAMETER ApplicationParameter
@@ -139,6 +139,7 @@ function Read-PublishProfile
$publishProfile.ClusterConnectionParameters = Read-XmlElementAsHashtable $publishProfileXml.PublishProfile.Item("ClusterConnectionParameters")
$publishProfile.UpgradeDeployment = Read-XmlElementAsHashtable $publishProfileXml.PublishProfile.Item("UpgradeDeployment")
+ $publishProfile.CopyPackageParameters = Read-XmlElementAsHashtable $publishProfileXml.PublishProfile.Item("CopyPackageParameters")
if ($publishProfileXml.PublishProfile.Item("UpgradeDeployment"))
{
@@ -196,6 +197,29 @@ Import-Module "$ModuleFolderPath\ServiceFabricSDK.psm1"
$IsUpgrade = ($publishProfile.UpgradeDeployment -and $publishProfile.UpgradeDeployment.Enabled -and $OverrideUpgradeBehavior -ne 'VetoUpgrade') -or $OverrideUpgradeBehavior -eq 'ForceUpgrade'
+$PublishParameters = @{
+ 'ApplicationPackagePath' = $ApplicationPackagePath
+ 'ApplicationParameterFilePath' = $publishProfile.ApplicationParameterFile
+ 'ApplicationParameter' = $ApplicationParameter
+ 'ErrorAction' = 'Stop'
+}
+
+if ($publishProfile.CopyPackageParameters.CopyPackageTimeoutSec)
+{
+ $PublishParameters['CopyPackageTimeoutSec'] = $publishProfile.CopyPackageParameters.CopyPackageTimeoutSec
+}
+
+if ($publishProfile.CopyPackageParameters.CompressPackage)
+{
+ $PublishParameters['CompressPackage'] = $publishProfile.CopyPackageParameters.CompressPackage
+}
+
+# CopyPackageTimeoutSec parameter overrides the value from the publish profile
+if ($CopyPackageTimeoutSec)
+{
+ $PublishParameters['CopyPackageTimeoutSec'] = $CopyPackageTimeoutSec
+}
+
if ($IsUpgrade)
{
$Action = "RegisterAndUpgrade"
@@ -212,14 +236,11 @@ if ($IsUpgrade)
$UpgradeParameters = @{ UnmonitoredAuto = $true; Force = $true }
}
- if ($CopyPackageTimeoutSec)
- {
- Publish-UpgradedServiceFabricApplication -ApplicationPackagePath $ApplicationPackagePath -ApplicationParameterFilePath $publishProfile.ApplicationParameterFile -Action $Action -UpgradeParameters $UpgradeParameters -ApplicationParameter $ApplicationParameter -UnregisterUnusedVersions:$UnregisterUnusedApplicationVersionsAfterUpgrade -CopyPackageTimeoutSec $CopyPackageTimeoutSec -ErrorAction Stop
- }
- else
- {
- Publish-UpgradedServiceFabricApplication -ApplicationPackagePath $ApplicationPackagePath -ApplicationParameterFilePath $publishProfile.ApplicationParameterFile -Action $Action -UpgradeParameters $UpgradeParameters -ApplicationParameter $ApplicationParameter -UnregisterUnusedVersions:$UnregisterUnusedApplicationVersionsAfterUpgrade -ErrorAction Stop
- }
+ $PublishParameters['Action'] = $Action
+ $PublishParameters['UpgradeParameters'] = $UpgradeParameters
+ $PublishParameters['UnregisterUnusedVersions'] = $UnregisterUnusedApplicationVersionsAfterUpgrade
+
+ Publish-UpgradedServiceFabricApplication @PublishParameters
}
else
{
@@ -228,13 +249,10 @@ else
{
$Action = "Register"
}
+
+ $PublishParameters['Action'] = $Action
+ $PublishParameters['OverwriteBehavior'] = $OverwriteBehavior
+ $PublishParameters['SkipPackageValidation'] = $SkipPackageValidation
- if ($CopyPackageTimeoutSec)
- {
- Publish-NewServiceFabricApplication -ApplicationPackagePath $ApplicationPackagePath -ApplicationParameterFilePath $publishProfile.ApplicationParameterFile -Action $Action -ApplicationParameter $ApplicationParameter -OverwriteBehavior $OverwriteBehavior -SkipPackageValidation:$SkipPackageValidation -CopyPackageTimeoutSec $CopyPackageTimeoutSec -ErrorAction Stop
- }
- else
- {
- Publish-NewServiceFabricApplication -ApplicationPackagePath $ApplicationPackagePath -ApplicationParameterFilePath $publishProfile.ApplicationParameterFile -Action $Action -ApplicationParameter $ApplicationParameter -OverwriteBehavior $OverwriteBehavior -SkipPackageValidation:$SkipPackageValidation -ErrorAction Stop
- }
+ Publish-NewServiceFabricApplication @PublishParameters
}
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/packages.config b/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/packages.config
index 026023e..c5f59e4 100644
--- a/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/packages.config
+++ b/ServiceFabric.ServiceBus.Demo/MyServiceFabricApp/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/SampleQueueListeningStatefulService.csproj b/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/SampleQueueListeningStatefulService.csproj
index c6ff6f2..281132a 100644
--- a/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/SampleQueueListeningStatefulService.csproj
+++ b/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/SampleQueueListeningStatefulService.csproj
@@ -12,6 +12,7 @@
v4.5.1
512
true
+ True
true
@@ -38,28 +39,23 @@
- ..\..\packages\WindowsAzure.ServiceBus.3.4.5\lib\net45-full\Microsoft.ServiceBus.dll
- True
+ ..\..\packages\WindowsAzure.ServiceBus.4.1.0\lib\net45-full\Microsoft.ServiceBus.dll
- ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.6.204\lib\net45\Microsoft.ServiceFabric.Data.dll
- ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.6.204\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
True
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\Microsoft.ServiceFabric.Internal.dll
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
- ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\Microsoft.ServiceFabric.Services.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.6.204\lib\net45\Microsoft.ServiceFabric.Services.dll
..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
@@ -69,18 +65,20 @@
..\..\packages\ServiceFabric.ServiceBus.Services.4.5.0\lib\net451\ServiceFabric.ServiceBus.Services.dll
True
-
- ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\ServiceFabricServiceModel.dll
- True
-
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.dll
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.dll
True
+
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Management.ServiceModel.dll
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Management.ServiceModel.XmlSerializers.dll
+
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.Strings.dll
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Strings.dll
True
diff --git a/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/packages.config b/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/packages.config
index f476f24..52eeed5 100644
--- a/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/packages.config
+++ b/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/packages.config
@@ -1,9 +1,9 @@
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/SampleQueueListeningStatelessService.csproj b/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/SampleQueueListeningStatelessService.csproj
index b71e8e0..d84e85e 100644
--- a/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/SampleQueueListeningStatelessService.csproj
+++ b/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/SampleQueueListeningStatelessService.csproj
@@ -12,6 +12,7 @@
v4.5.1
512
true
+ True
true
@@ -38,28 +39,23 @@
- ..\..\packages\WindowsAzure.ServiceBus.3.4.5\lib\net45-full\Microsoft.ServiceBus.dll
- True
+ ..\..\packages\WindowsAzure.ServiceBus.4.1.0\lib\net45-full\Microsoft.ServiceBus.dll
- ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.6.204\lib\net45\Microsoft.ServiceFabric.Data.dll
- ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.6.204\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
True
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\Microsoft.ServiceFabric.Internal.dll
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
- ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\Microsoft.ServiceFabric.Services.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.6.204\lib\net45\Microsoft.ServiceFabric.Services.dll
..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
@@ -69,18 +65,20 @@
..\..\packages\ServiceFabric.ServiceBus.Services.4.5.0\lib\net451\ServiceFabric.ServiceBus.Services.dll
True
-
- ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\ServiceFabricServiceModel.dll
- True
-
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.dll
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.dll
True
+
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Management.ServiceModel.dll
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Management.ServiceModel.XmlSerializers.dll
+
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.Strings.dll
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Strings.dll
True
diff --git a/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/packages.config b/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/packages.config
index f476f24..52eeed5 100644
--- a/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/packages.config
+++ b/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/packages.config
@@ -1,9 +1,9 @@
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/SampleSubscriptionListeningStatefulService.csproj b/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/SampleSubscriptionListeningStatefulService.csproj
index 7e3878a..53c48b6 100644
--- a/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/SampleSubscriptionListeningStatefulService.csproj
+++ b/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/SampleSubscriptionListeningStatefulService.csproj
@@ -12,6 +12,7 @@
v4.5.1
512
true
+ True
true
@@ -38,28 +39,23 @@
- ..\..\packages\WindowsAzure.ServiceBus.3.4.5\lib\net45-full\Microsoft.ServiceBus.dll
- True
+ ..\..\packages\WindowsAzure.ServiceBus.4.1.0\lib\net45-full\Microsoft.ServiceBus.dll
- ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.6.204\lib\net45\Microsoft.ServiceFabric.Data.dll
- ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.6.204\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
True
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\Microsoft.ServiceFabric.Internal.dll
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
- ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\Microsoft.ServiceFabric.Services.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.6.204\lib\net45\Microsoft.ServiceFabric.Services.dll
..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
@@ -69,18 +65,20 @@
..\..\packages\ServiceFabric.ServiceBus.Services.4.5.0\lib\net451\ServiceFabric.ServiceBus.Services.dll
True
-
- ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\ServiceFabricServiceModel.dll
- True
-
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.dll
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.dll
True
+
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Management.ServiceModel.dll
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Management.ServiceModel.XmlSerializers.dll
+
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.Strings.dll
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Strings.dll
True
diff --git a/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/packages.config b/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/packages.config
index f476f24..52eeed5 100644
--- a/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/packages.config
+++ b/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/packages.config
@@ -1,9 +1,9 @@
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/SampleSubscriptionListeningStatelessService.csproj b/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/SampleSubscriptionListeningStatelessService.csproj
index 11b8f1e..968854e 100644
--- a/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/SampleSubscriptionListeningStatelessService.csproj
+++ b/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/SampleSubscriptionListeningStatelessService.csproj
@@ -12,6 +12,7 @@
v4.5.1
512
true
+ True
true
@@ -38,28 +39,23 @@
- ..\..\packages\WindowsAzure.ServiceBus.3.4.5\lib\net45-full\Microsoft.ServiceBus.dll
- True
+ ..\..\packages\WindowsAzure.ServiceBus.4.1.0\lib\net45-full\Microsoft.ServiceBus.dll
- ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.6.204\lib\net45\Microsoft.ServiceFabric.Data.dll
- ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.6.204\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
True
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\Microsoft.ServiceFabric.Internal.dll
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
- ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\Microsoft.ServiceFabric.Services.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.6.204\lib\net45\Microsoft.ServiceFabric.Services.dll
..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
@@ -69,18 +65,20 @@
..\..\packages\ServiceFabric.ServiceBus.Services.4.5.0\lib\net451\ServiceFabric.ServiceBus.Services.dll
True
-
- ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\ServiceFabricServiceModel.dll
- True
-
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.dll
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.dll
True
+
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Management.ServiceModel.dll
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Management.ServiceModel.XmlSerializers.dll
+
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.Strings.dll
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Strings.dll
True
diff --git a/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/packages.config b/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/packages.config
index f476f24..52eeed5 100644
--- a/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/packages.config
+++ b/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/packages.config
@@ -1,9 +1,9 @@
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Demo/TestClient/TestClient.csproj b/ServiceFabric.ServiceBus.Demo/TestClient/TestClient.csproj
index dcf21d8..72c86b3 100644
--- a/ServiceFabric.ServiceBus.Demo/TestClient/TestClient.csproj
+++ b/ServiceFabric.ServiceBus.Demo/TestClient/TestClient.csproj
@@ -34,28 +34,23 @@
- ..\..\packages\WindowsAzure.ServiceBus.3.4.5\lib\net45-full\Microsoft.ServiceBus.dll
- True
+ ..\..\packages\WindowsAzure.ServiceBus.4.1.0\lib\net45-full\Microsoft.ServiceBus.dll
- ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.6.204\lib\net45\Microsoft.ServiceFabric.Data.dll
- ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.6.204\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
True
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\Microsoft.ServiceFabric.Internal.dll
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
- ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\Microsoft.ServiceFabric.Services.dll
- True
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.6.204\lib\net45\Microsoft.ServiceFabric.Services.dll
..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
@@ -65,18 +60,20 @@
..\..\packages\ServiceFabric.ServiceBus.Clients.4.5.0\lib\net46\ServiceFabric.ServiceBus.Clients.dll
True
-
- ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\ServiceFabricServiceModel.dll
- True
-
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.dll
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.dll
True
+
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Management.ServiceModel.dll
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Management.ServiceModel.XmlSerializers.dll
+
- ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.Strings.dll
+ ..\..\packages\Microsoft.ServiceFabric.5.6.204\lib\net45\System.Fabric.Strings.dll
True
diff --git a/ServiceFabric.ServiceBus.Demo/TestClient/packages.config b/ServiceFabric.ServiceBus.Demo/TestClient/packages.config
index 21f8af2..265583c 100644
--- a/ServiceFabric.ServiceBus.Demo/TestClient/packages.config
+++ b/ServiceFabric.ServiceBus.Demo/TestClient/packages.config
@@ -1,9 +1,9 @@
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Services.sln b/ServiceFabric.ServiceBus.Services.sln
index 85a33c4..efabcfe 100644
--- a/ServiceFabric.ServiceBus.Services.sln
+++ b/ServiceFabric.ServiceBus.Services.sln
@@ -1,10 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25123.0
+# Visual Studio 15
+VisualStudioVersion = 15.0.26510.0
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ServiceFabric.ServiceBus.Services", "ServiceFabric.ServiceBus.Services\ServiceFabric.ServiceBus.Services.xproj", "{0C1AD577-93E3-437C-A0C7-5918E0F4D575}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AEE7481C-A281-41EA-A7D4-A70C786E47A1}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
@@ -12,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServiceFabric.ServiceBus.Services", "ServiceFabric.ServiceBus.Services\ServiceFabric.ServiceBus.Services.csproj", "{0C1AD577-93E3-437C-A0C7-5918E0F4D575}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
diff --git a/ServiceFabric.ServiceBus.Services/ServiceFabric.ServiceBus.Services.csproj b/ServiceFabric.ServiceBus.Services/ServiceFabric.ServiceBus.Services.csproj
new file mode 100644
index 0000000..be442b3
--- /dev/null
+++ b/ServiceFabric.ServiceBus.Services/ServiceFabric.ServiceBus.Services.csproj
@@ -0,0 +1,48 @@
+
+
+
+ Receive BrokeredMessages in ServiceFabric Services through Service Bus. Add this package to your Reliable Service projects. The ServiceFabric.ServiceBus.Services Class Library can be used in conjunction with ServiceFabric.ServiceBus.Clients (optional)
+ 2017
+ 5.0.0
+ Loek Duys
+ net451;net46
+ x64
+ ServiceFabric.ServiceBus.Services
+ ServiceFabric.ServiceBus.Services
+ ServiceFabric;Service;Fabric;ServiceBus;Bus;Reliable
+ https://github.com/loekd/ServiceFabric.ServiceBus
+ https://github.com/loekd/ServiceFabric.ServiceBus/blob/master/LICENSE
+ true
+ git
+ https://github.com/loekd/ServiceFabric.ServiceBus.git
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ServiceFabric.ServiceBus.Services/ServiceFabric.ServiceBus.Services.xproj b/ServiceFabric.ServiceBus.Services/ServiceFabric.ServiceBus.Services.xproj
deleted file mode 100644
index 017f9b1..0000000
--- a/ServiceFabric.ServiceBus.Services/ServiceFabric.ServiceBus.Services.xproj
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
- 14.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
-
- 0c1ad577-93e3-437c-a0c7-5918e0f4d575
- ServiceFabric.ServiceBus.Services
- ..\artifacts\obj\$(MSBuildProjectName)
- ..\artifacts\bin\$(MSBuildProjectName)
-
-
- 2.0
-
-
- True
-
-
- True
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ServiceFabric.ServiceBus.Services/project.json b/ServiceFabric.ServiceBus.Services/project.json
deleted file mode 100644
index 2bdc107..0000000
--- a/ServiceFabric.ServiceBus.Services/project.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "version": "4.6.0",
- "copyright": "2017",
- "packOptions": {
- "requireLicenseAcceptance": true,
- "summary": "Adds Reliable communication to and between ServiceFabric Reliable Services, using Service Bus. Supports Queues, Topics, Batching. This is the Service Package for receiving BrokeredMessages.",
- "tags": [ "ServiceFabric", "Service", "Fabric", "ServiceBus", "Bus", "Reliable" ],
- "projectUrl": "https://github.com/loekd/ServiceFabric.ServiceBus",
- "licenseUrl": "https://github.com/loekd/ServiceFabric.ServiceBus/blob/master/LICENSE",
- "repository": {
- "type": "git",
- "url": "https://github.com/loekd/ServiceFabric.ServiceBus.git"
- },
- "files": {
- "include": "content/**"
- }
- },
- "description": "Receive BrokeredMessages in ServiceFabric Services through Service Bus. Add this package to your Reliable Service projects. The ServiceFabric.ServiceBus.Services Class Library can be used in conjunction with ServiceFabric.ServiceBus.Clients (optional)",
- "authors": [ "Loek Duys" ],
- "buildOptions": {
- "platform": "x64"
- },
- "frameworks": {
- "net451": {
- },
- "net460": {
- }
- },
- "dependencies": {
- "Microsoft.ServiceFabric.Services": "2.5.216",
- "Microsoft.WindowsAzure.ConfigurationManager": "3.2.3",
- "WindowsAzure.ServiceBus": "4.0.0"
- }
-}
diff --git a/ServiceFabric.ServiceBus.Services/project.lock.json b/ServiceFabric.ServiceBus.Services/project.lock.json
deleted file mode 100644
index 6afc0b4..0000000
--- a/ServiceFabric.ServiceBus.Services/project.lock.json
+++ /dev/null
@@ -1,231 +0,0 @@
-{
- "locked": false,
- "version": 2,
- "targets": {
- ".NETFramework,Version=v4.5.1": {
- "Microsoft.ServiceFabric/5.5.216": {
- "type": "package",
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Internal.Strings.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Internal.dll": {},
- "lib/net45/System.Fabric.Management.ServiceModel.XmlSerializers.dll": {},
- "lib/net45/System.Fabric.Management.ServiceModel.dll": {},
- "lib/net45/System.Fabric.Strings.dll": {},
- "lib/net45/System.Fabric.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Internal.Strings.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Internal.dll": {},
- "lib/net45/System.Fabric.Management.ServiceModel.XmlSerializers.dll": {},
- "lib/net45/System.Fabric.Management.ServiceModel.dll": {},
- "lib/net45/System.Fabric.Strings.dll": {},
- "lib/net45/System.Fabric.dll": {}
- }
- },
- "Microsoft.ServiceFabric.Data/2.5.216": {
- "type": "package",
- "dependencies": {
- "Microsoft.ServiceFabric": "[5.5.216]"
- },
- "frameworkAssemblies": [
- "System.Runtime.Serialization"
- ],
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Data.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Data.dll": {}
- }
- },
- "Microsoft.ServiceFabric.Services/2.5.216": {
- "type": "package",
- "dependencies": {
- "Microsoft.ServiceFabric": "[5.5.216]",
- "Microsoft.ServiceFabric.Data": "[2.5.216]"
- },
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Services.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Services.dll": {}
- }
- },
- "Microsoft.WindowsAzure.ConfigurationManager/3.2.3": {
- "type": "package",
- "compile": {
- "lib/net40/Microsoft.WindowsAzure.Configuration.dll": {}
- },
- "runtime": {
- "lib/net40/Microsoft.WindowsAzure.Configuration.dll": {}
- }
- },
- "WindowsAzure.ServiceBus/4.0.0": {
- "type": "package",
- "frameworkAssemblies": [
- "System.Runtime.Serialization",
- "System.ServiceModel",
- "System.Xml"
- ],
- "compile": {
- "lib/net45-full/Microsoft.ServiceBus.dll": {}
- },
- "runtime": {
- "lib/net45-full/Microsoft.ServiceBus.dll": {}
- }
- }
- },
- ".NETFramework,Version=v4.6": {
- "Microsoft.ServiceFabric/5.5.216": {
- "type": "package",
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Internal.Strings.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Internal.dll": {},
- "lib/net45/System.Fabric.Management.ServiceModel.XmlSerializers.dll": {},
- "lib/net45/System.Fabric.Management.ServiceModel.dll": {},
- "lib/net45/System.Fabric.Strings.dll": {},
- "lib/net45/System.Fabric.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Internal.Strings.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Internal.dll": {},
- "lib/net45/System.Fabric.Management.ServiceModel.XmlSerializers.dll": {},
- "lib/net45/System.Fabric.Management.ServiceModel.dll": {},
- "lib/net45/System.Fabric.Strings.dll": {},
- "lib/net45/System.Fabric.dll": {}
- }
- },
- "Microsoft.ServiceFabric.Data/2.5.216": {
- "type": "package",
- "dependencies": {
- "Microsoft.ServiceFabric": "[5.5.216]"
- },
- "frameworkAssemblies": [
- "System.Runtime.Serialization"
- ],
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Data.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.dll": {},
- "lib/net45/Microsoft.ServiceFabric.Data.dll": {}
- }
- },
- "Microsoft.ServiceFabric.Services/2.5.216": {
- "type": "package",
- "dependencies": {
- "Microsoft.ServiceFabric": "[5.5.216]",
- "Microsoft.ServiceFabric.Data": "[2.5.216]"
- },
- "compile": {
- "lib/net45/Microsoft.ServiceFabric.Services.dll": {}
- },
- "runtime": {
- "lib/net45/Microsoft.ServiceFabric.Services.dll": {}
- }
- },
- "Microsoft.WindowsAzure.ConfigurationManager/3.2.3": {
- "type": "package",
- "compile": {
- "lib/net40/Microsoft.WindowsAzure.Configuration.dll": {}
- },
- "runtime": {
- "lib/net40/Microsoft.WindowsAzure.Configuration.dll": {}
- }
- },
- "WindowsAzure.ServiceBus/4.0.0": {
- "type": "package",
- "frameworkAssemblies": [
- "System.Runtime.Serialization",
- "System.ServiceModel",
- "System.Xml"
- ],
- "compile": {
- "lib/net45-full/Microsoft.ServiceBus.dll": {}
- },
- "runtime": {
- "lib/net45-full/Microsoft.ServiceBus.dll": {}
- }
- }
- }
- },
- "libraries": {
- "Microsoft.ServiceFabric/5.5.216": {
- "sha512": "H+FCJy4ZdaWBPLIbuVT8wTI0yaQs+sUIXtJpC1DSyuwh3900lvQNWV8VC4gLo5lFpth1kXvV78KSZL1fjuV6rQ==",
- "type": "package",
- "path": "Microsoft.ServiceFabric/5.5.216",
- "files": [
- "Microsoft.ServiceFabric.5.5.216.nupkg.sha512",
- "Microsoft.ServiceFabric.nuspec",
- "lib/net45/Microsoft.ServiceFabric.Internal.Strings.dll",
- "lib/net45/Microsoft.ServiceFabric.Internal.dll",
- "lib/net45/System.Fabric.Management.ServiceModel.XmlSerializers.dll",
- "lib/net45/System.Fabric.Management.ServiceModel.dll",
- "lib/net45/System.Fabric.Strings.dll",
- "lib/net45/System.Fabric.dll",
- "lib/net45/System.Fabric.xml"
- ]
- },
- "Microsoft.ServiceFabric.Data/2.5.216": {
- "sha512": "M0oiBm65HORyj13XvegA09yB4lXaVqal8UIQgEs82O/Ed1fR8Dir0MIH/9fbA0vfoGDbWp9/kJXqG0aDTqYcuQ==",
- "type": "package",
- "path": "Microsoft.ServiceFabric.Data/2.5.216",
- "files": [
- "Microsoft.ServiceFabric.Data.2.5.216.nupkg.sha512",
- "Microsoft.ServiceFabric.Data.nuspec",
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.dll",
- "lib/net45/Microsoft.ServiceFabric.Data.Interfaces.xml",
- "lib/net45/Microsoft.ServiceFabric.Data.dll",
- "lib/net45/Microsoft.ServiceFabric.Data.xml"
- ]
- },
- "Microsoft.ServiceFabric.Services/2.5.216": {
- "sha512": "PFBuKDMAqqIty65tiOzOYqM8Hdk/GTmfr8AjK/W3BCe8nUB2DW2yOEQXgolyb5WNGLF5+SEz5Y3MD04VtdplQg==",
- "type": "package",
- "path": "Microsoft.ServiceFabric.Services/2.5.216",
- "files": [
- "Microsoft.ServiceFabric.Services.2.5.216.nupkg.sha512",
- "Microsoft.ServiceFabric.Services.nuspec",
- "lib/net45/Microsoft.ServiceFabric.Services.dll",
- "lib/net45/Microsoft.ServiceFabric.Services.xml"
- ]
- },
- "Microsoft.WindowsAzure.ConfigurationManager/3.2.3": {
- "sha512": "pAFC2gHAuubgaw7hqSDuaEVMqip/Z0niCFVpUZ1Hg+HUw4BuMQDZnNXCm+S9SU2zPwaH8l8hXaxDXSQI438gMA==",
- "type": "package",
- "path": "Microsoft.WindowsAzure.ConfigurationManager/3.2.3",
- "files": [
- "Microsoft.WindowsAzure.ConfigurationManager.3.2.3.nupkg.sha512",
- "Microsoft.WindowsAzure.ConfigurationManager.nuspec",
- "lib/net40/Microsoft.WindowsAzure.Configuration.dll",
- "lib/net40/Microsoft.WindowsAzure.Configuration.xml"
- ]
- },
- "WindowsAzure.ServiceBus/4.0.0": {
- "sha512": "uI3mmHIvrJR0K/3Pl42f3Fw7H5sC6PrSUUp+4UeZYzFKSZZQ7kAe/XJ2TOGWGASa8W5re1AijV9GIuMTbN64qw==",
- "type": "package",
- "path": "WindowsAzure.ServiceBus/4.0.0",
- "files": [
- "WindowsAzure.ServiceBus.4.0.0.nupkg.sha512",
- "WindowsAzure.ServiceBus.nuspec",
- "content/app.config.install.xdt",
- "content/web.config.install.xdt",
- "lib/net45-full/Microsoft.ServiceBus.dll",
- "lib/net45-full/Microsoft.ServiceBus.xml"
- ]
- }
- },
- "projectFileDependencyGroups": {
- "": [
- "Microsoft.ServiceFabric.Services >= 2.5.216",
- "Microsoft.WindowsAzure.ConfigurationManager >= 3.2.3",
- "WindowsAzure.ServiceBus >= 4.0.0"
- ],
- ".NETFramework,Version=v4.5.1": [],
- ".NETFramework,Version=v4.6": []
- },
- "tools": {},
- "projectFileToolGroups": {}
-}
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/App.config b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/App.config
new file mode 100644
index 0000000..15abf4f
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/App.config
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/PackageRoot/Config/Settings.xml b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/PackageRoot/Config/Settings.xml
new file mode 100644
index 0000000..be6a4cd
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/PackageRoot/Config/Settings.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/PackageRoot/ServiceManifest.xml b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/PackageRoot/ServiceManifest.xml
new file mode 100644
index 0000000..1c8a738
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/PackageRoot/ServiceManifest.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+ SampleQueueListeningStatefulService.exe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/Program.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/Program.cs
new file mode 100644
index 0000000..de10ccb
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/Program.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Diagnostics;
+using System.Fabric;
+using System.Threading;
+using Microsoft.ServiceFabric.Services.Runtime;
+
+namespace SampleQueueListeningStatefulService
+{
+ internal static class Program
+ {
+ ///
+ /// This is the entry point of the service host process.
+ ///
+ private static void Main()
+ {
+ try
+ {
+ ServiceRuntime.RegisterServiceAsync("SampleQueueListeningStatefulServiceType", context => new SampleQueueListeningStatefulService(context)).GetAwaiter().GetResult();
+ ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(SampleQueueListeningStatefulService).Name);
+ Thread.Sleep(Timeout.Infinite); // Prevents this host process from terminating to keep the service host process running.
+ }
+ catch (Exception e)
+ {
+ ServiceEventSource.Current.ServiceHostInitializationFailed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/Properties/AssemblyInfo.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..de87be8
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("SampleQueueListeningStatefulService")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("SampleQueueListeningStatefulService")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("12818388-137f-4fc7-85e8-71d99cd3e06b")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/ReadMe.txt b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/ReadMe.txt
new file mode 100644
index 0000000..fc1049b
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/ReadMe.txt
@@ -0,0 +1 @@
+Go to https://github.com/loekd/ServiceFabric.ServiceBus for more details.
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/SampleQueueListeningStatefulService.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/SampleQueueListeningStatefulService.cs
new file mode 100644
index 0000000..4015b45
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/SampleQueueListeningStatefulService.cs
@@ -0,0 +1,64 @@
+using Microsoft.ServiceFabric.Services.Communication.Runtime;
+using Microsoft.ServiceFabric.Services.Runtime;
+using System.Collections.Generic;
+using System.Fabric;
+using System.Threading;
+using Microsoft.Azure;
+using Microsoft.ServiceBus.Messaging;
+using Microsoft.ServiceFabric.Data;
+using ServiceFabric.ServiceBus.Services;
+using ServiceFabric.ServiceBus.Services.CommunicationListeners;
+using System;
+using System.Threading.Tasks;
+
+namespace SampleQueueListeningStatefulService
+{
+ ///
+ /// The FabricRuntime creates an instance of this class for each service type instance.
+ ///
+ internal sealed class SampleQueueListeningStatefulService : StatefulService
+ {
+ public SampleQueueListeningStatefulService(StatefulServiceContext serviceContext) : base(serviceContext)
+ {
+ }
+
+ public SampleQueueListeningStatefulService(StatefulServiceContext serviceContext, IReliableStateManagerReplica reliableStateManagerReplica) : base(serviceContext, reliableStateManagerReplica)
+ {
+ }
+
+ protected override IEnumerable CreateServiceReplicaListeners()
+ {
+ // In the configuration file, define connection strings:
+ // "Microsoft.ServiceBus.ConnectionString.Receive"
+ // and "Microsoft.ServiceBus.ConnectionString.Send"
+
+ // Also, define a QueueName:
+ //string serviceBusQueueName = CloudConfigurationManager.GetSetting("QueueName");
+ string serviceBusQueueName = null; //using entity path.
+ //alternative: CloudConfigurationManager.GetSetting("QueueName");
+ yield return new ServiceReplicaListener(context => new ServiceBusQueueCommunicationListener(
+ new Handler(this)
+ , context
+ , serviceBusQueueName
+ , requireSessions: true), "StatefulService-ServiceBusSubscriptionListener");
+ }
+
+
+ }
+
+ internal sealed class Handler : AutoCompleteServiceBusMessageReceiver
+ {
+ private readonly StatefulService _service;
+
+ public Handler(StatefulService service)
+ {
+ _service = service;
+ }
+
+ protected override Task ReceiveMessageImplAsync(BrokeredMessage message, MessageSession session, CancellationToken cancellationToken)
+ {
+ ServiceEventSource.Current.ServiceMessage(_service, $"Handling queue message {message.MessageId} in session {session?.SessionId ?? "none"}");
+ return Task.FromResult(true);
+ }
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/SampleQueueListeningStatefulService.csproj b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/SampleQueueListeningStatefulService.csproj
new file mode 100644
index 0000000..c6ff6f2
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/SampleQueueListeningStatefulService.csproj
@@ -0,0 +1,128 @@
+
+
+
+
+ Debug
+ x64
+ {12818388-137F-4FC7-85E8-71D99CD3E06B}
+ Exe
+ Properties
+ SampleQueueListeningStatefulService
+ SampleQueueListeningStatefulService
+ v4.5.1
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\x64\Debug\
+ DEBUG;TRACE
+ prompt
+ x64
+ MinimumRecommendedRules.ruleset
+
+
+ pdbonly
+ true
+ bin\x64\Release\
+ TRACE
+ prompt
+ x64
+ MinimumRecommendedRules.ruleset
+
+
+ $(AdditionalFileItemNames);None
+
+
+
+
+ ..\..\packages\WindowsAzure.ServiceBus.3.4.5\lib\net45-full\Microsoft.ServiceBus.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\Microsoft.ServiceFabric.Services.dll
+ True
+
+
+ ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
+ True
+
+
+ ..\..\packages\ServiceFabric.ServiceBus.Services.4.5.0\lib\net451\ServiceFabric.ServiceBus.Services.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\ServiceFabricServiceModel.dll
+ True
+
+
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.Strings.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ App.config
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(TargetFileName).config
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/ServiceEventSource.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/ServiceEventSource.cs
new file mode 100644
index 0000000..d65173c
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/ServiceEventSource.cs
@@ -0,0 +1,107 @@
+using Microsoft.ServiceFabric.Services.Runtime;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.Tracing;
+using System.Fabric;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SampleQueueListeningStatefulService
+{
+ [EventSource(Name = "Xpirit-MyServiceFabricApp-SampleQueueListeningStatefulService")]
+ internal sealed class ServiceEventSource : EventSource
+ {
+ public static ServiceEventSource Current = new ServiceEventSource();
+
+ [NonEvent]
+ public void Message(string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.Message(finalMessage);
+ }
+ }
+
+ [Event(1, Level = EventLevel.Informational, Message = "{0}")]
+ public void Message(string message)
+ {
+ if (this.IsEnabled())
+ {
+ this.WriteEvent(1, message);
+ }
+ }
+
+ [NonEvent]
+ public void ServiceMessage(StatelessService service, string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.ServiceMessage(
+ service.Context.ServiceName.ToString(),
+ service.Context.ServiceTypeName,
+ service.Context.InstanceId,
+ service.Context.PartitionId,
+ service.Context.CodePackageActivationContext.ApplicationName,
+ service.Context.CodePackageActivationContext.ApplicationTypeName,
+ FabricRuntime.GetNodeContext().NodeName,
+ finalMessage);
+ }
+ }
+
+ [NonEvent]
+ public void ServiceMessage(StatefulService service, string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.ServiceMessage(
+ service.Context.ServiceName.ToString(),
+ service.Context.ServiceTypeName,
+ service.Context.ReplicaId,
+ service.Context.PartitionId,
+ service.Context.CodePackageActivationContext.ApplicationName,
+ service.Context.CodePackageActivationContext.ApplicationTypeName,
+ FabricRuntime.GetNodeContext().NodeName,
+ finalMessage);
+ }
+ }
+
+ [Event(3, Level = EventLevel.Informational, Message = "Service host process {0} registered service type {1}")]
+ public void ServiceTypeRegistered(int hostProcessId, string serviceType)
+ {
+ this.WriteEvent(3, hostProcessId, serviceType);
+ }
+
+ [NonEvent]
+ public void ServiceHostInitializationFailed(Exception e)
+ {
+ this.ServiceHostInitializationFailed(e.ToString());
+ }
+
+ [Event(2, Level = EventLevel.Informational, Message = "{7}")]
+ private void ServiceMessage(
+ string serviceName,
+ string serviceTypeName,
+ long replicaOrInstanceId,
+ Guid partitionId,
+ string applicationName,
+ string applicationTypeName,
+ string nodeName,
+ string message)
+ {
+ if (this.IsEnabled())
+ {
+ this.WriteEvent(2, serviceName, serviceTypeName, replicaOrInstanceId, partitionId, applicationName, applicationTypeName, nodeName, message);
+ }
+ }
+
+ [Event(4, Level = EventLevel.Error, Message = "Service host initialization failed")]
+ private void ServiceHostInitializationFailed(string exception)
+ {
+ this.WriteEvent(4, exception);
+ }
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/packages.config b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/packages.config
new file mode 100644
index 0000000..f476f24
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatefulService/packages.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/App.config b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/App.config
new file mode 100644
index 0000000..372d01b
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/App.config
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/PackageRoot/Config/Settings.xml b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/PackageRoot/Config/Settings.xml
new file mode 100644
index 0000000..ad84ffd
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/PackageRoot/Config/Settings.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/PackageRoot/ServiceManifest.xml b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/PackageRoot/ServiceManifest.xml
new file mode 100644
index 0000000..d238ca2
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/PackageRoot/ServiceManifest.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+ SampleQueueListeningStatelessService.exe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/Program.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/Program.cs
new file mode 100644
index 0000000..7d1b02b
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/Program.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Diagnostics;
+using System.Fabric;
+using System.Threading;
+using Microsoft.ServiceFabric.Services.Runtime;
+
+namespace SampleQueueListeningStatelessService
+{
+ internal static class Program
+ {
+ ///
+ /// This is the entry point of the service host process.
+ ///
+ private static void Main()
+ {
+ try
+ {
+ ServiceRuntime.RegisterServiceAsync("SampleQueueListeningStatelessServiceType", context => new SampleQueueListeningStatelessService(context)).GetAwaiter().GetResult();
+ ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(SampleQueueListeningStatelessService).Name);
+ Thread.Sleep(Timeout.Infinite); // Prevents this host process from terminating so services keeps running.
+ }
+ catch (Exception e)
+ {
+ ServiceEventSource.Current.ServiceHostInitializationFailed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/Properties/AssemblyInfo.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..1cac746
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("SampleQueueListeningStatelessService")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("SampleQueueListeningStatelessService")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("54793e75-80d0-4bfa-8ab6-82e3d2884f80")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/ReadMe.txt b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/ReadMe.txt
new file mode 100644
index 0000000..fc1049b
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/ReadMe.txt
@@ -0,0 +1 @@
+Go to https://github.com/loekd/ServiceFabric.ServiceBus for more details.
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/SampleQueueListeningStatelessService.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/SampleQueueListeningStatelessService.cs
new file mode 100644
index 0000000..2aedaa1
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/SampleQueueListeningStatelessService.cs
@@ -0,0 +1,67 @@
+using System;
+using Microsoft.ServiceFabric.Services.Communication.Runtime;
+using Microsoft.ServiceFabric.Services.Runtime;
+using System.Collections.Generic;
+using System.Fabric;
+using System.Threading;
+using Microsoft.Azure;
+using Microsoft.ServiceBus.Messaging;
+using ServiceFabric.ServiceBus.Services;
+using ServiceFabric.ServiceBus.Services.CommunicationListeners;
+using System.Threading.Tasks;
+
+namespace SampleQueueListeningStatelessService
+{
+ ///
+ /// The FabricRuntime creates an instance of this class for each service type instance.
+ ///
+ internal sealed class SampleQueueListeningStatelessService : StatelessService
+ {
+ public SampleQueueListeningStatelessService(StatelessServiceContext serviceContext) : base(serviceContext)
+ {
+ }
+
+ protected override IEnumerable CreateServiceInstanceListeners()
+ {
+ // In the configuration file, define connection strings:
+ // "Microsoft.ServiceBus.ConnectionString.Receive"
+ // and "Microsoft.ServiceBus.ConnectionString.Send"
+
+ // Also, define a QueueName:
+ string serviceBusQueueName = null; //using entity path.
+ //alternative: CloudConfigurationManager.GetSetting("QueueName");
+ Action logAction = log => ServiceEventSource.Current.ServiceMessage(this, log);
+ yield return new ServiceInstanceListener(context => new ServiceBusQueueCommunicationListener(
+ new Handler(logAction)
+ , context
+ , serviceBusQueueName
+ , requireSessions: false)
+ {
+ AutoRenewTimeout = TimeSpan.FromSeconds(70), //auto renew up until 70s, so processing can take no longer than 60s (default lock duration).
+ LogAction = logAction,
+ MessagePrefetchCount = 10
+ }, "StatelessService-ServiceBusQueueListener");
+ }
+
+
+ }
+
+ internal sealed class Handler : AutoCompleteServiceBusMessageReceiver
+ {
+
+ public Handler(Action logAction)
+ :base(logAction)
+ {
+ }
+
+
+ protected override Task ReceiveMessageImplAsync(BrokeredMessage message, MessageSession session, CancellationToken cancellationToken)
+ {
+ WriteLog($"Sleeping for 7s while processing queue message {message.MessageId} to test message lock renew function (send more than 9 messages!).");
+ Thread.Sleep(TimeSpan.FromSeconds(7));
+
+ WriteLog($"Handling queue message {message.MessageId}");
+ return Task.FromResult(true);
+ }
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/SampleQueueListeningStatelessService.csproj b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/SampleQueueListeningStatelessService.csproj
new file mode 100644
index 0000000..b71e8e0
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/SampleQueueListeningStatelessService.csproj
@@ -0,0 +1,128 @@
+
+
+
+
+ Debug
+ x64
+ {54793E75-80D0-4BFA-8AB6-82E3D2884F80}
+ Exe
+ Properties
+ SampleQueueListeningStatelessService
+ SampleQueueListeningStatelessService
+ v4.5.1
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\x64\Debug\
+ DEBUG;TRACE
+ prompt
+ x64
+ MinimumRecommendedRules.ruleset
+
+
+ pdbonly
+ true
+ bin\x64\Release\
+ TRACE
+ prompt
+ x64
+ MinimumRecommendedRules.ruleset
+
+
+ $(AdditionalFileItemNames);None
+
+
+
+
+ ..\..\packages\WindowsAzure.ServiceBus.3.4.5\lib\net45-full\Microsoft.ServiceBus.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\Microsoft.ServiceFabric.Services.dll
+ True
+
+
+ ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
+ True
+
+
+ ..\..\packages\ServiceFabric.ServiceBus.Services.4.5.0\lib\net451\ServiceFabric.ServiceBus.Services.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\ServiceFabricServiceModel.dll
+ True
+
+
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.Strings.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ App.config
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(TargetFileName).config
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/ServiceEventSource.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/ServiceEventSource.cs
new file mode 100644
index 0000000..e60827a
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/ServiceEventSource.cs
@@ -0,0 +1,107 @@
+using Microsoft.ServiceFabric.Services.Runtime;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.Tracing;
+using System.Fabric;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SampleQueueListeningStatelessService
+{
+ [EventSource(Name = "Xpirit-MyServiceFabricApp-SampleQueueListeningStatelessService")]
+ internal sealed class ServiceEventSource : EventSource
+ {
+ public static ServiceEventSource Current = new ServiceEventSource();
+
+ [NonEvent]
+ public void Message(string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.Message(finalMessage);
+ }
+ }
+
+ [Event(1, Level = EventLevel.Informational, Message = "{0}")]
+ public void Message(string message)
+ {
+ if (this.IsEnabled())
+ {
+ this.WriteEvent(1, message);
+ }
+ }
+
+ [NonEvent]
+ public void ServiceMessage(StatelessService service, string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.ServiceMessage(
+ service.Context.ServiceName.ToString(),
+ service.Context.ServiceTypeName,
+ service.Context.InstanceId,
+ service.Context.PartitionId,
+ service.Context.CodePackageActivationContext.ApplicationName,
+ service.Context.CodePackageActivationContext.ApplicationTypeName,
+ FabricRuntime.GetNodeContext().NodeName,
+ finalMessage);
+ }
+ }
+
+ [NonEvent]
+ public void ServiceMessage(StatefulService service, string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.ServiceMessage(
+ service.Context.ServiceName.ToString(),
+ service.Context.ServiceTypeName,
+ service.Context.ReplicaId,
+ service.Context.PartitionId,
+ service.Context.CodePackageActivationContext.ApplicationName,
+ service.Context.CodePackageActivationContext.ApplicationTypeName,
+ FabricRuntime.GetNodeContext().NodeName,
+ finalMessage);
+ }
+ }
+
+ [Event(3, Level = EventLevel.Informational, Message = "Service host process {0} registered service type {1}")]
+ public void ServiceTypeRegistered(int hostProcessId, string serviceType)
+ {
+ this.WriteEvent(3, hostProcessId, serviceType);
+ }
+
+ [NonEvent]
+ public void ServiceHostInitializationFailed(Exception e)
+ {
+ this.ServiceHostInitializationFailed(e.ToString());
+ }
+
+ [Event(2, Level = EventLevel.Informational, Message = "{7}")]
+ private void ServiceMessage(
+ string serviceName,
+ string serviceTypeName,
+ long replicaOrInstanceId,
+ Guid partitionId,
+ string applicationName,
+ string applicationTypeName,
+ string nodeName,
+ string message)
+ {
+ if (this.IsEnabled())
+ {
+ this.WriteEvent(2, serviceName, serviceTypeName, replicaOrInstanceId, partitionId, applicationName, applicationTypeName, nodeName, message);
+ }
+ }
+
+ [Event(4, Level = EventLevel.Error, Message = "Service host initialization failed")]
+ private void ServiceHostInitializationFailed(string exception)
+ {
+ this.WriteEvent(4, exception);
+ }
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/packages.config b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/packages.config
new file mode 100644
index 0000000..f476f24
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleQueueListeningStatelessService/packages.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/App.config b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/App.config
new file mode 100644
index 0000000..a54331d
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/App.config
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/PackageRoot/Config/Settings.xml b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/PackageRoot/Config/Settings.xml
new file mode 100644
index 0000000..be6a4cd
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/PackageRoot/Config/Settings.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/PackageRoot/ServiceManifest.xml b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/PackageRoot/ServiceManifest.xml
new file mode 100644
index 0000000..d9907a6
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/PackageRoot/ServiceManifest.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+ SampleSubscriptionListeningStatefulService.exe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/Program.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/Program.cs
new file mode 100644
index 0000000..ffb30eb
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/Program.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Diagnostics;
+using System.Fabric;
+using System.Threading;
+using Microsoft.ServiceFabric.Services.Runtime;
+
+namespace SampleSubscriptionListeningStatefulService
+{
+ internal static class Program
+ {
+ ///
+ /// This is the entry point of the service host process.
+ ///
+ private static void Main()
+ {
+ try
+ {
+ ServiceRuntime.RegisterServiceAsync("SampleSubscriptionListeningStatefulServiceType", context => new SampleSubscriptionListeningStatefulService(context)).GetAwaiter().GetResult();
+ ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(SampleSubscriptionListeningStatefulService).Name);
+ Thread.Sleep(Timeout.Infinite); // Prevents this host process from terminating to keep the service host process running.
+ }
+ catch (Exception e)
+ {
+ ServiceEventSource.Current.ServiceHostInitializationFailed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/Properties/AssemblyInfo.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..2eb2135
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("SampleSubscriptionListeningStatefulService")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("SampleSubscriptionListeningStatefulService")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("b092dd86-2104-4531-9eab-bfb10b1e0242")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/ReadMe.txt b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/ReadMe.txt
new file mode 100644
index 0000000..fc1049b
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/ReadMe.txt
@@ -0,0 +1 @@
+Go to https://github.com/loekd/ServiceFabric.ServiceBus for more details.
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/SampleSubscriptionListeningStatefulService.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/SampleSubscriptionListeningStatefulService.cs
new file mode 100644
index 0000000..839116f
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/SampleSubscriptionListeningStatefulService.cs
@@ -0,0 +1,74 @@
+using Microsoft.ServiceFabric.Services.Communication.Runtime;
+using Microsoft.ServiceFabric.Services.Runtime;
+using System.Collections.Generic;
+using System.Fabric;
+using System.Linq;
+using System.Threading;
+using Microsoft.Azure;
+using Microsoft.ServiceBus.Messaging;
+using Microsoft.ServiceFabric.Data;
+using ServiceFabric.ServiceBus.Services;
+using ServiceFabric.ServiceBus.Services.CommunicationListeners;
+using System.Threading.Tasks;
+
+namespace SampleSubscriptionListeningStatefulService
+{
+ ///
+ /// The FabricRuntime creates an instance of this class for each service type instance.
+ ///
+ internal sealed class SampleSubscriptionListeningStatefulService : StatefulService
+ {
+ public SampleSubscriptionListeningStatefulService(StatefulServiceContext serviceContext) : base(serviceContext)
+ {
+ }
+
+ public SampleSubscriptionListeningStatefulService(StatefulServiceContext serviceContext, IReliableStateManagerReplica reliableStateManagerReplica) : base(serviceContext, reliableStateManagerReplica)
+ {
+ }
+
+ protected override IEnumerable CreateServiceReplicaListeners()
+ {
+ // In the configuration file, define connection strings:
+ // "Microsoft.ServiceBus.ConnectionString.Receive"
+ // and "Microsoft.ServiceBus.ConnectionString.Send"
+
+ // Also, define Topic & Subscription Names:
+ string serviceBusTopicName = null; //CloudConfigurationManager.GetSetting("TopicName");
+ string serviceBusSubscriptionName = CloudConfigurationManager.GetSetting("SubscriptionName");
+
+ yield return new ServiceReplicaListener(context => new ServiceBusSubscriptionBatchCommunicationListener(
+ new Handler(this)
+ , context
+ , serviceBusTopicName
+ , serviceBusSubscriptionName
+ , requireSessions: true)
+ {
+ MessagePrefetchCount = 10
+ }, "StatefulService-ServiceBusSubscriptionListener");
+ }
+
+ internal sealed class Handler : AutoCompleteBatchServiceBusMessageReceiver
+ {
+ private readonly StatefulService _service;
+
+ public Handler(StatefulService service)
+ {
+ _service = service;
+ }
+
+ protected override Task ReceiveMessagesImplAsync(IEnumerable messages, MessageSession session, CancellationToken cancellationToken)
+ {
+ var brokeredMessages = messages.ToArray();
+ ServiceEventSource.Current.ServiceMessage(_service, $"Handling batch of {brokeredMessages.Count()} queue messages");
+
+ foreach (var message in brokeredMessages)
+ {
+ ServiceEventSource.Current.ServiceMessage(_service, $"Handling queue message {message.MessageId}");
+ }
+ return Task.FromResult(true);
+ }
+ }
+
+
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/SampleSubscriptionListeningStatefulService.csproj b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/SampleSubscriptionListeningStatefulService.csproj
new file mode 100644
index 0000000..7e3878a
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/SampleSubscriptionListeningStatefulService.csproj
@@ -0,0 +1,128 @@
+
+
+
+
+ Debug
+ x64
+ {B092DD86-2104-4531-9EAB-BFB10B1E0242}
+ Exe
+ Properties
+ SampleSubscriptionListeningStatefulService
+ SampleSubscriptionListeningStatefulService
+ v4.5.1
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\x64\Debug\
+ DEBUG;TRACE
+ prompt
+ x64
+ MinimumRecommendedRules.ruleset
+
+
+ pdbonly
+ true
+ bin\x64\Release\
+ TRACE
+ prompt
+ x64
+ MinimumRecommendedRules.ruleset
+
+
+ $(AdditionalFileItemNames);None
+
+
+
+
+ ..\..\packages\WindowsAzure.ServiceBus.3.4.5\lib\net45-full\Microsoft.ServiceBus.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\Microsoft.ServiceFabric.Services.dll
+ True
+
+
+ ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
+ True
+
+
+ ..\..\packages\ServiceFabric.ServiceBus.Services.4.5.0\lib\net451\ServiceFabric.ServiceBus.Services.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\ServiceFabricServiceModel.dll
+ True
+
+
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.Strings.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ App.config
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(TargetFileName).config
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/ServiceEventSource.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/ServiceEventSource.cs
new file mode 100644
index 0000000..821f074
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/ServiceEventSource.cs
@@ -0,0 +1,107 @@
+using Microsoft.ServiceFabric.Services.Runtime;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.Tracing;
+using System.Fabric;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SampleSubscriptionListeningStatefulService
+{
+ [EventSource(Name = "Xpirit-MyServiceFabricApp-SampleSubscriptionListeningStatefulService")]
+ internal sealed class ServiceEventSource : EventSource
+ {
+ public static ServiceEventSource Current = new ServiceEventSource();
+
+ [NonEvent]
+ public void Message(string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.Message(finalMessage);
+ }
+ }
+
+ [Event(1, Level = EventLevel.Informational, Message = "{0}")]
+ public void Message(string message)
+ {
+ if (this.IsEnabled())
+ {
+ this.WriteEvent(1, message);
+ }
+ }
+
+ [NonEvent]
+ public void ServiceMessage(StatelessService service, string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.ServiceMessage(
+ service.Context.ServiceName.ToString(),
+ service.Context.ServiceTypeName,
+ service.Context.InstanceId,
+ service.Context.PartitionId,
+ service.Context.CodePackageActivationContext.ApplicationName,
+ service.Context.CodePackageActivationContext.ApplicationTypeName,
+ FabricRuntime.GetNodeContext().NodeName,
+ finalMessage);
+ }
+ }
+
+ [NonEvent]
+ public void ServiceMessage(StatefulService service, string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.ServiceMessage(
+ service.Context.ServiceName.ToString(),
+ service.Context.ServiceTypeName,
+ service.Context.ReplicaId,
+ service.Context.PartitionId,
+ service.Context.CodePackageActivationContext.ApplicationName,
+ service.Context.CodePackageActivationContext.ApplicationTypeName,
+ FabricRuntime.GetNodeContext().NodeName,
+ finalMessage);
+ }
+ }
+
+ [Event(3, Level = EventLevel.Informational, Message = "Service host process {0} registered service type {1}")]
+ public void ServiceTypeRegistered(int hostProcessId, string serviceType)
+ {
+ this.WriteEvent(3, hostProcessId, serviceType);
+ }
+
+ [NonEvent]
+ public void ServiceHostInitializationFailed(Exception e)
+ {
+ this.ServiceHostInitializationFailed(e.ToString());
+ }
+
+ [Event(2, Level = EventLevel.Informational, Message = "{7}")]
+ private void ServiceMessage(
+ string serviceName,
+ string serviceTypeName,
+ long replicaOrInstanceId,
+ Guid partitionId,
+ string applicationName,
+ string applicationTypeName,
+ string nodeName,
+ string message)
+ {
+ if (this.IsEnabled())
+ {
+ this.WriteEvent(2, serviceName, serviceTypeName, replicaOrInstanceId, partitionId, applicationName, applicationTypeName, nodeName, message);
+ }
+ }
+
+ [Event(4, Level = EventLevel.Error, Message = "Service host initialization failed")]
+ private void ServiceHostInitializationFailed(string exception)
+ {
+ this.WriteEvent(4, exception);
+ }
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/packages.config b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/packages.config
new file mode 100644
index 0000000..f476f24
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatefulService/packages.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/App.config b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/App.config
new file mode 100644
index 0000000..9cccaec
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/App.config
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/PackageRoot/Config/Settings.xml b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/PackageRoot/Config/Settings.xml
new file mode 100644
index 0000000..ad84ffd
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/PackageRoot/Config/Settings.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/PackageRoot/ServiceManifest.xml b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/PackageRoot/ServiceManifest.xml
new file mode 100644
index 0000000..4be87f1
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/PackageRoot/ServiceManifest.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+ SampleSubscriptionListeningStatelessService.exe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/Program.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/Program.cs
new file mode 100644
index 0000000..1e49e92
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/Program.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Diagnostics;
+using System.Fabric;
+using System.Threading;
+using Microsoft.ServiceFabric.Services.Runtime;
+
+namespace SampleSubscriptionListeningStatelessService
+{
+ internal static class Program
+ {
+ ///
+ /// This is the entry point of the service host process.
+ ///
+ private static void Main()
+ {
+ try
+ {
+ ServiceRuntime.RegisterServiceAsync("SampleSubscriptionListeningStatelessServiceType", context => new SampleSubscriptionListeningStatelessService(context)).GetAwaiter().GetResult();
+ ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(SampleSubscriptionListeningStatelessService).Name);
+ Thread.Sleep(Timeout.Infinite); // Prevents this host process from terminating so services keeps running.
+ }
+ catch (Exception e)
+ {
+ ServiceEventSource.Current.ServiceHostInitializationFailed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/Properties/AssemblyInfo.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..292e757
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("SampleSubscriptionListeningStatelessService")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("SampleSubscriptionListeningStatelessService")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6a6887cb-3c2e-4652-9d69-b7c0d9a1b397")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/ReadMe.txt b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/ReadMe.txt
new file mode 100644
index 0000000..fc1049b
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/ReadMe.txt
@@ -0,0 +1 @@
+Go to https://github.com/loekd/ServiceFabric.ServiceBus for more details.
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/SampleSubscriptionListeningStatelessService.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/SampleSubscriptionListeningStatelessService.cs
new file mode 100644
index 0000000..0c04775
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/SampleSubscriptionListeningStatelessService.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.Fabric;
+using System.Linq;
+using System.Threading;
+using Microsoft.Azure;
+using Microsoft.ServiceBus.Messaging;
+using Microsoft.ServiceFabric.Services.Communication.Runtime;
+using Microsoft.ServiceFabric.Services.Runtime;
+using ServiceFabric.ServiceBus.Services;
+using ServiceFabric.ServiceBus.Services.CommunicationListeners;
+using System.Threading.Tasks;
+
+namespace SampleSubscriptionListeningStatelessService
+{
+ ///
+ /// The FabricRuntime creates an instance of this class for each service type instance.
+ ///
+ internal sealed class SampleSubscriptionListeningStatelessService : StatelessService
+ {
+ public SampleSubscriptionListeningStatelessService(StatelessServiceContext serviceContext) : base(serviceContext)
+ {
+ }
+
+ protected override IEnumerable CreateServiceInstanceListeners()
+ {
+ // In the configuration file, define connection strings:
+ // "Microsoft.ServiceBus.ConnectionString.Receive"
+ // and "Microsoft.ServiceBus.ConnectionString.Send"
+
+ // Also, define Topic & Subscription Names:
+ string serviceBusTopicName = null; //CloudConfigurationManager.GetSetting("TopicName");
+ string serviceBusSubscriptionName = CloudConfigurationManager.GetSetting("SubscriptionName");
+ Action logAction = log => ServiceEventSource.Current.ServiceMessage(this, log);
+
+ yield return new ServiceInstanceListener(context => new ServiceBusSubscriptionBatchCommunicationListener(
+ new Handler(logAction)
+ , context
+ , serviceBusTopicName
+ , serviceBusSubscriptionName
+ , requireSessions: false)
+ {
+ LogAction = log => ServiceEventSource.Current.ServiceMessage(this, log),
+ MessageLockRenewTimeSpan = TimeSpan.FromSeconds(50), //auto renew every 50s, so processing can take longer than 60s (default lock duration).
+
+ }, "StatelessService-ServiceBusSubscriptionListener");
+ }
+ }
+
+ internal sealed class Handler : AutoCompleteBatchServiceBusMessageReceiver
+ {
+ public Handler(Action logAction)
+ : base(logAction)
+ {
+ }
+
+ protected override Task ReceiveMessagesImplAsync(IEnumerable messages, MessageSession session, CancellationToken cancellationToken)
+ {
+ var brokeredMessages = messages.ToArray();
+ WriteLog($"Handling batch of {brokeredMessages.Count()} queue messages");
+
+ foreach (var message in brokeredMessages)
+ {
+ WriteLog($"Sleeping for 7s while processing queue message {message.MessageId} to test message lock renew function (send more than 9 messages!).");
+ Thread.Sleep(TimeSpan.FromSeconds(7));
+
+ WriteLog($"Handling queue message {message.MessageId}");
+ }
+ return Task.FromResult(true);
+ }
+
+ protected override bool HandleReceiveMessagesError(IEnumerable messages, Exception ex)
+ {
+ WriteLog($"Handling Receive Messages Error");
+ return true;
+ }
+ }
+}
+
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/SampleSubscriptionListeningStatelessService.csproj b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/SampleSubscriptionListeningStatelessService.csproj
new file mode 100644
index 0000000..11b8f1e
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/SampleSubscriptionListeningStatelessService.csproj
@@ -0,0 +1,130 @@
+
+
+
+
+ Debug
+ x64
+ {6A6887CB-3C2E-4652-9D69-B7C0D9A1B397}
+ Exe
+ Properties
+ SampleSubscriptionListeningStatelessService
+ SampleSubscriptionListeningStatelessService
+ v4.5.1
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\x64\Debug\
+ DEBUG;TRACE
+ prompt
+ x64
+ MinimumRecommendedRules.ruleset
+
+
+ pdbonly
+ true
+ bin\x64\Release\
+ TRACE
+ prompt
+ x64
+ MinimumRecommendedRules.ruleset
+
+
+ $(AdditionalFileItemNames);None
+
+
+
+
+ ..\..\packages\WindowsAzure.ServiceBus.3.4.5\lib\net45-full\Microsoft.ServiceBus.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Data.2.4.164\lib\net45\Microsoft.ServiceFabric.Data.Interfaces.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\Microsoft.ServiceFabric.Internal.Strings.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\Microsoft.ServiceFabric.Services.dll
+ True
+
+
+ ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
+ True
+
+
+ ..\..\packages\ServiceFabric.ServiceBus.Services.4.5.0\lib\net451\ServiceFabric.ServiceBus.Services.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.Services.2.4.164\lib\net45\ServiceFabricServiceModel.dll
+ True
+
+
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.dll
+ True
+
+
+ ..\..\packages\Microsoft.ServiceFabric.5.4.164\lib\net45\System.Fabric.Strings.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Designer
+
+
+ App.config
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(TargetFileName).config
+
+
+
+
+
\ No newline at end of file
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/ServiceEventSource.cs b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/ServiceEventSource.cs
new file mode 100644
index 0000000..f3774d9
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/ServiceEventSource.cs
@@ -0,0 +1,107 @@
+using Microsoft.ServiceFabric.Services.Runtime;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.Tracing;
+using System.Fabric;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SampleSubscriptionListeningStatelessService
+{
+ [EventSource(Name = "Xpirit-MyServiceFabricApp-SampleSubscriptionListeningStatelessService")]
+ internal sealed class ServiceEventSource : EventSource
+ {
+ public static ServiceEventSource Current = new ServiceEventSource();
+
+ [NonEvent]
+ public void Message(string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.Message(finalMessage);
+ }
+ }
+
+ [Event(1, Level = EventLevel.Informational, Message = "{0}")]
+ public void Message(string message)
+ {
+ if (this.IsEnabled())
+ {
+ this.WriteEvent(1, message);
+ }
+ }
+
+ [NonEvent]
+ public void ServiceMessage(StatelessService service, string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.ServiceMessage(
+ service.Context.ServiceName.ToString(),
+ service.Context.ServiceTypeName,
+ service.Context.InstanceId,
+ service.Context.PartitionId,
+ service.Context.CodePackageActivationContext.ApplicationName,
+ service.Context.CodePackageActivationContext.ApplicationTypeName,
+ FabricRuntime.GetNodeContext().NodeName,
+ finalMessage);
+ }
+ }
+
+ [NonEvent]
+ public void ServiceMessage(StatefulService service, string message, params object[] args)
+ {
+ if (this.IsEnabled())
+ {
+ string finalMessage = string.Format(message, args);
+ this.ServiceMessage(
+ service.Context.ServiceName.ToString(),
+ service.Context.ServiceTypeName,
+ service.Context.ReplicaId,
+ service.Context.PartitionId,
+ service.Context.CodePackageActivationContext.ApplicationName,
+ service.Context.CodePackageActivationContext.ApplicationTypeName,
+ FabricRuntime.GetNodeContext().NodeName,
+ finalMessage);
+ }
+ }
+
+ [Event(3, Level = EventLevel.Informational, Message = "Service host process {0} registered service type {1}")]
+ public void ServiceTypeRegistered(int hostProcessId, string serviceType)
+ {
+ this.WriteEvent(3, hostProcessId, serviceType);
+ }
+
+ [NonEvent]
+ public void ServiceHostInitializationFailed(Exception e)
+ {
+ this.ServiceHostInitializationFailed(e.ToString());
+ }
+
+ [Event(2, Level = EventLevel.Informational, Message = "{7}")]
+ private void ServiceMessage(
+ string serviceName,
+ string serviceTypeName,
+ long replicaOrInstanceId,
+ Guid partitionId,
+ string applicationName,
+ string applicationTypeName,
+ string nodeName,
+ string message)
+ {
+ if (this.IsEnabled())
+ {
+ this.WriteEvent(2, serviceName, serviceTypeName, replicaOrInstanceId, partitionId, applicationName, applicationTypeName, nodeName, message);
+ }
+ }
+
+ [Event(4, Level = EventLevel.Error, Message = "Service host initialization failed")]
+ private void ServiceHostInitializationFailed(string exception)
+ {
+ this.WriteEvent(4, exception);
+ }
+ }
+}
diff --git a/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/packages.config b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/packages.config
new file mode 100644
index 0000000..f476f24
--- /dev/null
+++ b/ServiceFabricServicesBackup/ServiceFabric.ServiceBus.Demo/SampleSubscriptionListeningStatelessService/packages.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file