Repository: camel Updated Branches: refs/heads/master 5875067f0 -> 1fd504a12
Lets reuse the header filter from the base component instead Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bf5d419d Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bf5d419d Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bf5d419d Branch: refs/heads/master Commit: bf5d419d60816c04651c5cf34bfb23ac4fbf6783 Parents: 5875067 Author: Claus Ibsen <[email protected]> Authored: Wed Dec 21 18:57:51 2016 +0100 Committer: Claus Ibsen <[email protected]> Committed: Wed Dec 21 18:57:51 2016 +0100 ---------------------------------------------------------------------- .../springboot/JmsComponentConfiguration.java | 30 ++++++++++---------- .../camel-jms/src/main/docs/jms-component.adoc | 2 +- .../camel/component/jms/JmsComponent.java | 23 +++------------ 3 files changed, 20 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/bf5d419d/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java b/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java index bc77edf..99008ea 100644 --- a/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java +++ b/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java @@ -533,12 +533,6 @@ public class JmsComponentConfiguration { @NestedConfigurationProperty private QueueBrowseStrategy queueBrowseStrategy; /** - * To use a custom HeaderFilterStrategy to filter header to and from Camel - * message. - */ - @NestedConfigurationProperty - private HeaderFilterStrategy headerFilterStrategy; - /** * To use the given MessageCreatedStrategy which are invoked when Camel * creates new instances of javax.jms.Message objects when Camel is sending * a JMS message. @@ -556,6 +550,12 @@ public class JmsComponentConfiguration { * correlation id to be updated. */ private Long waitForProvisionCorrelationToBeUpdatedThreadSleepingTime; + /** + * To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter + * header to and from Camel message. + */ + @NestedConfigurationProperty + private HeaderFilterStrategy headerFilterStrategy; public JmsConfigurationNestedConfiguration getConfiguration() { return configuration; @@ -1131,15 +1131,6 @@ public class JmsComponentConfiguration { this.queueBrowseStrategy = queueBrowseStrategy; } - public HeaderFilterStrategy getHeaderFilterStrategy() { - return headerFilterStrategy; - } - - public void setHeaderFilterStrategy( - HeaderFilterStrategy headerFilterStrategy) { - this.headerFilterStrategy = headerFilterStrategy; - } - public MessageCreatedStrategy getMessageCreatedStrategy() { return messageCreatedStrategy; } @@ -1167,6 +1158,15 @@ public class JmsComponentConfiguration { this.waitForProvisionCorrelationToBeUpdatedThreadSleepingTime = waitForProvisionCorrelationToBeUpdatedThreadSleepingTime; } + public HeaderFilterStrategy getHeaderFilterStrategy() { + return headerFilterStrategy; + } + + public void setHeaderFilterStrategy( + HeaderFilterStrategy headerFilterStrategy) { + this.headerFilterStrategy = headerFilterStrategy; + } + public static class JmsConfigurationNestedConfiguration { public static final Class CAMEL_NESTED_CLASS = org.apache.camel.component.jms.JmsConfiguration.class; /** http://git-wip-us.apache.org/repos/asf/camel/blob/bf5d419d/components/camel-jms/src/main/docs/jms-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-jms/src/main/docs/jms-component.adoc b/components/camel-jms/src/main/docs/jms-component.adoc index 0a17932..c010d54 100644 --- a/components/camel-jms/src/main/docs/jms-component.adoc +++ b/components/camel-jms/src/main/docs/jms-component.adoc @@ -292,10 +292,10 @@ The JMS component supports 74 options which are listed below. | jmsKeyFormatStrategy | JmsKeyFormatStrategy | Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the notation. | applicationContext | ApplicationContext | Sets the Spring ApplicationContext to use | queueBrowseStrategy | QueueBrowseStrategy | To use a custom QueueBrowseStrategy when browsing queues -| headerFilterStrategy | HeaderFilterStrategy | To use a custom HeaderFilterStrategy to filter header to and from Camel message. | messageCreatedStrategy | MessageCreatedStrategy | To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of javax.jms.Message objects when Camel is sending a JMS message. | waitForProvisionCorrelationToBeUpdatedCounter | int | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | waitForProvisionCorrelationToBeUpdatedThreadSleepingTime | long | Interval in millis to sleep each time while waiting for provisional correlation id to be updated. +| headerFilterStrategy | HeaderFilterStrategy | To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message. |======================================================================= {% endraw %} // component options: END http://git-wip-us.apache.org/repos/asf/camel/blob/bf5d419d/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java index b303b30..b1ee124 100644 --- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java +++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java @@ -25,9 +25,7 @@ import javax.jms.Session; import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; import org.apache.camel.LoggingLevel; -import org.apache.camel.impl.UriEndpointComponent; -import org.apache.camel.spi.HeaderFilterStrategy; -import org.apache.camel.spi.HeaderFilterStrategyAware; +import org.apache.camel.impl.HeaderFilterStrategyComponent; import org.apache.camel.spi.Metadata; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; @@ -51,7 +49,7 @@ import static org.apache.camel.util.ObjectHelper.removeStartingCharacters; * * @version */ -public class JmsComponent extends UriEndpointComponent implements ApplicationContextAware, HeaderFilterStrategyAware { +public class JmsComponent extends HeaderFilterStrategyComponent implements ApplicationContextAware { private static final Logger LOG = LoggerFactory.getLogger(JmsComponent.class); @@ -64,8 +62,6 @@ public class JmsComponent extends UriEndpointComponent implements ApplicationCon private JmsConfiguration configuration; @Metadata(label = "advanced", description = "To use a custom QueueBrowseStrategy when browsing queues") private QueueBrowseStrategy queueBrowseStrategy; - @Metadata(label = "advanced", description = "To use a custom HeaderFilterStrategy to filter header to and from Camel message.") - private HeaderFilterStrategy headerFilterStrategy; @Metadata(label = "advanced", description = "To use the given MessageCreatedStrategy which are invoked when Camel creates new instances" + " of javax.jms.Message objects when Camel is sending a JMS message.") private MessageCreatedStrategy messageCreatedStrategy; @@ -834,17 +830,6 @@ public class JmsComponent extends UriEndpointComponent implements ApplicationCon this.queueBrowseStrategy = queueBrowseStrategy; } - public HeaderFilterStrategy getHeaderFilterStrategy() { - return headerFilterStrategy; - } - - /** - * To use a custom HeaderFilterStrategy to filter header to and from Camel message. - */ - public void setHeaderFilterStrategy(HeaderFilterStrategy strategy) { - this.headerFilterStrategy = strategy; - } - public MessageCreatedStrategy getMessageCreatedStrategy() { return messageCreatedStrategy; } @@ -885,8 +870,8 @@ public class JmsComponent extends UriEndpointComponent implements ApplicationCon @Override protected void doStart() throws Exception { - if (headerFilterStrategy == null) { - headerFilterStrategy = new JmsHeaderFilterStrategy(getConfiguration().isIncludeAllJMSXProperties()); + if (getHeaderFilterStrategy() == null) { + setHeaderFilterStrategy(new JmsHeaderFilterStrategy(getConfiguration().isIncludeAllJMSXProperties())); } }
