So to get started, I provisioned my account, set to East Coast, and clicked on the Service Hub icon on the left hand toolbar.
From there, I created a Queue. A Queue in traditional SQL Server is tied to a Service and Route and EndPoint. I've set up a few databases to work with Service Broker, and it was not as simple as this is.
Getting Started: Messaging with Queues
Here' we created a queue called 'test1':
From the Service Bus page, you have a few options, listed here:
After downloading the sample project into Visual Studio 2013, it seems I'm missing some references. So we need to download the SDK for Azure:
Loaded references in Visual Studio project: NuGet, and it now compiles:
Now get the connection string from Azure Portal:
Indicating that we are missing SAS Policies configuration:
So that's easy to set up in a few clicks, I created a Test1 Shared Policy with full access / control:
If you go back to the main Queue page, there's a hyperlink to get the connection string with a copy button, which you can add to the Visual Studio 2013 app.config:
Next, comment out the method CreateQueue, as it apparently deleted my queue on Azure and wasn't able to recreate it.
Next, we renamed the Queue in the Visual Studio project to match the Queue name in Azure: test1
Compiled and ran, success~!
And the Azure view:
And there you have it. Service Broker is a powerful took that not many people know about or utilize in production environments. However, you can move lots of data from multiple places to multiple places, guaranteed delivery, asynchronous delivery and the messages get received in the order sent. And lastly, if your server goes down you won't lose any data as it stores them up ready to flow once the server and queue is restarted. Lastly, you can prioritize your queues for Low, Medium or High based on the business rules.
Thanks for reading~!