[hornetq-commits] JBoss hornetq SVN: r8482 - trunk/src/main/org/hornetq/core/client/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Dec 1 14:40:40 EST 2009


Author: jmesnil
Date: 2009-12-01 14:40:40 -0500 (Tue, 01 Dec 2009)
New Revision: 8482

Modified:
   trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
Log:
failover issue

* fixed retry loop by rethrowing the exception if it is not a SESSION_CREATION_REJECTED
* added a sleep of 10ms before retry to send the request to avoid spinning too much

Modified: trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java	2009-12-01 17:44:47 UTC (rev 8481)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java	2009-12-01 19:40:40 UTC (rev 8482)
@@ -839,7 +839,13 @@
                   {
                      log.warn("Server is starting, retry to create the session " + name);
                      retry = true;
+                     // sleep a little bit to avoid spinning too much
+                     Thread.sleep(10);
                   }
+                  else
+                  {
+                     throw e;
+                  }
                }
             } while(retry);
             



More information about the hornetq-commits mailing list