This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new da5f2a9 CAMEL-12513: Camel breadcrumb is disabled by default now. da5f2a9 is described below commit da5f2a9a319c77d6260ee624adf6c39196dd086a Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Feb 14 08:14:04 2019 +0100 CAMEL-12513: Camel breadcrumb is disabled by default now. --- MIGRATION.md | 5 +++++ .../org/apache/camel/component/kafka/KafkaProducerFullTest.java | 4 ++-- components/camel-spring-boot/src/main/docs/spring-boot.adoc | 2 +- .../apache/camel/spring/boot/CamelConfigurationProperties.java | 4 ++-- .../java/org/apache/camel/spring/CamelContextFactoryBean.java | 2 +- .../main/java/org/apache/camel/impl/AbstractCamelContext.java | 2 +- .../src/test/java/org/apache/camel/processor/MDCAsyncTest.java | 3 ++- .../src/test/java/org/apache/camel/processor/PipelineTest.java | 3 +-- .../org/apache/camel/processor/RemoveHeadersExcludeTest.java | 6 ++---- .../test/java/org/apache/camel/processor/RemoveHeadersTest.java | 9 +++------ .../test/java/org/apache/camel/processor/async/AsyncMDCTest.java | 3 +++ 11 files changed, 23 insertions(+), 20 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 68ee438..e993412 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -129,6 +129,11 @@ When using the option `groupedExchange` on the aggregator EIP then the output of is now longer also stored in the exchange property `Exchange.GROUPED_EXCHANGE`. This behaviour was already deprecated from Camel 2.13 onwards. +### Other changes + +The default for use breadcrumbs has been changed from `true` to `false`. + + ### XML DSL Migration The XML DSL has been changed slightly. diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerFullTest.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerFullTest.java index 2b0e06c..cc1e861 100644 --- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerFullTest.java +++ b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerFullTest.java @@ -343,8 +343,8 @@ public class KafkaProducerFullTest extends BaseEmbeddedKafkaTest { ConsumerRecord<String, String> record = records.get(0); Headers headers = record.headers(); assertNotNull("Kafka Headers should not be null.", headers); - // we have 6 headers and 1 header with breadcrumbId - assertEquals("Seven propagated header is expected.", 7, headers.toArray().length); + // we have 6 headers + assertEquals("6 propagated header is expected.", 6, headers.toArray().length); assertEquals("Propagated string value received", propagatedStringHeaderValue, new String(getHeaderValue(propagatedStringHeaderKey, headers))); assertEquals("Propagated integer value received", propagatedIntegerHeaderValue, diff --git a/components/camel-spring-boot/src/main/docs/spring-boot.adoc b/components/camel-spring-boot/src/main/docs/spring-boot.adoc index 7d7defc..38e5dcd 100644 --- a/components/camel-spring-boot/src/main/docs/spring-boot.adoc +++ b/components/camel-spring-boot/src/main/docs/spring-boot.adoc @@ -189,7 +189,7 @@ The component supports 139 options, which are listed below. | *camel.springboot.tracer-formatter-show-body-type* | Tracer should output message body type | true | Boolean | *camel.springboot.tracing* | Sets whether tracing is enabled or not. Default is false. | false | Boolean | *camel.springboot.type-conversion* | Enables enhanced Camel/Spring type conversion. | true | Boolean -| *camel.springboot.use-breadcrumb* | Set whether breadcrumb is enabled. The default value is true. | true | Boolean +| *camel.springboot.use-breadcrumb* | Set whether breadcrumb is enabled. The default value is false. | false | Boolean | *camel.springboot.use-data-type* | Whether to enable using data type on Camel messages. Data type are automatic turned on if one ore more routes has been explicit configured with input and output types. Otherwise data type is default off. | false | Boolean | *camel.springboot.use-mdc-logging* | To turn on MDC logging | false | Boolean | *camel.springboot.xml-rests* | Directory to scan for adding additional XML rests. You can turn this off by setting the value to false. Files can be loaded from either classpath or file by prefixing with classpath: or file: Wildcards is supported using a ANT pattern style paths, such as classpath:**/*camel*.xml Multiple directories can be specified and separated by comma, such as: file:/myapp/mycamel/*.xml,file:/myapp/myothercamel/*.xml | classpath:camel-rest/*.x [...] diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java index 8be5484..6facf83 100644 --- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java +++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java @@ -350,9 +350,9 @@ public class CamelConfigurationProperties { /** * Set whether breadcrumb is enabled. - * The default value is true. + * The default value is false. */ - private boolean useBreadcrumb = true; + private boolean useBreadcrumb; /** * Sets the JMX statistics level diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java index 666aee5..9613697 100644 --- a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java +++ b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java @@ -126,7 +126,7 @@ public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<Spr private String useMDCLogging; @XmlAttribute private String useDataType; - @XmlAttribute @Metadata(defaultValue = "true") + @XmlAttribute private String useBreadcrumb; @XmlAttribute private String allowUseOriginalMessage; diff --git a/core/camel-core/src/main/java/org/apache/camel/impl/AbstractCamelContext.java b/core/camel-core/src/main/java/org/apache/camel/impl/AbstractCamelContext.java index f71b66c..658bc36 100644 --- a/core/camel-core/src/main/java/org/apache/camel/impl/AbstractCamelContext.java +++ b/core/camel-core/src/main/java/org/apache/camel/impl/AbstractCamelContext.java @@ -234,7 +234,7 @@ public abstract class AbstractCamelContext extends ServiceSupport implements Mod private Boolean typeConverterStatisticsEnabled = Boolean.FALSE; private Boolean useMDCLogging = Boolean.FALSE; private Boolean useDataType = Boolean.FALSE; - private Boolean useBreadcrumb = Boolean.TRUE; + private Boolean useBreadcrumb = Boolean.FALSE; private Boolean allowUseOriginalMessage = Boolean.FALSE; private Long delay; private ErrorHandlerFactory errorHandlerBuilder; diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/MDCAsyncTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/MDCAsyncTest.java index 5a4293b..998343f 100644 --- a/core/camel-core/src/test/java/org/apache/camel/processor/MDCAsyncTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/processor/MDCAsyncTest.java @@ -49,8 +49,9 @@ public class MDCAsyncTest extends ContextTestSupport { return new RouteBuilder() { @Override public void configure() throws Exception { - // enable MDC + // enable MDC and breadcrumb context.setUseMDCLogging(true); + context.setUseBreadcrumb(true); MdcCheckerProcessor checker = new MdcCheckerProcessor(); diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/PipelineTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/PipelineTest.java index b3df084..b791a51 100644 --- a/core/camel-core/src/test/java/org/apache/camel/processor/PipelineTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/processor/PipelineTest.java @@ -133,8 +133,7 @@ public class PipelineTest extends ContextTestSupport { exchange.getIn().setBody("test"); } }); - // there is always breadcrumb header - assertEquals("There should have no message header", 1, exchange.getOut().getHeaders().size()); + assertEquals("There should have no message header", 0, exchange.getOut().getHeaders().size()); assertEquals("There should have no attachments", 0, exchange.getOut().getAttachmentObjects().size()); assertEquals("There should have no attachments", 0, exchange.getOut().getAttachments().size()); assertEquals("Get a wrong message body", "test", exchange.getOut().getBody()); diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RemoveHeadersExcludeTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RemoveHeadersExcludeTest.java index e38aba1..67ee91b 100644 --- a/core/camel-core/src/test/java/org/apache/camel/processor/RemoveHeadersExcludeTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/processor/RemoveHeadersExcludeTest.java @@ -42,8 +42,7 @@ public class RemoveHeadersExcludeTest extends ContextTestSupport { assertMockEndpointsSatisfied(); - // there is also a breadcrumb header - assertEquals(2, mock.getReceivedExchanges().get(0).getIn().getHeaders().size()); + assertEquals(1, mock.getReceivedExchanges().get(0).getIn().getHeaders().size()); } @Test @@ -66,8 +65,7 @@ public class RemoveHeadersExcludeTest extends ContextTestSupport { assertMockEndpointsSatisfied(); - // there is also a breadcrumb header - assertEquals(4, mock.getReceivedExchanges().get(0).getIn().getHeaders().size()); + assertEquals(3, mock.getReceivedExchanges().get(0).getIn().getHeaders().size()); } protected RouteBuilder createRouteBuilder() { diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RemoveHeadersTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RemoveHeadersTest.java index 0f4c6d7..9e951ac 100644 --- a/core/camel-core/src/test/java/org/apache/camel/processor/RemoveHeadersTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/processor/RemoveHeadersTest.java @@ -43,8 +43,7 @@ public class RemoveHeadersTest extends ContextTestSupport { assertMockEndpointsSatisfied(); - // breadcrumb is a header added as well so we expect 2 - assertEquals(2, mock.getReceivedExchanges().get(0).getIn().getHeaders().size()); + assertEquals(1, mock.getReceivedExchanges().get(0).getIn().getHeaders().size()); } @Test @@ -68,8 +67,7 @@ public class RemoveHeadersTest extends ContextTestSupport { assertMockEndpointsSatisfied(); - // breadcrumb is a header added as well so we expect 3 - assertEquals(3, mock.getReceivedExchanges().get(0).getIn().getHeaders().size()); + assertEquals(2, mock.getReceivedExchanges().get(0).getIn().getHeaders().size()); } @Test @@ -93,8 +91,7 @@ public class RemoveHeadersTest extends ContextTestSupport { assertMockEndpointsSatisfied(); - // breadcrumb is a header added as well so we expect 3 - assertEquals(3, mock.getReceivedExchanges().get(0).getIn().getHeaders().size()); + assertEquals(2, mock.getReceivedExchanges().get(0).getIn().getHeaders().size()); } protected RouteBuilder createRouteBuilder() { diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/async/AsyncMDCTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/async/AsyncMDCTest.java index 35b8d32..91447cd 100644 --- a/core/camel-core/src/test/java/org/apache/camel/processor/async/AsyncMDCTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/processor/async/AsyncMDCTest.java @@ -65,6 +65,8 @@ public class AsyncMDCTest extends ContextTestSupport { public void configure() throws Exception { // enable MDC context.setUseMDCLogging(true); + // enable breadcrumb + context.setUseBreadcrumb(true); context.addComponent("async", new MyAsyncComponent()); @@ -75,6 +77,7 @@ public class AsyncMDCTest extends ContextTestSupport { assertEquals(exchange.getExchangeId(), MDC.get(MDC_EXCHANGE_ID)); assertEquals(exchange.getContext().getName(), MDC.get(MDC_CAMEL_CONTEXT_ID)); assertEquals(exchange.getIn().getHeader(Exchange.BREADCRUMB_ID), MDC.get(MDC_BREADCRUMB_ID)); + assertNotNull(MDC.get(MDC_BREADCRUMB_ID)); } }) .to("log:before")