Distributed applications with AjMessages using DSS/CCR

Well, it’s only a project. The sample application is minimal. But it’s the evolution of my previous work with AjMessages via Windows Communication Foundation:

AjMessages- a message processor

Last year, I wrote that example, and another one that uses DSS/CCR. Only the first was published, now, I’m reviewing my DSS/CCR implementation, mounted on Microsoft Robotics technology. Currently, you can download the code from CodePlex at:


Both examples were based on Fabriq project ideas, trasposed to new technologies. Recently, Arvindra Sehmi posted about a new version of Fabriq, named Fabriq4Dss, that is using DSS/CCR in a more powerful ways. He prepared a presentation for JAOO, read more at:

JAOO 2008 Presentation

Keep tuned!

The solution

It’s composed by three projects:

The first one is a core implementation, that is independent of the transport to use for distributed messages:

The second project contains a simple message handler to use in the demo. The third project is the DSS service component to use as a host node:


For a more detailed description of application, message, hosts, read my previous post:

AjMessages- a message processor

The application

A configuration XML file define the applications to run. An application has:

  • Nodes: a collection of actions to process.
  • Handlers: objects to process a message. A handler can be a composite of other handlers.
  • Actions: named entry points to a handler

An example application definition (from AjMessages.SampleApp\Configurations\Server1.xml):

<?xml version="1.0" encoding="utf-8" ?> <AjMessages> <Application Name="AjMessages"> <Node Name="Administration"> <Handler Name="ConfigureHandler" Type="AjMessages.ConfigureHandler, AjMessages"/> <Handler Name="PrintHandler" Type="AjMessages.PrintHandler, AjMessages"/> <Handler Name="PrintMessageHandler" Type="AjMessages.PrintMessageHandler, AjMessages"/> <Handler Name="ConfigurePipeline"> <Handler Name="PrintHandler"> <Property Name="Text" Value="Reconfiguring server..."/> </Handler> <Handler Name="ConfigureHandler"/> </Handler> <Action Name="Configure" Handler="ConfigurePipeline"/> </Node> </Application> <Application Name="App1"> <Node Name="Node1"> <Handler Name="PrintMessageHandler" Type="AjMessages.PrintMessageHandler, AjMessages"/> <Handler Name="PostHandler" Type="AjMessages.PostHandler, AjMessages"/> <Handler Name="DecrementHandler" Type="AjMessages.SampleApp.Handlers.DecrementHandler, AjMessages.SampleApp"/> <Handler Name="Pipeline1"> <Handler Name="DecrementHandler"/> <Handler Name="PostHandler"> <Property Name="Action" Value="App1/Node1/Process"/> </Handler> </Handler> <Action Name="Process" Handler="Pipeline1"/> </Node> <Node Name="Node2"/> </Application> <Host Name="Server1" Activate="true"> <Application Name="AjMessages"> <Node Name="Administration"/> </Application> <Application Name="App1"> <Node Name="Node1"/> <Node Name="Node2"/> </Application> </Host> <Host Name="Server2" Address="http://localhost:50002/ajmessages/node"> <Application Name="AjMessages"> <Node Name="Administration"/> </Application> <Application Name="App1"> <Node Name="Node1"/> <Node Name="Node2"/> </Application> </Host> </AjMessages>

Running the example

Load the solution in Visual Studio 2008 (you must have Microsoft Robotics Developer Studio, a CTP version of this year, and you must configure the output path of the projects to point to your MRDS directory). Running the DSS project lunch a DSS Host that shows a controller window:

The host is running on ports 50000/50001. Configure the host using the AjMessages.SampleApp\Configurations\Server1.xml.

You can launch a second host from DSS prompt:

bin/dsshost /p:50002 /t:50003

A second form controller appears:

Use the other config file AjMessages.SampleApp\Configurations\Server2.xml and port 50002.

You can send a message to the sample app. The message is only an integer, that is decremented in each node. The decrement node is installed in the two servers, so the message travels from one to another server.

Next steps

I want to support an arbitrary object, serialized in DSS, and uses WCF as a transport, too. The previous post describes the WCF implementation.

Angel “Java” Lopez

4 thoughts on “Distributed applications with AjMessages using DSS/CCR

  1. Pingback: Sabattical Week Results « Angel “Java” Lopez on Blog

  2. Pingback: Distributed Web Crawler using AjMessages « Angel “Java” Lopez on Blog

  3. Pingback: Web Crawler distribuido usando AjMessages - Angel "Java" Lopez

  4. Pingback: Web Crawler distribuido usando AjMessages | Buanzolandia

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s