[jboss-svn-commits] JBL Code SVN: r18736 - in labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product: rosetta/src/org/jboss/soa/esb/client and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Mar 6 12:05:05 EST 2008


Author: mark.little at jboss.com
Date: 2008-03-06 12:05:04 -0500 (Thu, 06 Mar 2008)
New Revision: 18736

Modified:
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/docs/ProgrammersGuide.odt
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
Log:
http://jira.jboss.com/jira/browse/JBESB-1556

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java	2008-03-06 16:58:54 UTC (rev 18735)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java	2008-03-06 17:05:04 UTC (rev 18736)
@@ -75,12 +75,18 @@
     public static final String DEAD_LETTER_SERVICE_NAME = "DeadLetterService";
     public static final String DELIVER_TO = "org.jboss.soa.esb.deliver.to";
     
-    /**
+    /*
      * Remove (suspected) dead EPRs.
      */
     
     private static boolean removeDeadEprs;
     
+    /*
+     * Throw an exception on delivery failure rather than retry?
+     */
+    
+    private static boolean exceptionOnDeliveryFailure;
+    
     /**
      * Class logger.
      */
@@ -282,7 +288,7 @@
             if ((serviceClusterInfo.getEPRs().size() == 0) || (new Date().after(expirationDate))) {
                 loadServiceClusterInfo();
                 
-                if (initialPass && (serviceClusterInfo.getEPRs().size() == 0)) // zero from a previoud send
+                if (initialPass && (serviceClusterInfo.getEPRs().size() == 0)) // zero from a previous send
                 {
                 	/*
                 	 * We need to check to see if this instance used up all of it's attempts to deliver
@@ -320,6 +326,14 @@
 	                    
 	                    if (removeDeadEprs)
 	                    	RegistryUtil.unregister(service.getCategory(), service.getName(), epr);
+	                    
+	                    /*
+	                     * If the message property is set to fail immediately, or the global property is set,
+	                     * then don't do retries even if there are other EPRs in the list.
+	                     */
+	                    
+	                    if (("true".equals(message.getProperties().getProperty(Environment.EXCEPTION_ON_DELIVERY_FAILURE, "false")) || exceptionOnDeliveryFailure))
+	                	throw new MessageDeliverException("Failed to deliver message ["+message.getHeader()+"] to Service [" + service + "].  Told not to retry.");
 	                }
             	}
             	catch (MalformedEPRException ex)  // so we can differentiate failure modes, since returning null is limiting
@@ -555,5 +569,16 @@
     	{
     		removeDeadEprs = false;
     	}
+    	
+    	String exceptionOnFailure = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.EXCEPTION_ON_DELIVERY_FAILURE, "false");
+    	
+    	if ("true".equalsIgnoreCase(exceptionOnFailure))
+    	{
+    		exceptionOnDeliveryFailure = true;
+    	}
+    	else
+    	{
+    		exceptionOnDeliveryFailure = false;
+    	}
     }
 }

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2008-03-06 16:58:54 UTC (rev 18735)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2008-03-06 17:05:04 UTC (rev 18736)
@@ -62,6 +62,8 @@
     public static final String REDELIVER_DLS_SERVICE_ON       = "org.jboss.soa.esb.dls.redeliver";
     public static final String REGISTRY_CACHE_LIFE_MILLIES    = "org.jboss.soa.esb.registry.cache.life";
     public static final String REMOVE_DEAD_EPR                = "org.jboss.soa.esb.failure.detect.removeDeadEPR";
+    	public static final String EXCEPTION_ON_DELIVERY_FAILURE = "org.jboss.soa.esb.exceptionOnDeliverFailure";
+    	
 	/** 
 	 * The Registry Query Manager URI defines the endPoint where registry queries can be made. 
 	 */




More information about the jboss-svn-commits mailing list