camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: svn commit: r668276 - in /activemq/camel/trunk/camel-core: pom.xml src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java
Date Wed, 18 Jun 2008 07:31:27 GMT
Hi Claus

I still can't get DataSetSedaTest pass on my windows box,  so I will 
exclude the test and wait for a better solution.

Willem

davsclaus@apache.org wrote:
> 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