cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1183088 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Date Thu, 13 Oct 2011 20:52:53 GMT
Author: dkulp
Date: Thu Oct 13 20:52:53 2011
New Revision: 1183088

URL: http://svn.apache.org/viewvc?rev=1183088&view=rev
Log:
If the workqueue for the http-conduit async calls is full, try to submit
it for a few seconds before just handling it synchronously.

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1183088&r1=1183087&r2=1183088&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Thu Oct 13 20:52:53 2011
@@ -81,6 +81,7 @@ import org.apache.cxf.transport.https.Ce
 import org.apache.cxf.transport.https.CertConstraintsJaxBUtils;
 import org.apache.cxf.transport.https.HttpsURLConnectionFactory;
 import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.apache.cxf.workqueue.AutomaticWorkQueue;
 import org.apache.cxf.workqueue.WorkQueueManager;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.policy.Assertor;
@@ -1504,20 +1505,21 @@ public class HTTPConduit 
                         }
                     }
                 };
-                Executor ex = outMessage.getExchange().get(Executor.class);
-                if (ex == null) {
-                    WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
-                        .getExtension(WorkQueueManager.class);
-                    ex = mgr.getNamedWorkQueue("http-conduit");
+                try {
+                    Executor ex = outMessage.getExchange().get(Executor.class);
                     if (ex == null) {
-                        ex = mgr.getAutomaticWorkQueue();
-                    }
-                } else {
-                    outMessage.getExchange().put(Executor.class.getName() 
+                        WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
+                            .getExtension(WorkQueueManager.class);
+                        AutomaticWorkQueue qu = mgr.getNamedWorkQueue("http-conduit");
+                        if (ex == null) {
+                            qu = mgr.getAutomaticWorkQueue();
+                        }
+                        qu.execute(runnable, 5000);
+                    } else {
+                        outMessage.getExchange().put(Executor.class.getName() 
                                                  + ".USING_SPECIFIED", Boolean.TRUE);
-                }
-                try {
-                    ex.execute(runnable);
+                        ex.execute(runnable);
+                    }
                 } catch (RejectedExecutionException rex) {
                     LOG.warning("EXECUTOR_FULL");
                     handleResponseInternal();



Mime
View raw message