Note to reviewers: The Azure resources referenced in this solution, has been removed. As such, to run any part of this demo/proof of concept, please ensure that you provision your own resources and reference them.
Cross Data-Centre Logic, or on-premise to the cloud and back again!
Start MSBuild Command Prompt
and then invoke powershell
from there.
You'll want node
and nodemon
installed.
Start auto builds with nodemon -e cs -w .\ -C .\build.js
Create a Class Library (Package) projectOnPremiseService1.Public
in solutionOnPremiseService1
Rename project toPublic
AddSetEnvironmentVariable
commandAddEnvironmentVariableChanged
eventPublish as NuGetCreate console app projectOnPremiseService1.EnvironmentMessageHandler
Rename project toEnvironmentMessageHandler
Reference NuGet
Create a Class Library (Package) projectOnPremiseService2.Public
in solutionOnPremiseService2
Rename project toPublic
AddMutateNumber
commandAddResultChanged
eventPublish as NuGetCreate console app projectOnPremiseService2.MathMessageHandler
Rename project toMathMessageHandler
Reference NuGet
Create a Class Library (Package) projectCloudService1.Public
in solutionCloudService1
Rename project toPublic
AddPleaseRepeatThis
commandAddEchoedResponse
eventPublish as NuGetCreate an Azure Web JobCloudService1.EchoMessageHandler
Rename project toEchoMessageHandler
Reference NuGet
Create a Class Library (Package) projectCloudService2.Public
in solutionCloudService2
Rename project toPublic
AddTranslateColorNameToRgb
CommandAddColorNameToRgbTranslationComplete
EventCreate an Azure Web JobCloudService2.ColorMessageHandler
Rename project toColorMessageHandler
- ~~Reference NuGet
Extract the interop layer from Cloud Service 2 into a separate NuGetReference and test
The on-premises bridge is a small "repeater" or "forwarder" that contains no business logic of its own. It facilitates communicating between an on-premises service and a cloud service by using the on-premises integration stack (NServiceBus 4) and a custom-built interop-layer that communicates with an Azure Service Bus namespace (from which an NServiceBus 6 service then can communicate). By being small and without its own business logic, the bridge can easily participate in on-premises distributed transactions. It then uses the NServiceBus retry logic together with Azure Service Bus' duplicate message detection to implement once and only once delivery.
Reference OnPremiseService1 and CloudService1Reference local NServiceBus (4.0.2)Reference the Interop layer (which, in turn, references the Azure ServiceBus SDK)Let OnPremiseService1 reference CloudService1Add aMessageEndpointMapping
in OnPremiseService1, binding it to the bridge's queue (OnPremiseService1.EchoServiceBridge@localhost
in this example).Add Logic in theOnPremiseService1.EnvironmentMessageHandler
to interactively send a command either to theOnPremiseService2.MathMessageHandler
(as before), or theOnPremiseService1.EchoServiceBridge
.Implement a subscription handler forCloudService1.Public.Events.EchoedResponse
Cannot use current nServicebus because NServiceBus 5.2.14 Doesn’t Support HTTPS When Using WindowsAzure.ServiceBus 2.8.2
Cannot use nservicebus beta 6 because it has missing types
If you run the webjob before the nservicebus one, the web job will create an outgoing queue for its event, rather than a topic, which will cause the nservicebus job to fail