This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch CAMEL-13870 in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/CAMEL-13870 by this push: new 77fded2 CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress. 77fded2 is described below commit 77fded2048aceb5738fa1bef619b772ed90014c3 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Aug 23 09:48:40 2019 +0200 CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress. --- .../src/main/java/org/apache/camel/support/CamelContextHelper.java | 4 ++-- .../src/test/java/org/apache/camel/itest/jmh/LogEndpointTest.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/camel-support/src/main/java/org/apache/camel/support/CamelContextHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/CamelContextHelper.java index b275b9e..13bfaf0 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/CamelContextHelper.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/CamelContextHelper.java @@ -242,8 +242,8 @@ public final class CamelContextHelper { if (s != null) { // we cannot use Camel type converters as they may not be ready this early try { - Integer size = Integer.valueOf(s); - if (size == null || size <= 0) { + int size = Integer.parseInt(s); + if (size <= 0) { throw new IllegalArgumentException("Property " + Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE + " must be a positive number, was: " + s); } return size; diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/LogEndpointTest.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/LogEndpointTest.java index eb2174f..ddf8546 100644 --- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/LogEndpointTest.java +++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/LogEndpointTest.java @@ -75,7 +75,7 @@ public class LogEndpointTest { @Setup(Level.Trial) public void initialize() { camel = new DefaultCamelContext(); - camel.getGlobalOptions().put(Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE, "0"); + camel.getGlobalOptions().put(Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE, "1"); counter = new AtomicInteger(); } @@ -94,8 +94,8 @@ public class LogEndpointTest { @Measurement(batchSize = 1000) public void logEndpoint(BenchmarkState state, Blackhole bh) { // use the legacy binding which uses reflection - // Endpoint out = state.camel.getEndpoint("log:foo?basicPropertyBinding=true&groupSize=" + state.counter.incrementAndGet()); - Endpoint out = state.camel.getEndpoint("log:foo?groupSize=" + state.counter.incrementAndGet()); + // Endpoint out = state.camel.getEndpoint("log:foo?basicPropertyBinding=true&showAll=true&groupSize=" + state.counter.incrementAndGet()); + Endpoint out = state.camel.getEndpoint("log:foo?showAll=true&groupSize=" + state.counter.incrementAndGet()); bh.consume(out); }