You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/08/24 09:36:22 UTC
[1/7] camel git commit: CAMEL-8010:Included onSubmitCompletion in the
lock section to prevent race condiditon
Repository: camel
Updated Branches:
refs/heads/master 8163a8f0e -> 5481b9cf8
CAMEL-8010:Included onSubmitCompletion in the lock section to prevent race condiditon
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/45403daa
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/45403daa
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/45403daa
Branch: refs/heads/master
Commit: 45403daaf4f47104a59962ff4aebfdef2adf5f7c
Parents: 655c771
Author: Rajithamol <rl...@mediaocean.com>
Authored: Fri Aug 18 15:24:41 2017 -0400
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Aug 24 11:18:46 2017 +0200
----------------------------------------------------------------------
.../camel/processor/aggregate/AggregateProcessor.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/45403daa/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
index 6d2c5a3..236665e 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
@@ -346,16 +346,16 @@ public class AggregateProcessor extends ServiceSupport implements AsyncProcessor
lock.lock();
try {
aggregated = doAggregation(key, copy);
+ // we are completed so do that work outside the lock
+ if (aggregated != null) {
+ for (Exchange agg : aggregated) {
+ onSubmitCompletion(key, agg);
+ }
+ }
} finally {
lock.unlock();
}
- // we are completed so do that work outside the lock
- if (aggregated != null) {
- for (Exchange agg : aggregated) {
- onSubmitCompletion(key, agg);
- }
- }
}
// check for the special header to force completion of all groups (inclusive of the message)
[6/7] camel git commit: This close #1892
Posted by ac...@apache.org.
This close #1892
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/eeca67cf
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eeca67cf
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eeca67cf
Branch: refs/heads/master
Commit: eeca67cf5f91df9ae543d1a81f4b8bd540fba438
Parents: e419e2d
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Aug 24 11:19:17 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Aug 24 11:19:17 2017 +0200
----------------------------------------------------------------------
----------------------------------------------------------------------
[2/7] camel git commit: CAMEL-8010:Locking the critical section to
avoid race condition if AggregateTimeOutChecker also completes at the same
time as Recover task
Posted by ac...@apache.org.
CAMEL-8010:Locking the critical section to avoid race condition if AggregateTimeOutChecker also completes at the same time as Recover task
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/655c771c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/655c771c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/655c771c
Branch: refs/heads/master
Commit: 655c771c330f2ce404b4515d3c649da7b8a22a35
Parents: 8163a8f
Author: Rajithamol <rl...@mediaocean.com>
Authored: Wed Aug 16 14:10:30 2017 -0400
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Aug 24 11:18:46 2017 +0200
----------------------------------------------------------------------
.../processor/aggregate/AggregateProcessor.java | 113 ++++++++++---------
1 file changed, 61 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/655c771c/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
index 50978a0..6d2c5a3 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
@@ -1223,68 +1223,77 @@ public class AggregateProcessor extends ServiceSupport implements AsyncProcessor
LOG.info("We are shutting down so stop recovering");
return;
}
+ if(!optimisticLocking){
+ lock.lock();
+ }
+ try {
+ // consider in progress if it was in progress before we did the scan, or currently after we did the scan
+ // its safer to consider it in progress than risk duplicates due both in progress + recovered
+ boolean inProgress = copyOfInProgress.contains(exchangeId) || inProgressCompleteExchanges.contains(exchangeId);
+ if (inProgress) {
+ LOG.trace("Aggregated exchange with id: {} is already in progress.", exchangeId);
+ } else {
+ LOG.debug("Loading aggregated exchange with id: {} to be recovered.", exchangeId);
+ Exchange exchange = recoverable.recover(camelContext, exchangeId);
+ if (exchange != null) {
+ // get the correlation key
+ String key = exchange.getProperty(Exchange.AGGREGATED_CORRELATION_KEY, String.class);
+ // and mark it as redelivered
+ exchange.getIn().setHeader(Exchange.REDELIVERED, Boolean.TRUE);
+
+ // get the current redelivery data
+ RedeliveryData data = redeliveryState.get(exchange.getExchangeId());
+
+ // if we are exhausted, then move to dead letter channel
+ if (data != null && recoverable.getMaximumRedeliveries() > 0 && data.redeliveryCounter >= recoverable.getMaximumRedeliveries()) {
+ LOG.warn("The recovered exchange is exhausted after " + recoverable.getMaximumRedeliveries()
+ + " attempts, will now be moved to dead letter channel: " + recoverable.getDeadLetterUri());
+
+ // send to DLC
+ try {
+ // set redelivery counter
+ exchange.getIn().setHeader(Exchange.REDELIVERY_COUNTER, data.redeliveryCounter);
+ exchange.getIn().setHeader(Exchange.REDELIVERY_EXHAUSTED, Boolean.TRUE);
+ deadLetterProducerTemplate.send(recoverable.getDeadLetterUri(), exchange);
+ } catch (Throwable e) {
+ exchange.setException(e);
+ }
- // consider in progress if it was in progress before we did the scan, or currently after we did the scan
- // its safer to consider it in progress than risk duplicates due both in progress + recovered
- boolean inProgress = copyOfInProgress.contains(exchangeId) || inProgressCompleteExchanges.contains(exchangeId);
- if (inProgress) {
- LOG.trace("Aggregated exchange with id: {} is already in progress.", exchangeId);
- } else {
- LOG.debug("Loading aggregated exchange with id: {} to be recovered.", exchangeId);
- Exchange exchange = recoverable.recover(camelContext, exchangeId);
- if (exchange != null) {
- // get the correlation key
- String key = exchange.getProperty(Exchange.AGGREGATED_CORRELATION_KEY, String.class);
- // and mark it as redelivered
- exchange.getIn().setHeader(Exchange.REDELIVERED, Boolean.TRUE);
-
- // get the current redelivery data
- RedeliveryData data = redeliveryState.get(exchange.getExchangeId());
-
- // if we are exhausted, then move to dead letter channel
- if (data != null && recoverable.getMaximumRedeliveries() > 0 && data.redeliveryCounter >= recoverable.getMaximumRedeliveries()) {
- LOG.warn("The recovered exchange is exhausted after " + recoverable.getMaximumRedeliveries()
- + " attempts, will now be moved to dead letter channel: " + recoverable.getDeadLetterUri());
+ // handle if failed
+ if (exchange.getException() != null) {
+ getExceptionHandler().handleException("Failed to move recovered Exchange to dead letter channel: " + recoverable.getDeadLetterUri(), exchange.getException());
+ } else {
+ // it was ok, so confirm after it has been moved to dead letter channel, so we wont recover it again
+ recoverable.confirm(camelContext, exchangeId);
+ }
+ } else {
+ // update current redelivery state
+ if (data == null) {
+ // create new data
+ data = new RedeliveryData();
+ redeliveryState.put(exchange.getExchangeId(), data);
+ }
+ data.redeliveryCounter++;
- // send to DLC
- try {
// set redelivery counter
exchange.getIn().setHeader(Exchange.REDELIVERY_COUNTER, data.redeliveryCounter);
- exchange.getIn().setHeader(Exchange.REDELIVERY_EXHAUSTED, Boolean.TRUE);
- deadLetterProducerTemplate.send(recoverable.getDeadLetterUri(), exchange);
- } catch (Throwable e) {
- exchange.setException(e);
- }
+ if (recoverable.getMaximumRedeliveries() > 0) {
+ exchange.getIn().setHeader(Exchange.REDELIVERY_MAX_COUNTER, recoverable.getMaximumRedeliveries());
+ }
- // handle if failed
- if (exchange.getException() != null) {
- getExceptionHandler().handleException("Failed to move recovered Exchange to dead letter channel: " + recoverable.getDeadLetterUri(), exchange.getException());
- } else {
- // it was ok, so confirm after it has been moved to dead letter channel, so we wont recover it again
- recoverable.confirm(camelContext, exchangeId);
- }
- } else {
- // update current redelivery state
- if (data == null) {
- // create new data
- data = new RedeliveryData();
- redeliveryState.put(exchange.getExchangeId(), data);
- }
- data.redeliveryCounter++;
+ LOG.debug("Delivery attempt: {} to recover aggregated exchange with id: {}", data.redeliveryCounter, exchangeId);
- // set redelivery counter
- exchange.getIn().setHeader(Exchange.REDELIVERY_COUNTER, data.redeliveryCounter);
- if (recoverable.getMaximumRedeliveries() > 0) {
- exchange.getIn().setHeader(Exchange.REDELIVERY_MAX_COUNTER, recoverable.getMaximumRedeliveries());
+ // not exhaust so resubmit the recovered exchange
+ onSubmitCompletion(key, exchange);
}
-
- LOG.debug("Delivery attempt: {} to recover aggregated exchange with id: {}", data.redeliveryCounter, exchangeId);
-
- // not exhaust so resubmit the recovered exchange
- onSubmitCompletion(key, exchange);
}
}
}
+ finally {
+ if(!optimisticLocking){
+ lock.unlock();
+ }
+ }
}
LOG.trace("Recover check complete");
[7/7] camel git commit: CAMEL-11645 - Add pattern exclusion mechanism
similar to the one provided by the camel-zipkin component
Posted by ac...@apache.org.
CAMEL-11645 - Add pattern exclusion mechanism similar to the one provided by the camel-zipkin component
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5481b9cf
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5481b9cf
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5481b9cf
Branch: refs/heads/master
Commit: 5481b9cf83af2123006a671fb92b06746aacabb4
Parents: eeca67c
Author: Gary Brown <ga...@brownuk.com>
Authored: Tue Aug 22 16:58:17 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Aug 24 11:33:06 2017 +0200
----------------------------------------------------------------------
.../src/main/docs/opentracing.adoc | 13 ++++
.../camel/opentracing/OpenTracingTracer.java | 42 +++++++++++-
.../CamelOpenTracingTestSupport.java | 7 ++
.../opentracing/TwoServiceWithExcludeTest.java | 69 ++++++++++++++++++++
.../starter/OpenTracingAutoConfiguration.java | 3 +
.../OpenTracingConfigurationProperties.java | 15 ++++-
6 files changed, 146 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/5481b9cf/components/camel-opentracing/src/main/docs/opentracing.adoc
----------------------------------------------------------------------
diff --git a/components/camel-opentracing/src/main/docs/opentracing.adoc b/components/camel-opentracing/src/main/docs/opentracing.adoc
index f753880..f7e0a8b 100644
--- a/components/camel-opentracing/src/main/docs/opentracing.adoc
+++ b/components/camel-opentracing/src/main/docs/opentracing.adoc
@@ -14,6 +14,19 @@ See the http://opentracing.io/[OpenTracing] website for a list of supported trac
### Configuration
+The configuration properties for the OpenTracing tracer are:
+
+[width="100%",cols="10%,10%,80%",options="header",]
+|=======================================================================
+|Option |Default |Description
+
+|excludePatterns | | Sets exclude pattern(s) that will disable tracing for Camel
+messages that matches the pattern. The content is a Set<String> where the key is a pattern. The pattern
+uses the rules from link:intercept.html[Intercept].
+
+|=======================================================================
+
+
There are three ways in which an OpenTracing tracer can be configured to provide distributed tracing for a Camel application:
#### Explicit
http://git-wip-us.apache.org/repos/asf/camel/blob/5481b9cf/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/OpenTracingTracer.java
----------------------------------------------------------------------
diff --git a/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/OpenTracingTracer.java b/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/OpenTracingTracer.java
index 2cafa59..561c9f9 100644
--- a/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/OpenTracingTracer.java
+++ b/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/OpenTracingTracer.java
@@ -19,6 +19,7 @@ package org.apache.camel.opentracing;
import java.net.URI;
import java.util.EventObject;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.ServiceLoader;
import java.util.Set;
@@ -49,6 +50,7 @@ import org.apache.camel.support.EventNotifierSupport;
import org.apache.camel.support.RoutePolicySupport;
import org.apache.camel.support.ServiceSupport;
import org.apache.camel.util.CamelLogger;
+import org.apache.camel.util.EndpointHelper;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.ServiceHelper;
import org.slf4j.Logger;
@@ -72,6 +74,7 @@ public class OpenTracingTracer extends ServiceSupport implements RoutePolicyFact
private final OpenTracingLogListener logListener = new OpenTracingLogListener();
private Tracer tracer;
private CamelContext camelContext;
+ private Set<String> excludePatterns = new HashSet<>();
static {
ServiceLoader.load(SpanDecorator.class).forEach(d -> {
@@ -121,6 +124,23 @@ public class OpenTracingTracer extends ServiceSupport implements RoutePolicyFact
this.camelContext = camelContext;
}
+ public Set<String> getExcludePatterns() {
+ return excludePatterns;
+ }
+
+ public void setExcludePatterns(Set<String> excludePatterns) {
+ this.excludePatterns = excludePatterns;
+ }
+
+ /**
+ * Adds an exclude pattern that will disable tracing for Camel messages that matches the pattern.
+ *
+ * @param pattern the pattern such as route id, endpoint url
+ */
+ public void addExcludePattern(String pattern) {
+ excludePatterns.add(pattern);
+ }
+
public Tracer getTracer() {
return tracer;
}
@@ -176,6 +196,18 @@ public class OpenTracingTracer extends ServiceSupport implements RoutePolicyFact
return sd;
}
+ private boolean isExcluded(Exchange exchange, Endpoint endpoint) {
+ String url = endpoint.getEndpointUri();
+ if (url != null && !excludePatterns.isEmpty()) {
+ for (String pattern : excludePatterns) {
+ if (EndpointHelper.matchEndpoint(exchange.getContext(), url, pattern)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
private final class OpenTracingEventNotifier extends EventNotifierSupport {
@Override
@@ -184,7 +216,7 @@ public class OpenTracingTracer extends ServiceSupport implements RoutePolicyFact
if (event instanceof ExchangeSendingEvent) {
ExchangeSendingEvent ese = (ExchangeSendingEvent) event;
SpanDecorator sd = getSpanDecorator(ese.getEndpoint());
- if (!sd.newSpan()) {
+ if (!sd.newSpan() || isExcluded(ese.getExchange(), ese.getEndpoint())) {
return;
}
Span parent = ActiveSpanManager.getSpan(ese.getExchange());
@@ -206,7 +238,7 @@ public class OpenTracingTracer extends ServiceSupport implements RoutePolicyFact
} else if (event instanceof ExchangeSentEvent) {
ExchangeSentEvent ese = (ExchangeSentEvent) event;
SpanDecorator sd = getSpanDecorator(ese.getEndpoint());
- if (!sd.newSpan()) {
+ if (!sd.newSpan() || isExcluded(ese.getExchange(), ese.getEndpoint())) {
return;
}
Span span = ActiveSpanManager.getSpan(ese.getExchange());
@@ -247,6 +279,9 @@ public class OpenTracingTracer extends ServiceSupport implements RoutePolicyFact
@Override
public void onExchangeBegin(Route route, Exchange exchange) {
try {
+ if (isExcluded(exchange, route.getEndpoint())) {
+ return;
+ }
SpanDecorator sd = getSpanDecorator(route.getEndpoint());
Span span = tracer.buildSpan(sd.getOperationName(exchange, route.getEndpoint()))
.asChildOf(tracer.extract(Format.Builtin.TEXT_MAP,
@@ -267,6 +302,9 @@ public class OpenTracingTracer extends ServiceSupport implements RoutePolicyFact
@Override
public void onExchangeDone(Route route, Exchange exchange) {
try {
+ if (isExcluded(exchange, route.getEndpoint())) {
+ return;
+ }
Span span = ActiveSpanManager.getSpan(exchange);
if (span != null) {
if (LOG.isTraceEnabled()) {
http://git-wip-us.apache.org/repos/asf/camel/blob/5481b9cf/components/camel-opentracing/src/test/java/org/apache/camel/opentracing/CamelOpenTracingTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-opentracing/src/test/java/org/apache/camel/opentracing/CamelOpenTracingTestSupport.java b/components/camel-opentracing/src/test/java/org/apache/camel/opentracing/CamelOpenTracingTestSupport.java
index 4b87ab5..d56ed34 100644
--- a/components/camel-opentracing/src/test/java/org/apache/camel/opentracing/CamelOpenTracingTestSupport.java
+++ b/components/camel-opentracing/src/test/java/org/apache/camel/opentracing/CamelOpenTracingTestSupport.java
@@ -20,8 +20,10 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.stream.Collectors;
import io.opentracing.Span;
@@ -55,6 +57,7 @@ public class CamelOpenTracingTestSupport extends CamelTestSupport {
OpenTracingTracer ottracer = new OpenTracingTracer();
ottracer.setTracer(tracer);
+ ottracer.setExcludePatterns(getExcludePatterns());
ottracer.init(context);
@@ -65,6 +68,10 @@ public class CamelOpenTracingTestSupport extends CamelTestSupport {
return tracer;
}
+ protected Set<String> getExcludePatterns() {
+ return new HashSet<String>();
+ }
+
protected void verify() {
verify(false);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/5481b9cf/components/camel-opentracing/src/test/java/org/apache/camel/opentracing/TwoServiceWithExcludeTest.java
----------------------------------------------------------------------
diff --git a/components/camel-opentracing/src/test/java/org/apache/camel/opentracing/TwoServiceWithExcludeTest.java b/components/camel-opentracing/src/test/java/org/apache/camel/opentracing/TwoServiceWithExcludeTest.java
new file mode 100644
index 0000000..a24f950
--- /dev/null
+++ b/components/camel-opentracing/src/test/java/org/apache/camel/opentracing/TwoServiceWithExcludeTest.java
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.opentracing;
+
+import java.util.Collections;
+import java.util.Set;
+
+import io.opentracing.tag.Tags;
+
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+
+public class TwoServiceWithExcludeTest extends CamelOpenTracingTestSupport {
+
+ private static SpanTestData[] testdata = {
+ new SpanTestData().setLabel("ServiceA server").setUri("direct://ServiceA").setOperation("ServiceA")
+ .setKind(Tags.SPAN_KIND_SERVER).setParentId(1),
+ new SpanTestData().setLabel("ServiceA client").setUri("direct://ServiceA").setOperation("ServiceA")
+ .setKind(Tags.SPAN_KIND_CLIENT)
+ };
+
+ public TwoServiceWithExcludeTest() {
+ super(testdata);
+ }
+
+ @Override
+ protected Set<String> getExcludePatterns() {
+ return Collections.singleton("direct:ServiceB");
+ }
+
+ @Test
+ public void testRoute() throws Exception {
+ template.requestBody("direct:ServiceA", "Hello");
+
+ verify();
+ }
+
+ @Override
+ protected RoutesBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:ServiceA")
+ .log("ServiceA has been called")
+ .delay(simple("${random(1000,2000)}"))
+ .to("direct:ServiceB");
+
+ from("direct:ServiceB")
+ .log("ServiceB has been called")
+ .delay(simple("${random(0,500)}"));
+ }
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/5481b9cf/platforms/spring-boot/components-starter/camel-opentracing-starter/src/main/java/org/apache/camel/opentracing/starter/OpenTracingAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-opentracing-starter/src/main/java/org/apache/camel/opentracing/starter/OpenTracingAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-opentracing-starter/src/main/java/org/apache/camel/opentracing/starter/OpenTracingAutoConfiguration.java
index ec25984..76e5455 100644
--- a/platforms/spring-boot/components-starter/camel-opentracing-starter/src/main/java/org/apache/camel/opentracing/starter/OpenTracingAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-opentracing-starter/src/main/java/org/apache/camel/opentracing/starter/OpenTracingAutoConfiguration.java
@@ -44,6 +44,9 @@ public class OpenTracingAutoConfiguration {
if (tracer != null) {
ottracer.setTracer(tracer);
}
+ if (config.getExcludePatterns() != null) {
+ ottracer.setExcludePatterns(config.getExcludePatterns());
+ }
ottracer.init(camelContext);
return ottracer;
http://git-wip-us.apache.org/repos/asf/camel/blob/5481b9cf/platforms/spring-boot/components-starter/camel-opentracing-starter/src/main/java/org/apache/camel/opentracing/starter/OpenTracingConfigurationProperties.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-opentracing-starter/src/main/java/org/apache/camel/opentracing/starter/OpenTracingConfigurationProperties.java b/platforms/spring-boot/components-starter/camel-opentracing-starter/src/main/java/org/apache/camel/opentracing/starter/OpenTracingConfigurationProperties.java
index 6c82934..8add6b9 100644
--- a/platforms/spring-boot/components-starter/camel-opentracing-starter/src/main/java/org/apache/camel/opentracing/starter/OpenTracingConfigurationProperties.java
+++ b/platforms/spring-boot/components-starter/camel-opentracing-starter/src/main/java/org/apache/camel/opentracing/starter/OpenTracingConfigurationProperties.java
@@ -16,11 +16,24 @@
*/
package org.apache.camel.opentracing.starter;
+import java.util.Set;
+
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "camel.opentracing")
public class OpenTracingConfigurationProperties {
- // Placeholder for configuration properties
+ /**
+ * Sets exclude pattern(s) that will disable tracing for Camel messages that matches the pattern.
+ */
+ private Set<String> excludePatterns;
+
+ public Set<String> getExcludePatterns() {
+ return excludePatterns;
+ }
+
+ public void setExcludePatterns(Set<String> excludePatterns) {
+ this.excludePatterns = excludePatterns;
+ }
}
[4/7] camel git commit: CAMEL-8010:Included onSubmitCompletion in the
lock section to prevent race condiditon
Posted by ac...@apache.org.
CAMEL-8010:Included onSubmitCompletion in the lock section to prevent race condiditon
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/203fcf4d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/203fcf4d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/203fcf4d
Branch: refs/heads/master
Commit: 203fcf4d9b625cc4ee289e6bc5f21407b66e5e60
Parents: 45403da
Author: Rajithamol <rl...@mediaocean.com>
Authored: Fri Aug 18 15:34:41 2017 -0400
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Aug 24 11:18:47 2017 +0200
----------------------------------------------------------------------
.../org/apache/camel/processor/aggregate/AggregateProcessor.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/203fcf4d/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
index 236665e..e438543 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
@@ -346,7 +346,7 @@ public class AggregateProcessor extends ServiceSupport implements AsyncProcessor
lock.lock();
try {
aggregated = doAggregation(key, copy);
- // we are completed so do that work outside the lock
+ // we are completed so submit to completion
if (aggregated != null) {
for (Exchange agg : aggregated) {
onSubmitCompletion(key, agg);
[3/7] camel git commit: CAMEL-8010:Reverted previous push since
AggregatorLockingTest failed
Posted by ac...@apache.org.
CAMEL-8010:Reverted previous push since AggregatorLockingTest failed
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/094af056
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/094af056
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/094af056
Branch: refs/heads/master
Commit: 094af056c73dc747781fbf1f3279bc43dc1361cf
Parents: 203fcf4
Author: Rajithamol <rl...@mediaocean.com>
Authored: Fri Aug 18 15:55:13 2017 -0400
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Aug 24 11:18:47 2017 +0200
----------------------------------------------------------------------
.../camel/processor/aggregate/AggregateProcessor.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/094af056/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
index e438543..c05b970 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
@@ -346,16 +346,16 @@ public class AggregateProcessor extends ServiceSupport implements AsyncProcessor
lock.lock();
try {
aggregated = doAggregation(key, copy);
- // we are completed so submit to completion
- if (aggregated != null) {
- for (Exchange agg : aggregated) {
- onSubmitCompletion(key, agg);
- }
- }
+
} finally {
lock.unlock();
}
-
+ // we are completed so do that work outside the lock
+ if (aggregated != null) {
+ for (Exchange agg : aggregated) {
+ onSubmitCompletion(key, agg);
+ }
+ }
}
// check for the special header to force completion of all groups (inclusive of the message)
[5/7] camel git commit: CAMEL-8010:Fixed checkstyle
Posted by ac...@apache.org.
CAMEL-8010:Fixed checkstyle
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e419e2d1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e419e2d1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e419e2d1
Branch: refs/heads/master
Commit: e419e2d1def4a92f3a869ec3780ef80ff8da166d
Parents: 094af05
Author: Rajithamol <rl...@mediaocean.com>
Authored: Tue Aug 22 12:09:25 2017 -0400
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Aug 24 11:18:48 2017 +0200
----------------------------------------------------------------------
.../apache/camel/processor/aggregate/AggregateProcessor.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/e419e2d1/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
index c05b970..fe422da 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
@@ -1223,7 +1223,7 @@ public class AggregateProcessor extends ServiceSupport implements AsyncProcessor
LOG.info("We are shutting down so stop recovering");
return;
}
- if(!optimisticLocking){
+ if (!optimisticLocking) {
lock.lock();
}
try {
@@ -1288,9 +1288,8 @@ public class AggregateProcessor extends ServiceSupport implements AsyncProcessor
}
}
}
- }
- finally {
- if(!optimisticLocking){
+ } finally {
+ if (!optimisticLocking) {
lock.unlock();
}
}