[jboss-svn-commits] JBL Code SVN: r9240 - labs/jbossesb/trunk/product/samples/quickstarts/aggregator.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jan 31 23:53:31 EST 2007


Author: burrsutter
Date: 2007-01-31 23:53:31 -0500 (Wed, 31 Jan 2007)
New Revision: 9240

Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/aggregator/readme.txt
Log:
updated to reflect the steps needed to run this quickstart

Modified: labs/jbossesb/trunk/product/samples/quickstarts/aggregator/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/aggregator/readme.txt	2007-02-01 04:43:20 UTC (rev 9239)
+++ labs/jbossesb/trunk/product/samples/quickstarts/aggregator/readme.txt	2007-02-01 04:53:31 UTC (rev 9240)
@@ -1,13 +1,20 @@
 Overview:
 =========
+The purpose of this particular example is to demonstrate the Enterprise Integration
+Patterns of Splitter and Aggregator. In addition, this example demonstrates the 
+concepts of multiple JVMs, each running unique services but all working in concert,
+a federated model that shares a common registry and uses JMS between the JVMs.  
+The registry is managed by the ESB SAR (see Getting Started Guide). This example
+assumes JBoss MQ running on JBoss AS 4.x.  However, it uses no JBoss Application
+Server specific features.
 
 Before Running:
 ===============
 1. Update the "jbosshome.dir" property in the quickstarts.properties file in "../".
 2. Make sure the jbossesb.sar is deployed on your JBoss Application Server.
-   In the ESB "install" update deployment.properties and then run "ant deploy".
+   In the ESB "install" update deployment.properties and then run "ant".
 3. Make sure the JBoss Application server is running.
-4. You will need to start 6 command windows as this example uses at least 5 JVMs
+4. You will need to start 6 command windows as this example uses at least 6 JVMs
 5. All of the quickstarts rely heavily on Ant to configure the classpath and execute
    the demonstration components.
 6. Make sure you have deployed the JMS destinations described in the 
@@ -17,8 +24,38 @@
 =======
 1. Command Window 1: "ant jars" - compiles and builds the JARS
 2. Command Window 1: "ant runInbound" - contains the splitter
-3. Command Window 2: "ant runRedService"
-4. Command Window 3: "ant runGreenService"
-5. Command Window 4: "ant runBlueService"
-6. Command Window 5: "ant runAggregatorService"
-7. Command Window 6: "ant runtest" - this sends the SampleOrder.xml into the splitter's queue
\ No newline at end of file
+It will display the entire XML message to its console
+3. Command Window 2: "ant runRedService" - rips out just the Customer
+It will display just the Customer information to its console
+4. Command Window 3: "ant runGreenService" - rips out just the LineItems
+It will display just the LineItems to its console
+5. Command Window 4: "ant runBlueService" - rips out just the OrderHeader
+It will display just the Order header information to its console
+6. Command Window 5: "ant runAggregatorService" - displays the parts together
+It will simply push out the individual message parts.  More details on how that is
+achieved can be found below
+7. Command Window 6: "ant runtest" - this sends the SampleOrder.xml into the splitter's queue
+8. The split off messages can be set out from the ESB via Notification. You can run
+"ant receiveRed", "ant receiveGreen" and "ant receiveBlue" in three more command windows 
+plus modify the Red, Green and Blue service's jbossesb.xml files to use notification
+to send to the appropriate queues. Notification is demonstrated in the fun_cbr quickstart.
+
+The aggregation action (SystemPrintln in this case) needs to contain logic for handling
+the "parts". The trick is using ActionUtils.getTaskObject(message) and then looping
+through the attachments:
+
+	public Message process(Message message) throws ActionProcessingException {
+		Object messageObject = ActionUtils.getTaskObject(message);
+		
+		if(messageObject instanceof byte[]) {
+			System.out.println(printlnMessage + ": \n[" + format(new String((byte[])messageObject)) + "].");
+		} else {
+			if (messageObject!=null) System.out.println(printlnMessage + ": \n[" + format(messageObject.toString()) + "].");
+            for (int i=0; i<message.getAttachment().getUnnamedCount(); i++) {
+                Message attachedMessage = (Message) message.getAttachment().itemAt(i);
+                System.out.println("attachment " + i + ": [" + new String(attachedMessage.getBody().getContents()) + "].");
+            }
+		}		
+		return message;
+	}
+	
\ No newline at end of file




More information about the jboss-svn-commits mailing list