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:
http://www.codeplex.com/ajmessages
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:
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
m:<pathto>\Source\AjMessages.DssServices\AjMessagesDssServices.manifest.xml
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
http://www.ajlopez.com/en
[...] Distributed applications with AjMessages using DSS/CCR [...]
Pingback by Sabattical Week Results « Angel “Java” Lopez on Blog — October 29, 2008 @ 9:49 am
[...] AjMessages- a message processorDistributed Applications with AjMessages using DSS/CCR [...]
Pingback by Distributed Web Crawler using AjMessages « Angel “Java” Lopez on Blog — March 9, 2009 @ 8:11 am
[...] a message processorDistributed Applications with AjMessages using DSS/CCRAplicaciones Distribuidas con AjMessages usando DSS/CCRAjMessages- hacia un procesador de [...]
Pingback by Web Crawler distribuido usando AjMessages - Angel "Java" Lopez — March 10, 2009 @ 1:07 am
[...] a message processorDistributed Applications with AjMessages using DSS/CCRAplicaciones Distribuidas con AjMessages usando DSS/CCRAjMessages- hacia un procesador de [...]
Pingback by Web Crawler distribuido usando AjMessages | Buanzolandia — March 10, 2009 @ 3:40 am