servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r414291 - /incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java
Date Wed, 14 Jun 2006 15:29:55 GMT
Author: gnodet
Date: Wed Jun 14 08:29:55 2006
New Revision: 414291

URL: http://svn.apache.org/viewvc?rev=414291&view=rev
Log:
Fix concurrency problem with continuations in servicemix-http

Modified:
    incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java

Modified: incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java?rev=414291&r1=414290&r2=414291&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java
(original)
+++ incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java
Wed Jun 14 08:29:55 2006
@@ -164,11 +164,13 @@
                 inMessage.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(request));
                 locks.put(exchange.getExchangeId(), cont);
                 request.setAttribute(MessageExchange.class.getName(), exchange.getExchangeId());
-                ((BaseLifeCycle) endpoint.getServiceUnit().getComponent().getLifeCycle()).sendConsumerExchange(exchange,
endpoint);
-                // TODO: make this timeout configurable
-                boolean result = cont.suspend(1000 * 60); // 60 s
-                if (!result) {
-                    throw new Exception("Error sending exchange: aborted");
+                synchronized (cont) {
+                    ((BaseLifeCycle) endpoint.getServiceUnit().getComponent().getLifeCycle()).sendConsumerExchange(exchange,
endpoint);
+                    // TODO: make this timeout configurable
+                    boolean result = cont.suspend(1000 * 60); // 60 s
+                    if (!result) {
+                        throw new Exception("Error sending exchange: aborted");
+                    }
                 }
             } catch (SoapFault fault) {
                 sendFault(fault, request, response);



Mime
View raw message