[jboss-svn-commits] JBL Code SVN: r20132 - labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/jms_transacted.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri May 23 10:07:19 EDT 2008
Author: kevin.conner at jboss.com
Date: 2008-05-23 10:07:19 -0400 (Fri, 23 May 2008)
New Revision: 20132
Modified:
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/jms_transacted/readme.txt
Log:
Document the output from the console: JBESB-1664
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/jms_transacted/readme.txt
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/jms_transacted/readme.txt 2008-05-23 14:03:25 UTC (rev 20131)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/jms_transacted/readme.txt 2008-05-23 14:07:19 UTC (rev 20132)
@@ -7,7 +7,8 @@
This quickstart consists of a single service that contains 4 actions:
1. Log a statement that we have entered the quickstart.
2. Insert the contents of the ESB Message object to a database table.
- 3. Call a custom action that will rollback the transaction if the message has not been redelivered. (more on this later)
+ 3. Call a custom action that throws an exception if the message has not
+ been redelivered. (more on this later)
4. Log a statement that we are about to exit the quickstart.
The main thing to look for is that the first time we enter the action processing
@@ -18,7 +19,7 @@
put back onto the queue.
For more details about how this quickstart works look at the
- "What to look at for this Quckstart" section below.
+ "What to look at in this Quickstart" section below.
This quickstart uses jms-jca-provider and more information about jms jca can
be found here: http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingJCAWithJBossESB
@@ -40,19 +41,40 @@
'ant undeploy'
This will undeploy the quickstart.
-What to look at for this Quickstart:
+What to look at in this Quickstart:
===================================
1. Overall flow of this quickstart:
* The first time we enter the action pipleline, we insert a row into the database: (server console output below)
[DBInsertAction] Successfully inserted [Hello Transacted JMS World] counter[1]] into jms_transacted_table
- * Next, the RollbackTransactionAction is called.
- It checks if the ESB Message property 'javax.jms.message.redelivered' is false, in which case
- the transaction is rolled back, which will also cause the database insert in the preceeding action to be rolled back.
- If the ESB Message property 'javax.jms.message.redelivered' is true the message will simple pass throw this
- action unmodified and the action pipeline will complete normally: (server console ouput below)
+ * Next, the ThrowExceptionAction is called.
+ It checks if the ESB Message property 'javax.jms.message.redelivered'
+ is false in which case an exception is thrown, resulting in the JCA
+ adapter rolling back the transaction. This will also cause the
+ database insert in the preceding action to be rolled back.
+
+ The console output will display an error message from the
+ ActionProcessingPipeline followed by a stacktrace of the
+ generated exception. This exception is then propagated to the
+ JCA/JMS adapter which will also document the issue.
+
+ Part of the console output follows:
+ [ActionProcessingPipeline] Unexpected exception caught while
+ processing the action pipeline:
+ java.lang.IllegalStateException: [Throwing Exception to trigger a
+ transaction rollback]
+ [JmsServerSession] Unexpected error delivering message
+ delegator->JBossMessage[512]:PERSISTENT, deliveryId=1
+ java.lang.IllegalStateException: [Throwing Exception to trigger a
+ transaction rollback]
+
+ If the ESB Message property 'javax.jms.message.redelivered' is true
+ then the message will simple pass throw this action, unmodified,
+ and the action pipeline will complete normally:
+ (server console ouput below)
[DBInsertAction] Successfully inserted [Hello Transacted JMS World] counter[2]] into jms_transacted_table
+ [ThrowExceptionAction] [javax.jms.message.redelivered:true]
[STDOUT] JMS Transacted Quickstart processed sucessfully. Message body:
* Only the last insert will be committed to the database when the action pipeline successfully completes.
@@ -87,11 +109,14 @@
data is committed to the database. In a normal run, when the counter is
'1', the counter should be 2 indicating that only the second commit succeeded.
- 3. org.jboss.soa.esb.samples.quickstart.jmstransacted.test.RollbackTransactionAction
- The current transaction is rolled back by the folling code in the process method:
- TransactionStrategy strategy = TransactionStrategy.getTransactionStrategy(true);
- log.info( "Setting transaction to rollback only" );
- strategy.rollbackOnly();
+ 3. org.jboss.soa.esb.samples.quickstart.jmstransacted.test.ThrowExceptionAction
+ The current transaction is rolled back as a result of the action
+ handler throwing a RuntimeException (or a subclass of such) during
+ the processing method. The exception is caught by the
+ ActionProcessingPipeline but, as it is not identified as an applicion
+ exception, it will be propagated to the caller (in this case the
+ JMS/JCA adapter). The JMS/JCA adapter will then force the enclosing
+ transaction to rollback, resulting in the redelivery of the message.
4. jboss-esb.xml
The message-filter for the jms-bus-filter now specifies 'transacted' attribute.
More information about the jboss-svn-commits
mailing list