Поделиться через


Azure Skittles Part 4

Last time, we got our worker role up and running. This time, we will feed him.

WPF Application

We will construct a quick driver application to feed items to our Web Role. In your WpfApplication1 project, add a Service Reference to our Web Role (right-click on References->Add Service Reference). From there, you can use Discover->Services In Solution.

It should find Service1 in the Solution and add it with the wrong port (it will start up the ASP.NET Development Server on a random port which is not what we want, but we will fix it). Once the service is added, go into the app.config for the WPFApplication1 Project and change the Service1 port from {randomport} to 81 in the endpoint node as shown below.

Keeping it very simple, I will add a TextBlock, Slider, TextBox and Button to my application. I will add some application logic to get a ServiceClient instance and drive some work through SubmitDataForWork. There is nothing Azure germane here; it’s all WCF stuff to call the service. And that's really the point.

On Go!, the application will grab some threads from the thread pool and drive some messages through our Web Role.

Let’s run this. Be sure the CloudService project is running. When I select 1 thread and push Go!, you will see that my Web Role is placing the data on the queue and the Worker Role is removing them.

Next time, we will do some debugging and look at some scale-out options.