[jboss-svn-commits] JBL Code SVN: r14208 - labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Aug 14 12:01:30 EDT 2007


Author: kurt.stam at jboss.com
Date: 2007-08-14 12:01:30 -0400 (Tue, 14 Aug 2007)
New Revision: 14208

Modified:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
Log:
JBESB-678, removing magic number.

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java	2007-08-14 15:59:48 UTC (rev 14207)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java	2007-08-14 16:01:30 UTC (rev 14208)
@@ -259,10 +259,18 @@
      * @throws MessageDeliverException Failed to deliver message, after trying all available EPRs.
      */
     private Message post(Message message, boolean synchronous) throws MessageDeliverException, FaultMessageException {
-        int numberOfAttemps = 0;
-        while (numberOfAttemps++ < 2) {
+        boolean staleEPRCache = true;
+        //We are removing dead EPRs from the serviceClusterInfo. *Previous* deliveries maybe have
+        //removed EPRs that have now come back to life. We should try once more to pull a fresh list of EPRS
+        //from the registry before we give up (and fail-over to redelivery at a later time in the care
+        //of asyncDeliver). I think the end-user expects the message to be delivered successfully if there
+        //is a healhty EPR out there. So this is really for EPR cache management (serviceClusterInfo will
+        //be empty when going for the 2nd attempt, or else there delivery was successful and there will be
+        //no second attempt!).
+        while (staleEPRCache) {
             if ((serviceClusterInfo.getEPRs().size() == 0) || (new Date().after(expirationDate))) {
                 loadServiceClusterInfo();
+                staleEPRCache=false;
             }
             Message replyMessage;
             EPR epr;




More information about the jboss-svn-commits mailing list