[jboss-svn-commits] JBL Code SVN: r8622 - labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Jan 2 13:04:00 EST 2007
Author: burrsutter
Date: 2007-01-02 13:03:59 -0500 (Tue, 02 Jan 2007)
New Revision: 8622
Modified:
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/readme.txt
Log:
updated to reflect all of the GA changes
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/readme.txt 2007-01-02 18:03:38 UTC (rev 8621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/readme.txt 2007-01-02 18:03:59 UTC (rev 8622)
@@ -10,40 +10,39 @@
In a separate command prompt window, run "ant runtest" to shoot a JMS message
into the listener which will then invoke the MyJMSListenerAction and display
it to the console. You can modify the build.xml to change the phrase
-"Hello World" to something else and re-run "ant runtest".
+"Hello World" to something else and re-run "ant runtest". After you have run
+the test and seen the activity on the console also use the a queue viewer
+like the one found in the JBoss JMX Console (if you are using JBossMQ) to
+see the modified message in the outbound queue: quickstart_helloworld_action_Response
+
Project file descriptions:
* Review the helloworld quickstart as the majority of this is similiar to
that example
-* MyJMSListenerAction.java has some additional methods. The most interesting
-are the noOperation, exceptionHandler and sendResponse methods.
-From the esb-config.xml file the invocations of the Action class methods are
-as follows:
- <action class="quickstart.MyJMSListenerAction" process="displayMessage" exceptionMethod="exceptionHandler" />
- <action class="quickstart.MyJMSListenerAction" process="playWithMessage" exceptionMethod="exceptionHandler" />
- <action class="quickstart.MyJMSListenerAction" process="displayMessage" exceptionMethod="exceptionHandler"/>
- <action class="quickstart.MyJMSListenerAction" process="noOperation" okMethod="sendResponse"/>
-An exceptions that are thrown by displayMessage or playWithMessage are sent to the exceptionHandler method.
-Once all other operations/actions are complete the last line is tied to "noOperation" which simply returns
-the same message that it is sent with a call to the okMethod, in this case, sendResponse. This is because
-sendResponse doesn't intend to return the Message.
-
-An alternative approach could be:
- <action class="quickstart.MyJMSListenerAction" process="sendResponse" exceptionMethod="exceptionHandler"/>
- public Message sendResponse(Message message) {
- try {
- logHeader();
- System.out.println(new String(message.getBody().getContents()));
- logFooter();
- ReturnJMSMessage.sendMessage(message,"quickstart_helloworld_action_Response");
- } catch (Exception e) {
- logHeader();
- System.out.println(e.getMessage());
- logFooter();
- }
- return message; // return exactly what was passed in.
- }
+* MyJMSListenerAction.java has methods to display the inbound message,
+modify the message and to handle an exceptions which might be thrown in the action
+processing.
+* jbossesb.xml includes a special action (from JBoss ESB core) that is used
+to send a message out of the ESB back to the non-"ESB aware" world. The gateway
+looks for inbound messages on "quickstart_helloworld_action_Request" which was configured
+by the "esb-quickstart-service.xml" file. The notifier sends the modified message to
+"quickstart_helloworld_action_Response"
+ <action name="notificationAction"
+ class="org.jboss.soa.esb.actions.Notifier">
+ <property name="okMethod" value="notifyOK" />
+ <property name="notification-details">
+ <NotificationList type="OK">
+ <target class="NotifyConsole" />
+ <target class="NotifyQueues">
+ <queue jndiName="queue/quickstart_helloworld_action_Response">
+ <messageProp name="quickstart" value="hello_world_action" />
+ </queue>
+ </target>
+ </NotificationList>
+ </property>
+ </action>
+
An ESB action class must have a constructor that accepts a ConfigTree argument like the following:
public MyJMSListenerAction(ConfigTree config) { _config = config; }
-A ConfigTree is an object holding any attributes associated with the action declaration in the esb-config.xml
+A ConfigTree is an object holding any attributes associated with the action declaration in the jbossesb.xml
More information about the jboss-svn-commits
mailing list