Skip to content

Commit

Permalink
Update dependencies to its latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
ribeach1 committed Jul 5, 2018
1 parent 9e39a0a commit 6b729b7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-data-provider</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>

<packaging>jar</packaging>

Expand All @@ -16,10 +16,10 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<camel.version>2.18.1</camel.version>
<slf4j.version>1.7.22</slf4j.version>
<logback.classic>1.2.1</logback.classic>
<guava.version>21.0</guava.version>
<camel.version>2.21.1</camel.version>
<slf4j.version>1.7.25</slf4j.version>
<logback.classic>1.2.3</logback.classic>
<guava.version>25.1-jre</guava.version>
<mockito.version>1.10.19</mockito.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
* {@link PollingConsumerSupport} extension for {@link IDataProvider}.
Expand All @@ -30,8 +35,9 @@ public class DataProviderPollingConsumer extends PollingConsumerSupport {
@Override
public Exchange receive() {
Range<Integer> range = createRange();
LogUtils.info(LOG, () -> String.format("Handling range '%s'.", range));
Iterable<?> partition = getEndpoint().getDataProvider().partition(range);
IDataProvider<?> dataProvider = getEndpoint().getDataProvider();
LogUtils.info(LOG, () -> String.format("[%s] Handling range '%s'.", dataProvider.getName(), range));
Iterable<?> partition = dataProvider.partition(range);
Exchange exchange = getEndpoint().createExchange();
int size = Iterables.size(partition);
Message in = exchange.getIn();
Expand Down Expand Up @@ -65,12 +71,12 @@ public Exchange receive(long timeout) {
}

@Override
protected void doStart() throws Exception {
protected void doStart() {
executorService = getCamelContext().getExecutorServiceManager().newDefaultThreadPool(this, getClass().getSimpleName());
}

@Override
protected void doStop() throws Exception {
protected void doStop() {
getCamelContext().getExecutorServiceManager().shutdown(executorService);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.apache.camel.component.dataprovider;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.JndiRegistry;
Expand Down Expand Up @@ -29,11 +31,12 @@ protected JndiRegistry createRegistry() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
from("dataprovider://foo?consumer.useFixedDelay=true&consumer.delay=20&consumer.maxMessagesPerPoll=20&initialDelay=20").
to("mock:result");
from("dataprovider://foo?consumer.maxMessagesPerPoll=20&initialDelay=20&greedy=true")
.to("seda:input");
from("seda:input").threads(20).process(exchange -> Thread.sleep(100L)).to("mock:result");
}
};
}
Expand Down

0 comments on commit 6b729b7

Please sign in to comment.