camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r668276 - in /activemq/camel/trunk/camel-core: pom.xml src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java
Date Mon, 16 Jun 2008 19:49:14 GMT
Author: davsclaus
Date: Mon Jun 16 12:49:14 2008
New Revision: 668276

URL: http://svn.apache.org/viewvc?rev=668276&view=rev
Log:
CAMEL-605: Fixed the high concurrency issue with dataset. Must sleep during sending to have
more even load on producer/consumer.

Modified:
    activemq/camel/trunk/camel-core/pom.xml
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java

Modified: activemq/camel/trunk/camel-core/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/pom.xml?rev=668276&r1=668275&r2=668276&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/pom.xml (original)
+++ activemq/camel/trunk/camel-core/pom.xml Mon Jun 16 12:49:14 2008
@@ -124,7 +124,6 @@
           <excludes>
             <!-- TODO FIXME ASAP -->
             <exclude>**/InterceptorLogTest.*</exclude>
-            <exclude>**/DataSetSedaTest.*</exclude>
           </excludes>
         </configuration>
       </plugin>

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java?rev=668276&r1=668275&r2=668276&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java
Mon Jun 16 12:49:14 2008
@@ -63,13 +63,18 @@
                 Exchange exchange = endpoint.createExchange(i);
                 getProcessor().process(exchange);
 
-                long delay = endpoint.getProduceDelay();
-                if (delay > 0) {
-                    try {
+                try {
+                    long delay = endpoint.getProduceDelay();
+                    if (delay > 0) {
                         Thread.sleep(delay);
-                    } catch (InterruptedException e) {
-                        LOG.debug(e);
+                    } else {
+                        // if no delay set then we must sleep at lest for 1 nano to avoid
concurrency
+                        // issues with extremly high throughtput
+                        Thread.sleep(0, 1);
                     }
+                } catch (InterruptedException e) {
+                    // ignore and just log to debug
+                    LOG.debug(e);
                 }
                 if (reporter != null) {
                     reporter.process(exchange);



Mime
View raw message