svn commit: r997004 - in /websites/production/camel/content: cache/main.pageCache servicecall-eip.html
Author: buildbot Date: Fri Sep 9 05:19:59 2016 New Revision: 997004 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/servicecall-eip.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/servicecall-eip.html == --- websites/production/camel/content/servicecall-eip.html (original) +++ websites/production/camel/content/servicecall-eip.html Fri Sep 9 05:19:59 2016 @@ -144,7 +144,7 @@ from(direct:start) /camelContext ]]> -Common ConfigurationThese are the common configuration that each implementation is sharing.NameDefaultValueDescriptioncomponenthttpSets the default Camel component to use for calling the remote service.By default the http component is used. You can configure this to use netty4-http, jetty, restlet or some other components of choice.If the service is not HTTP protocol you can use other components such as mqtt, jms, amqp/tt etc.If the service call has been configured using an uri, then the component from the uri is used instead of this default component.loadBalancerRefSets a reference to a custom org.apache.camel.spi.ServiceCallLoadBalancer to use.serverListStrategyRefSets a reference to a custom org.apache.camel.spi.ServiceCallServerListStrategy to use.clientPropertyThese properties are specific to what service call implementation are in use.For example if using ribbon, then the cli ent properties are define in com.netflix.client.config.CommonClientConfigKey.Kubernetes ConfigurationNameDefault ValueDescriptionlookupenvironmentWhat strategy to lookup the service. Possible values: environment, dns, client. By default enviornment is used to use environment variables. dns is for using DNS domain names. client is for use Java Client to call the kubernetes master API and query which servers are active hosting the service.dnsDomainSets the DNS domain to use for DNS lookup.namespaceThe kubernetes namespace to use. Will by default use namespace from the ENV variable KUBERNETES_MASTER.apiVersionClient lookup. Kubernetes API version.masterUrlClient lookup. The url for the Kubernets master.usernameSets the username for authentication when using client lookuppasswordSets the password for authentication when using client lookupoauthTokenSets the OAUTH token for authentication (instead of username/password) when using client lookupcaCertDataSets the Certificate Authority data when using client lookupcaCertFileSets the Certificate Authority data that are loaded from the file when using client lookupclientCertDataSets the Client Certificate data when using client lookupclientCertFileSets the Client Certificate data that are loaded from the file when using client lookupclientKeyAlgoSets the Client Keystore algorit hm, such as RSA when using client lookupclientKeyDataSets the Client Keystore data when using client lookupclientKeyFileSets the Client Keystore data that are loaded from the file when using client lookupclientKeyPassphraseSets the Client Keystore passphrase when using client lookuptrustCertsfalseSets whether to turn on trust certificate check when using client lookupRibbon ConfigurationCurrenly no ribbon specific options yet. +Common ConfigurationThese are the common configuration that each implementation is sharing.NameDefaultValueDescriptioncomponenthttpSets the default Camel component to use for calling the remote service.By default the http component is used. You can configure this to use netty4-http, jetty, restlet or some other components of choice.If the service is not HTTP protocol you can use other components such as mqtt, jms, amqp/tt etc.If the service call has been configured using an uri, then the component from the uri is used instead of this default component.loadBalancerRefSets a reference to a custom org.apache.camel.spi.ServiceCallLoadBalancer to use.serverListStrategyRefSets a reference to a custom org.apache.camel.spi.ServiceCallServerListStrategy to use.clientPropertyThese properties are specific to what service call implementation are in use.For example if using ribbon, then the cli ent properties are define in com.netflix.client.config.CommonClientConfigKey.Kubernetes ConfigurationNameDefault ValueDescriptionlookupenvironmentWhat strategy to lookup the service. Possible values: environment, dns, client. By default enviornment is used to use environment variables. dns is for using DNS domain names. client is for use Java Client to call the kubernetes master API and query which servers are active hosting the service.dnsDomainSets the DNS domain to use for DNS lookup.namespaceThe kubernetes namespace to use. Will by default use namespace from the ENV variable
svn commit: r996968 [2/3] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache properties.html using-propertyplaceholder.html
Modified: websites/production/camel/content/book-in-one-page.html == --- websites/production/camel/content/book-in-one-page.html (original) +++ websites/production/camel/content/book-in-one-page.html Thu Sep 8 17:19:22 2016 @@ -3625,11 +3625,11 @@ The tutorial has been designed in two pa While not actual tutorials you might find working through the source of the various Examples useful. Tutorial on Spring Remoting with JMSThanksThis tutorial was kindly donated to Apache Camel by Martin Gilday.PrefaceThis tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a http://www.springramework.org; rel="nofollow">Spring service. The route works in a synchronous fashion returning a response to the client./**/ +/*]]>*/ Tutorial on Spring Remoting with JMSPrefacePrerequisitesDistributionAboutCreate the Camel Project Update the POM with Dependencies Writing the Server @@ -5744,11 +5744,11 @@ So we completed the last piece in the pi This example has been removed from Camel 2.9 onwards. Apache Axis 1.4 is a very old and unsupported framework. We encourage users to use CXF instead of Axis. /**/ +/*]]>*/ Tutorial using Axis 1.4 with Apache Camel PrerequisitesDistributionIntroductionSetting up the project to run Axis Maven 2wsdlConfiguring AxisRunning the Example @@ -17175,11 +17175,11 @@ template.send(direct:alias-verify& ]]> See Also Configuring CamelComponentEndpointGetting StartedCrypto Crypto is also available as a Data Format CXF ComponentWhen using CXF as a consumer, the CXF Bean Component allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to consume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.When using CXF in streaming modes (see DataFormat option), then also read about Stream caching.The cxf: component provides integration with http://cxf.apache.org;>Apache CXF for connecting to JAX-WS services hosted in CXF./**/ +/*]]>*/ CXF Component URI formatOptions The descriptions of the dataformats @@ -24034,7 +24034,7 @@ lpr://remotehost:port/path/to/printer[?o Properties ComponentAvailable as of Camel 2.3URI format -Where key is the key for the property to be looked up.OptionsNameTypeDefaultDescriptioncachebooleantrueWhether or not to cache loaded properties.encodingStringnullCamel 2.14.3/2.15.1: To use a specific charset to load the properties, such as UTF-8. By defaultISO-8859-1 (latin1) is used.fallbackToUnaugmentedPropertybooleantrueCamel 2.9 If true, first attempt resolution of property name augmented with propertyPrefix and propertySuffix before falling back the plain property name specified.If false, o nly the augmented property name is searched.ignoreMissingLocationbooleanfalseCamel 2.10: Whether to silently ignore if a location cannot be located, such as a properties file not found.locationsStringnullA list of locations to load properties. You can use comma to separate multiple locations. This option will override any default locations and only use the locations from this option.prefixTokenString{{Camel 2.9 The token to indicate the beginning of a property token.propertyPrefixStringnullCamel 2.9 Optional prefix prepended to property names before resolution.propertySuffixStringnullCamel 2.9 Optional suffix appended to property names before resolution.suffixTokenString}}Camel 2.9 The token to indicate the end of a property token.systemPropertiesModeint2Camel 2.16 The mode to use for whether to reso lve and use system properties:0= never - JVM system properties
svn commit: r996968 [1/3] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache properties.html using-propertyplaceholder.html
Author: buildbot Date: Thu Sep 8 17:19:22 2016 New Revision: 996968 Log: Production update by buildbot for camel Modified: websites/production/camel/content/book-component-appendix.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/properties.html websites/production/camel/content/using-propertyplaceholder.html Modified: websites/production/camel/content/book-component-appendix.html == --- websites/production/camel/content/book-component-appendix.html (original) +++ websites/production/camel/content/book-component-appendix.html Thu Sep 8 17:19:22 2016 @@ -1042,11 +1042,11 @@ template.send(direct:alias-verify& ]]> See Also Configuring CamelComponentEndpointGetting StartedCrypto Crypto is also available as a Data Format CXF ComponentWhen using CXF as a consumer, the CXF Bean Component allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to cons ume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.When using CXF in streaming modes (see DataFormat option), then also read about Stream caching.The cxf: component provides integration with http://cxf.apache.org;>Apache CXF for connecting to JAX-WS services hosted in CXF./**/ +/*]]>*/ CXF Component URI formatOptions The descriptions of the dataformats @@ -7901,7 +7901,7 @@ lpr://remotehost:port/path/to/printer[?o Properties ComponentAvailable as of Camel 2.3URI format -Where key is the key for the property to be looked up.OptionsNameTypeDefaultDescriptioncachebooleantrueWhether or not to cache loaded properties.encodingStringnullCamel 2.14.3/2.15.1: To use a specific charset to load the properties, such as UTF-8. By defaultISO-8859-1 (latin1) is used.fallbackToUnaugmentedPropertybooleantrueCamel 2.9 If true, first attempt resolution of property name augmented with propertyPrefix and propertySuffix before falling back the plain property name specified.If false, only the augmented property name is searched.ignoreMissingLocationbooleanfalseCamel 2.10: Whether to silently ignore if a location cannot be located, such as a properties file not found.locationsStringnullA list of locations to load properties. You can use comma to separate multiple locations. This option will override any default locations and only use the locations fr om this option.prefixTokenString{{Camel 2.9 The token to indicate the beginning of a property token.propertyPrefixStringnullCamel 2.9 Optional prefix prepended to property names before resolution.propertySuffixStringnullCamel 2.9 Optional suffix appended to property names before resolution.suffixTokenString}}Camel 2.9 The token to indicate the end of a property token.systemPropertiesModeint2Camel 2.16 The mode to use for whether to resolve and use system properties:0= never - JVM system properties are never used.1= fallback - JVM system properties are only used as fallback if no regular property with the key exists.2= override - JVM system properties are used if exists, otherwise the regular property will be used.Note: when bridging to Spring's property placeholder using org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer the configuration on BridgePropertyPlaceholderConfigurer will take precedence over the configuration on the PropertiesComponent.Resolving property from Java codeYou can use the method resolvePropertyPlaceholders on the CamelContext to resolve a property from any Java code.UsingPropertyPlaceholderAvailable as of Camel 2.3Camel now provides a new PropertiesComponent in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs. This works much like you would do if using Spring's property-placeholder tag. However Spring have a limitation which prevents 3rd party frameworks to leverage Spring property placeholders to the fullest.For more details see: How do I use Spring Property Placeholder with Camel XML.Bridging Spring and Camel property placeholdersFrom Camel 2.10: Spring's property placeholder can be bridged with Camel's. See below for more details.The property placeholder is generally in use when doing:lookup or creating endpoints.lookup of beans in the Registry.additional supported in Spring XML (see below in
svn commit: r996968 [3/3] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache properties.html using-propertyplaceholder.html
Modified: websites/production/camel/content/properties.html == --- websites/production/camel/content/properties.html (original) +++ websites/production/camel/content/properties.html Thu Sep 8 17:19:22 2016 @@ -89,7 +89,7 @@ Properties ComponentAvailable as of Camel 2.3URI format -Where key is the key for the property to be looked up.OptionsNameTypeDefaultDescriptioncachebooleantrueWhether or not to cache loaded properties.encodingStringnullCamel 2.14.3/2.15.1: To use a specific charset to load the properties, such as UTF-8. By defaultISO-8859-1 (latin1) is used.fallbackToUnaugmentedPropertybooleantrueCamel 2.9 If true, first attempt resolution of property name augmented with propertyPrefix and propertySuffix before falling back the plain property name specified.If false, only th e augmented property name is searched.ignoreMissingLocationbooleanfalseCamel 2.10: Whether to silently ignore if a location cannot be located, such as a properties file not found.locationsStringnullA list of locations to load properties. You can use comma to separate multiple locations. This option will override any default locations and only use the locations from this option .prefixTokenString{{Camel 2.9 The token to indicate the beginning of a property token.propertyPrefixStringnullCamel 2.9 Optional prefix prepended to property names before resolution.propertySuffixStringnullCamel 2.9 Optional suffix appended to property names before resolution.suffixTokenString}}Camel 2.9 The token to indicate the end of a property token.systemPropertiesModeint2Camel 2.16 The mode to use for whether to resolve an d use system properties:0= never - JVM system properties are never used.1= fallback - JVM system properties are only used as fallback if no regular property with the key exists.2= override - JVM system properties are used if exists, otherwise the regular property will be used.Note: when bridging to Spring's property placeholder using org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer the configuration on BridgePropertyPlaceholderConfigurer will take precedence over the configuration on the PropertiesComponent.Resolving property from Java codeYou can use the method resolvePropertyPlaceholders on the CamelContext to resolve a property from any Java code.UsingPropertyPlaceholderAvailable as of Camel 2.3Camel now provides a new PropertiesComponent in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs. This works much like you would do if using Spring's property-placeholder tag. However Spring have a limitation which prevents 3rd party frameworks to leverage Spring property placeholders to the fullest.For more details see: How do I use Spring Property Placeholder with Camel XML.Bridging Spring and Camel property placeholdersFrom Camel 2.10: Spring's property placeholder can be bridged with Camel's. See below for more details.The property placeholder is generally in use when doing:lookup or creating endpoints.lookup of beans in the Registry.additional supported in Spring XML (see below in examples).using BlueprintPropertyPlaceholder with Camel Properties component.using @Prope rtyInject to inject a property in a POJO.Camel 2.14.1 Using default value if a property does not exists.Camel 2.14.1 Include out of the box functions, to lookup property values from OS environment variables, JVM system properties, or the service idiom.Camel 2.14.1 Using custom functions, which can be plugged into the property component.SyntaxThe syntax to use Camel's property placeholder is to use {{key}} for example {{file.uri}} where file.uri is the property key. You can use property placeholders in parts of the endpoint URI's which for example you can use placeholders for parameters in the URIs.FromCamel 2.14.1: you can specify a default value to use if a property with the key does not exists, e.g., file.url:/so me/path where the default value is the text after the colon, e.g., /some/path.>From Camel 2.14.1: do not use a colon in the property key. The colon character is used as a token separator when providing a default valueUsingPropertyResolverCamel provides a pluggable mechanism which allows 3rd part to provide their own resolver to lookup properties. Camel provides a default implementation org.apache.camel.component.properties.DefaultPropertiesResolver which is capable of loading properties from the file system, classpath or Registry. You can prefix the locations with either:ref: Camel 2.4: to lookup in the Registry.file: to load the from file system.classpath: to load from classpath (this is also the default if no prefix is provided).blueprint: Camel 2.7: to use a specific OSGi blueprint placeholder service.Defining LocationThe PropertiesResolver need to know a location(s) where to resolve the properties.
svn commit: r996964 [3/4] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache properties.html using-propertyplaceholder.html
Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/properties.html == --- websites/production/camel/content/properties.html (original) +++ websites/production/camel/content/properties.html Thu Sep 8 16:19:03 2016 @@ -89,62 +89,66 @@ Properties ComponentAvailable as of Camel 2.3URI format -Where key is the key for the property to be looked up.OptionsNameTypeDefaultDescriptioncachebooleantrueWhether or not to cache loaded properties.encodingStringnullCamel 2.14.3/2.15.1: To use a specific charset to load the properties, such as UTF-8. By defaultISO-8859-1 (latin1) is used.fallbackToUnaugmentedPropertybooleantrueCamel 2.9 If true, first attempt resolution of property name augmented with propertyPrefix and propertySuffix before falling back the plain property name specified.If false, only th e augmented property name is searched.ignoreMissingLocationbooleanfalseCamel 2.10: Whether to silently ignore if a location cannot be located, such as a properties file not found.locationsStringnullA list of locations to load properties. You can use comma to separate multiple locations. This option will override any default locations and only use the locations from this option .prefixTokenString{{Camel 2.9 The token to indicate the beginning of a property token.propertyPrefixStringnullCamel 2.9 Optional prefix prepended to property names before resolution.propertySuffixStringnullCamel 2.9 Optional suffix appended to property names before resolution.suffixTokenString}}Camel 2.9 The token to indicate the end of a property token.systemPropertiesModeint2Camel 2.16 The mode to use for whether to resolve an d use system properties:0= never - JVM system properties are never used.1= fallback - JVM system properties are only used as fallback if no regular property with the key exists.2= override - JVM system properties are used if exists, otherwise the regular property will be used.Note: when bridging this to Spring's property placeholder with org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer then the configuration on BridgePropertyPlaceholderConfigurer takes precedence over the configuration on the PropertiesComponent.Resolving property from Java codeYou can use the method resolvePropertyPlaceholders on the CamelContext to resolve a property from any Java code.Using PropertyPlaceholderAvailable as of Camel 2.3Camel now provides a new PropertiesComponent in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs. This works much like you would do if using Spring's property-placeholder tag. However Spring have a limitation which prevents 3rd party frameworks to leverage Spring property placeholders to the fullest. See more at How do I use Spring Property Placeholder with Camel XML.class="confluence-information-macro confluence-information-macro-tip">class="title">Bridging Spring and Camel property placeholdersclass="aui-icon aui-icon-small aui-iconfont-approve >confluence-information-macro-icon">class="confluence-information-macro-body">From Camel 2.10 onwards, you can >bridge the Spring property placeholder with Camel, see further below for more >details.The property placeholder is generally in use when >doing:lookup or creating >endpointslookup of beans in the href="registry.html">Registryadditional supported in Spring XML >(see below in examples)using Blueprint PropertyPlaceholder with >Camel Properties >componentusing @PropertyInject to inject a property in >a POJOCamel 2.14.1 Using d efault value if a property does not existsCamel 2.14.1 Include out of the box functions, to lookup property values from OS environment variables, JVM system properties, or the service idiom.Camel 2.14.1 Using custom functions, which can be plugged into the property component.SyntaxThe syntax to use Camel's property placeholder is to use {{key}} for example {{file.uri}} where file.uri is the property key. You can use property placeholders in parts of the endpoint URI's which for example you can use placeholders for parameters in the URIs.FromCamel 2.14.1 onwards you can specify a default value to use if a property with the key does not exists, egfile.url:/some/path where the default value is the text after the colon (eg /some/path).Do not use colon in the property key. The colon is used as a separator token when you are providing a default value, which is supported from Camel 2.14.1 onwards.PropertyResolverCamel provides a pluggable mechanism which allows 3rd part to provide their own resolver to lookup properties. Camel provides a default implementation org.apache.camel.component.properties.DefaultPropertiesResolver which is capable
svn commit: r996964 [2/4] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache properties.html using-propertyplaceholder.html
Modified: websites/production/camel/content/book-in-one-page.html == --- websites/production/camel/content/book-in-one-page.html (original) +++ websites/production/camel/content/book-in-one-page.html Thu Sep 8 16:19:03 2016 @@ -3625,11 +3625,11 @@ The tutorial has been designed in two pa While not actual tutorials you might find working through the source of the various Examples useful. Tutorial on Spring Remoting with JMSThanksThis tutorial was kindly donated to Apache Camel by Martin Gilday.PrefaceThis tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a http://www.springramework.org; rel="nofollow">Spring service. The route works in a synchronous fashion returning a response to the client./**/ +/*]]>*/ Tutorial on Spring Remoting with JMSPrefacePrerequisitesDistributionAboutCreate the Camel Project Update the POM with Dependencies Writing the Server @@ -5744,11 +5744,11 @@ So we completed the last piece in the pi This example has been removed from Camel 2.9 onwards. Apache Axis 1.4 is a very old and unsupported framework. We encourage users to use CXF instead of Axis. /**/ +/*]]>*/ Tutorial using Axis 1.4 with Apache Camel PrerequisitesDistributionIntroductionSetting up the project to run Axis Maven 2wsdlConfiguring AxisRunning the Example @@ -17175,11 +17175,11 @@ template.send(direct:alias-verify& ]]> See Also Configuring CamelComponentEndpointGetting StartedCrypto Crypto is also available as a Data Format CXF ComponentWhen using CXF as a consumer, the CXF Bean Component allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to consume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.When using CXF in streaming modes (see DataFormat option), then also read about Stream caching.The cxf: component provides integration with http://cxf.apache.org;>Apache CXF for connecting to JAX-WS services hosted in CXF./**/ +/*]]>*/ CXF Component URI formatOptions The descriptions of the dataformats @@ -24034,62 +24034,66 @@ lpr://remotehost:port/path/to/printer[?o Properties ComponentAvailable as of Camel 2.3URI format -Where key is the key for the property to be looked up.OptionsNameTypeDefaultDescriptioncachebooleantrueWhether or not to cache loaded properties.encodingStringnullCamel 2.14.3/2.15.1: To use a specific charset to load the properties, such as UTF-8. By defaultISO-8859-1 (latin1) is used.fallbackToUnaugmentedPropertybooleantrueCamel 2.9 If true, first attempt resolution of property name augmented with propertyPrefix and propertySuffix before falling back the plain property name specified.If false, o nly the augmented property name is searched.ignoreMissingLocationbooleanfalseCamel 2.10: Whether to silently ignore if a location cannot be located, such as a properties file not found.locationsStringnullA list of locations to load properties. You can use comma to separate multiple locations. This option will override any default locations and only use the locations from this option.prefixTokenString{{Camel 2.9 The token to indicate the beginning of a property token.propertyPrefixStringnullCamel 2.9 Optional prefix prepended to property names before resolution.propertySuffixStringnullCamel 2.9 Optional suffix appended to property names before resolution.suffixTokenString}}Camel 2.9 The token to indicate the end of a property token.systemPropertiesModeint2Camel 2.16 The mode to use for whether to reso lve and use system properties:0= never - JVM system
svn commit: r996964 [1/4] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache properties.html using-propertyplaceholder.html
Author: buildbot Date: Thu Sep 8 16:19:03 2016 New Revision: 996964 Log: Production update by buildbot for camel Modified: websites/production/camel/content/book-component-appendix.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/properties.html websites/production/camel/content/using-propertyplaceholder.html Modified: websites/production/camel/content/book-component-appendix.html == --- websites/production/camel/content/book-component-appendix.html (original) +++ websites/production/camel/content/book-component-appendix.html Thu Sep 8 16:19:03 2016 @@ -1042,11 +1042,11 @@ template.send(direct:alias-verify& ]]> See Also Configuring CamelComponentEndpointGetting StartedCrypto Crypto is also available as a Data Format CXF ComponentWhen using CXF as a consumer, the CXF Bean Component allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to cons ume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.When using CXF in streaming modes (see DataFormat option), then also read about Stream caching.The cxf: component provides integration with http://cxf.apache.org;>Apache CXF for connecting to JAX-WS services hosted in CXF./**/ +/*]]>*/ CXF Component URI formatOptions The descriptions of the dataformats @@ -7901,62 +7901,66 @@ lpr://remotehost:port/path/to/printer[?o Properties ComponentAvailable as of Camel 2.3URI format -Where key is the key for the property to be looked up.OptionsNameTypeDefaultDescriptioncachebooleantrueWhether or not to cache loaded properties.encodingStringnullCamel 2.14.3/2.15.1: To use a specific charset to load the properties, such as UTF-8. By defaultISO-8859-1 (latin1) is used.fallbackToUnaugmentedPropertybooleantrueCamel 2.9 If true, first attempt resolution of property name augmented with propertyPrefix and propertySuffix before falling back the plain property name specified.If false, only the augmented property name is searched.ignoreMissingLocationbooleanfalseCamel 2.10: Whether to silently ignore if a location cannot be located, such as a properties file not found.locationsStringnullA list of locations to load properties. You can use comma to separate multiple locations. This option will override any default locations and only use the locations fr om this option.prefixTokenString{{Camel 2.9 The token to indicate the beginning of a property token.propertyPrefixStringnullCamel 2.9 Optional prefix prepended to property names before resolution.propertySuffixStringnullCamel 2.9 Optional suffix appended to property names before resolution.suffixTokenString}}Camel 2.9 The token to indicate the end of a property token.systemPropertiesModeint2Camel 2.16 The mode to use for whether to resolve and use system properties:0= never - JVM system properties are never used.1= fallback - JVM system properties are only used as fallback if no regular property with the key exists.2= override - JVM system properties are used if exists, otherwise the regular property will be used.Note: when bridging this to Spring's property placeholder with org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer then the configuration on BridgePropertyPlaceholderConfigurer takes precedence over the configuration on the PropertiesComponent.Resolving property from Java codeYou can use the method resolvePropertyPlaceholders on the CamelContext to resolve a property from any Java code.Using PropertyPlaceholderAvailable as of Camel 2.3Camel now provides a new PropertiesComponent in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs. This works much like you would do if using Spring's property-placeholder tag. However Spring have a limitation which prevents 3rd party frameworks to leverage Spring property placeholders to the fullest. See more at How do I use Spring Property Placeholder with Camel XML.Bridging Spring and Camel property placeholdersFrom Camel 2.10 onwards, you can bridge the Spring property placeholder with Camel, see further below for more details.The property placeholder is generally in use when doing:lookup or creating endpointslookup of beans in the Registryadditional supported in Spring XML
svn commit: r996964 [4/4] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache properties.html using-propertyplaceholder.html
Modified: websites/production/camel/content/using-propertyplaceholder.html == --- websites/production/camel/content/using-propertyplaceholder.html (original) +++ websites/production/camel/content/using-propertyplaceholder.html Thu Sep 8 16:19:03 2016 @@ -86,62 +86,66 @@ -Using PropertyPlaceholderAvailable as of Camel 2.3Camel now provides a new PropertiesComponent in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs. This works much like you would do if using Spring's property-placeholder tag. However Spring have a limitation which prevents 3rd party frameworks to leverage Spring property placeholders to the fullest. See more at How do I use Spring Property Placeholder with Camel XML.Bridging Spring and Camel property placeholdersFrom Camel 2.10 onwards, you can bridge the Spring property placeholder with Camel, see further below for more details.The property placeholder is generally in use when doing:lookup or creating endpointslookup of beans in the Registryadditional supported in Spring XML (see below in examples)using Blueprint PropertyPlaceholder with Camel Properties componentusing @PropertyInject to inject a property in a POJOCamel 2.14.1 Using default value if a property does not existsCamel 2.14.1 Include out of the box functions, to lookup property values from OS environment variables, JVM system properties, or the service idiom.Camel 2.14.1 Using custom f unctions, which can be plugged into the property component.SyntaxThe syntax to use Camel's property placeholder is to use {{key}} for example {{file.uri}} where file.uri is the property key. You can use property placeholders in parts of the endpoint URI's which for example you can use placeholders for parameters in the URIs.FromCamel 2.14.1 onwards you can specify a default value to use if a property with the key does not exists, egfile.url:/some/path where the default value is the text after the colon (eg /some/path).Do not use colon in the property key. The colon is used as a separator toke n when you are providing a default value, which is supported from Camel 2.14.1 onwards.PropertyResolverCamel provides a pluggable mechanism which allows 3rd part to provide their own resolver to lookup properties. Camel provides a default implementation org.apache.camel.component.properties.DefaultPropertiesResolver which is capable of loading properties from the file system, classpath or Registry. You can prefix the locations with either:ref: Camel 2.4: to lookup in the Registryfile: to load the from file systemclasspath: to load from classpath (this is also the default if no prefix is provided)blueprint: Camel 2.7: to use a specific OSGi blueprint placehold er serviceDefining locationThe PropertiesResolver need to know a location(s) where to resolve the properties. You can define 1 to many locations. If you define the location in a single String property you can separate multiple locations with comma such as: +UsingPropertyPlaceholderAvailable as of Camel 2.3Camel now provides a new PropertiesComponent in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs. This works much like you would do if using Spring's property-placeholder tag. However Spring have a limitation which prevents 3rd party frameworks to leverage Spring property placeholders to the fullest.For more details see: How do I use Spring Property Placeholder with Camel XML.Bridging Spring and Camel property placeholdersFrom Camel 2.10: Spring's property placeholder can be bridged with Camel's. See below for more details.The property placeholder is generally in use when doing:lookup or creating endpoints.lookup of beans in the Registry.additional supported in Spring XML (see below in examples).using BlueprintPropertyPlaceholder with Camel Properties component.using @PropertyInject to inject a property in a POJO.Camel 2.14.1 Using default value if a property does not exists.Camel 2.14.1 Include out of the box functions, to lookup property values from OS environment variables, JVM system properties, or the service idiom.Camel 2.14.1 Using custom functions, which can be plugged into the property component.SyntaxThe syntax to use Camel's property placeholder is to use {{key}} for example {{file.uri}} where file.uri is the property key. You can use property placeholders in parts of the endpoint URI's which for example you can use placeholders for parameters in the URIs.FromCamel 2.14.1: you can specify a default value to use if a property with the key does not exists, e.g., file.url:/some/path where the default value is the text after the colon, e.g., /some/path.From Camel 2.14.1: do not use a colon in the property key. The colon character is used as a token separator when providing a default valueUsingPropertyResolverCamel provides a
[3/4] camel git commit: CAMEL-9018: camel-archetype-java8
CAMEL-9018: camel-archetype-java8 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/45f3147e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/45f3147e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/45f3147e Branch: refs/heads/master Commit: 45f3147ee64507ac8fd5cf6bd79c1370612742c3 Parents: e65d5cc Author: lburgazzoliAuthored: Thu Sep 8 15:53:44 2016 +0200 Committer: lburgazzoli Committed: Thu Sep 8 17:07:27 2016 +0200 -- .../archetypes/camel-archetype-java8/pom.xml| 61 ++ .../META-INF/maven/archetype-metadata.xml | 71 +++ .../src/main/resources/META-INF/LICENSE.txt | 203 +++ .../src/main/resources/META-INF/NOTICE.txt | 11 + .../resources/archetype-resources/ReadMe.txt| 15 ++ .../main/resources/archetype-resources/pom.xml | 115 +++ .../src/main/java/MainApp.java | 35 .../src/main/java/MyRouteBuilder.java | 63 ++ .../src/main/resources/log4j2.properties| 23 +++ tooling/archetypes/pom.xml | 1 + 10 files changed, 598 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/45f3147e/tooling/archetypes/camel-archetype-java8/pom.xml -- diff --git a/tooling/archetypes/camel-archetype-java8/pom.xml b/tooling/archetypes/camel-archetype-java8/pom.xml new file mode 100644 index 000..166c08e --- /dev/null +++ b/tooling/archetypes/camel-archetype-java8/pom.xml @@ -0,0 +1,61 @@ + + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd;> + + 4.0.0 + + +org.apache.camel +archetypes +2.18.0-SNAPSHOT + + + org.apache.camel.archetypes + camel-archetype-java8 + Camel :: Archetypes :: Java8 Router + Creates a new Camel project using Java8 DSL. + maven-archetype + + + + +org.apache.maven.archetype +archetype-packaging +${maven-archetype-packaging-version} + + + + + + +src/main/resources +false + + +src/main/resources-filtered +true + + **/archetype-metadata.xml + + + + + + http://git-wip-us.apache.org/repos/asf/camel/blob/45f3147e/tooling/archetypes/camel-archetype-java8/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml -- diff --git a/tooling/archetypes/camel-archetype-java8/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml b/tooling/archetypes/camel-archetype-java8/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml new file mode 100644 index 000..eeab5db --- /dev/null +++ b/tooling/archetypes/camel-archetype-java8/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,71 @@ + + +http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd; name="camel-archetype-java" + xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0; +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;> + + + ${project.version} + + + ${exec-maven-plugin-version} + + + ${maven-compiler-plugin-version} + + + ${maven-resources-plugin-version} + + + + + src/main/java + +**/*.java + + + + src/main/resources + +**/*.xml +**/*.properties + + + + src/test/java + +**/*.java + + + + src/test/resources + +**/*.xml +**/*.properties + + + + + +ReadMe.txt + + + + http://git-wip-us.apache.org/repos/asf/camel/blob/45f3147e/tooling/archetypes/camel-archetype-java8/src/main/resources/META-INF/LICENSE.txt -- diff --git a/tooling/archetypes/camel-archetype-java8/src/main/resources/META-INF/LICENSE.txt b/tooling/archetypes/camel-archetype-java8/src/main/resources/META-INF/LICENSE.txt new file mode 100755 index 000..6b0b127 --- /dev/null +++ b/tooling/archetypes/camel-archetype-java8/src/main/resources/META-INF/LICENSE.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall
[1/4] camel git commit: CAMEL-10140: Java 8 type safe process DSL
Repository: camel Updated Branches: refs/heads/master 69744b335 -> 624b8a735 CAMEL-10140: Java 8 type safe process DSL Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e65d5cc3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e65d5cc3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e65d5cc3 Branch: refs/heads/master Commit: e65d5cc3192bedbb97bc007d34cbb5e631b3197e Parents: f7e603a Author: lburgazzoliAuthored: Thu Sep 8 13:16:52 2016 +0200 Committer: lburgazzoli Committed: Thu Sep 8 15:55:11 2016 +0200 -- .../org/apache/camel/builder/ProcessClause.java | 120 +++ .../apache/camel/model/ProcessorDefinition.java | 16 +++ examples/camel-example-dsl-java8/pom.xml| 10 +- .../camel/example/dsl/java8/MyApplication.java | 71 +-- .../apache/camel/example/dsl/java8/MyRoute.java | 63 -- 5 files changed, 195 insertions(+), 85 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e65d5cc3/camel-core/src/main/java/org/apache/camel/builder/ProcessClause.java -- diff --git a/camel-core/src/main/java/org/apache/camel/builder/ProcessClause.java b/camel-core/src/main/java/org/apache/camel/builder/ProcessClause.java new file mode 100644 index 000..5235878 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/builder/ProcessClause.java @@ -0,0 +1,120 @@ +/** + * 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.builder; + +import java.util.Map; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.Processor; + +public class ProcessClause implements Processor { +private final T parent; +private Processor processor; + +public ProcessClause(T parent) { +this.parent = parent; +} + +@Override +public void process(Exchange exchange) throws Exception { +if (processor != null) { +processor.process(exchange); +} +} + +// *** +// Exchange +// *** + +/** + * TODO: document + * + * Note: this is experimental and subject to changes in future releases. + */ +public T exchange(final Consumer consumer) { +processor = consumer::accept; +return parent; +} + + +// *** +// Message +// *** + +/** + * TODO: document + * + * Note: this is experimental and subject to changes in future releases. + */ +public T message(final Consumer consumer) { +processor = e -> consumer.accept(e.getIn()); +return parent; +} + +// *** +// Body +// *** + +/** + * TODO: document + * + * Note: this is experimental and subject to changes in future releases. + */ +public T body(final Consumer consumer) { +processor = e -> consumer.accept(e.getIn().getBody()); +return parent; +} + +/** + * TODO: document + * + * Note: this is experimental and subject to changes in future releases. + */ +public T body(Class type, final Consumer consumer) { +processor = e -> consumer.accept(e.getIn().getBody(type)); +return parent; +} + +/** + * TODO: document + * + * Note: this is experimental and subject to changes in future releases. + */ +public T body(final BiConsumer
[4/4] camel git commit: CAMEL-7831: create a java8 only demo showing how to use lambda expressions for Predicate / Expression inside the Java DSL (using Message as a typesafe parameter)
CAMEL-7831: create a java8 only demo showing how to use lambda expressions for Predicate / Expression inside the Java DSL (using Message as a typesafe parameter) Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/624b8a73 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/624b8a73 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/624b8a73 Branch: refs/heads/master Commit: 624b8a7358eaf5597e47ffe30209d2d22ab50911 Parents: 45f3147 Author: lburgazzoliAuthored: Thu Sep 8 17:10:16 2016 +0200 Committer: lburgazzoli Committed: Thu Sep 8 17:10:16 2016 +0200 -- examples/camel-example-dsl-java8/pom.xml| 79 --- .../camel/example/dsl/java8/MyApplication.java | 80 .../src/main/resources/log4j2.properties| 23 -- examples/camel-example-java8/pom.xml| 79 +++ .../camel/example/java8/MyApplication.java | 80 .../src/main/resources/log4j2.properties| 23 ++ examples/pom.xml| 2 +- 7 files changed, 183 insertions(+), 183 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/624b8a73/examples/camel-example-dsl-java8/pom.xml -- diff --git a/examples/camel-example-dsl-java8/pom.xml b/examples/camel-example-dsl-java8/pom.xml deleted file mode 100644 index 436169f..000 --- a/examples/camel-example-dsl-java8/pom.xml +++ /dev/null @@ -1,79 +0,0 @@ - - -http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd;> - - 4.0.0 - - -org.apache.camel -examples -2.18.0-SNAPSHOT - - - camel-example-dsl-java8 - jar - Camel :: Example :: DSL :: Java8 :: Spring JavaConfig - An example for showing Camel Spring JavaConfig DSL for Java 8 - - - - - org.apache.camel - camel-core - - - - - org.apache.logging.log4j - log4j-api - runtime - - - org.apache.logging.log4j - log4j-core - runtime - - - org.apache.logging.log4j - log4j-slf4j-impl - runtime - - - org.apache.logging.log4j - log4j-jul - runtime - - - - - - - - -org.apache.camel -camel-maven-plugin -${project.version} - - org.apache.camel.example.dsl.java8.MyApplication - - - - - - http://git-wip-us.apache.org/repos/asf/camel/blob/624b8a73/examples/camel-example-dsl-java8/src/main/java/org/apache/camel/example/dsl/java8/MyApplication.java -- diff --git a/examples/camel-example-dsl-java8/src/main/java/org/apache/camel/example/dsl/java8/MyApplication.java b/examples/camel-example-dsl-java8/src/main/java/org/apache/camel/example/dsl/java8/MyApplication.java deleted file mode 100644 index abaf561..000 --- a/examples/camel-example-dsl-java8/src/main/java/org/apache/camel/example/dsl/java8/MyApplication.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * 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.example.dsl.java8; - -import java.util.Date; -import java.util.Objects; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.main.Main; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public final class MyApplication { -private static final Logger LOGGER = LoggerFactory.getLogger(MyApplication.class); - -private MyApplication() { -} - -public static void main(String[] args) throws Exception { -Main main = new Main(); -main.addRouteBuilder(new MyRouteBuilder()); -main.run(args); -} - -private static class MyRouteBuilder extends RouteBuilder { -
[2/4] camel git commit: CAMEL-7831: create a java8 only demo showing how to use lambda expressions for Predicate / Expression inside the Java DSL (using Message as a typesafe parameter)
CAMEL-7831: create a java8 only demo showing how to use lambda expressions for Predicate / Expression inside the Java DSL (using Message as a typesafe parameter) Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f7e603ac Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f7e603ac Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f7e603ac Branch: refs/heads/master Commit: f7e603ac38880a9cb399177474d7d0a6d940765e Parents: 69744b3 Author: lburgazzoliAuthored: Mon Sep 5 18:02:43 2016 +0200 Committer: lburgazzoli Committed: Thu Sep 8 15:55:11 2016 +0200 -- .../apache/camel/builder/ExpressionBuilder.java | 141 ++- .../apache/camel/builder/ExpressionClause.java | 174 ++- .../camel/builder/ExpressionBuilderTest.java| 11 ++ .../camel/builder/ExpressionFunctionTest.java | 67 +++ examples/camel-example-dsl-java8/pom.xml| 87 ++ .../camel/example/dsl/java8/MyApplication.java | 35 .../apache/camel/example/dsl/java8/MyRoute.java | 63 +++ .../src/main/resources/log4j2.properties| 23 +++ examples/pom.xml| 1 + 9 files changed, 600 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/f7e603ac/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java -- diff --git a/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java b/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java index d80306a..a138271 100644 --- a/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java +++ b/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java @@ -25,10 +25,13 @@ import java.util.Comparator; import java.util.Date; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Random; import java.util.Scanner; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.BiFunction; +import java.util.function.Function; import java.util.regex.Pattern; import org.apache.camel.CamelContext; @@ -80,7 +83,7 @@ public final class ExpressionBuilder { private ExpressionBuilder() { } - /** +/** * Returns an expression for the inbound message attachments * * @return an expression object which will return the inbound message attachments @@ -893,6 +896,80 @@ public final class ExpressionBuilder { } /** + * Returns a functional expression for the exchanges inbound message body + */ +public static Expression bodyExpression(final Function
svn commit: r996961 - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache properties.html
Author: buildbot Date: Thu Sep 8 15:20:50 2016 New Revision: 996961 Log: Production update by buildbot for camel Modified: websites/production/camel/content/book-component-appendix.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/properties.html Modified: websites/production/camel/content/book-component-appendix.html == --- websites/production/camel/content/book-component-appendix.html (original) +++ websites/production/camel/content/book-component-appendix.html Thu Sep 8 15:20:50 2016 @@ -1042,11 +1042,11 @@ template.send(direct:alias-verify& ]]> See Also Configuring CamelComponentEndpointGetting StartedCrypto Crypto is also available as a Data Format CXF ComponentWhen using CXF as a consumer, the CXF Bean Component allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to cons ume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.When using CXF in streaming modes (see DataFormat option), then also read about Stream caching.The cxf: component provides integration with http://cxf.apache.org;>Apache CXF for connecting to JAX-WS services hosted in CXF./**/ +/*]]>*/ CXF Component URI formatOptions The descriptions of the dataformats @@ -7901,7 +7901,7 @@ lpr://remotehost:port/path/to/printer[?o Properties ComponentAvailable as of Camel 2.3URI format -Where key is the key for the property to lookupOptionsNameTypeDefaultDescriptioncachebooleantrueWhether or not to cache loaded properties.locationsStringclass="confluenceTd">nullclass="confluenceTd">A list of locations to load properties. You can use >comma to separate multiple locations. This option will override any default >locations and only use the locations from this >option.class="confluenceTd">encodingclass="confluenceTd">Stringclass="confluenceTd">nullclass="confluenceTd">Camel 2.14.3/2.15.1: To use a specific >charset to load the properties, such as UTF-8. By default ISO-8859-1 (latin1) >is used.class="confluenceTd">ignoreMissingLocationcolspan="1" rowspan="1" >class="confluenceTd">booleanfalseCamel 2.10: Whether to silently ignore if a location cannot be located, such as a properties file not found.propertyPrefixStringnullCamel 2.9 Optional prefix prepended to property names before resolution.propertySuffixStringnullCamel 2.9 Optional su ffix appended to property names before resolution.fallbackToUnaugmentedPropertybooleantrueCamel 2.9 If true, first attempt resolution of property name augmented with propertyPrefix and propertySuffix before falling back the plain property name specified. If false, only the augmented property name is searched.prefixTokenString{{Camel 2.9 The token to indicate the b eginning of a property token.suffixTokenString}}Camel 2.9 The token to indicate the end of a property token.systemPropertiesModeint2Camel 2.16: The mode to use for whether to resolve and use system properties0 = never (JVM system properties is never used)1 = fallback (JVM system properties is only used as fallback if no regular property with the key exists)2 = override& #160; (JVM system properties is used if exists, otherwise a the regular property will be used)Notice when bridging this to Spring's property placeholder with org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer then the configuration on BridgePropertyPlaceholderConfigurer takes precedence over the configuration on the PropertiesComponent.Resolving property from Java codeYou can use the method resolvePropertyPlaceholders on the CamelContext to resolve a property from any Java code.Using PropertyPlaceholderAvailable as of Camel 2.3Camel now provides a new PropertiesComponent in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs. This works much like you would do if using Spring's property-placeholder tag. However Spring have a limitation which prevents 3rd party frameworks to leverage Spring property placeholders to the fullest. See more at How do I use Spring Property Placeholder with Camel XML.Bridging Spring and Camel property placeholdersFrom Camel 2.10 onwards, you can bridge the Spring property plac eholder with Camel, see further below for more details.The property
camel git commit: Upgrade Shiro to version 1.3.1
Repository: camel Updated Branches: refs/heads/master de8da42a0 -> 69744b335 Upgrade Shiro to version 1.3.1 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/69744b33 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/69744b33 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/69744b33 Branch: refs/heads/master Commit: 69744b3354894d3fe889216afe26a13872a63420 Parents: de8da42 Author: Andrea CosentinoAuthored: Thu Sep 8 10:31:14 2016 +0200 Committer: Andrea Cosentino Committed: Thu Sep 8 10:31:14 2016 +0200 -- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/69744b33/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index bbe4050..f488b98 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -515,7 +515,7 @@ 2.7.0 1.0 [3,4) -1.3.0 +1.3.1 2.0.0-alpha-8 2.2.2 1.2.3
camel git commit: Upgrade Mvel to version 2.3.1.Final
Repository: camel Updated Branches: refs/heads/master fbca40a6d -> de8da42a0 Upgrade Mvel to version 2.3.1.Final Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/de8da42a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/de8da42a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/de8da42a Branch: refs/heads/master Commit: de8da42a07b94b7181fcbc067947bd77d416b264 Parents: fbca40a Author: Andrea CosentinoAuthored: Thu Sep 8 10:00:00 2016 +0200 Committer: Andrea Cosentino Committed: Thu Sep 8 10:00:00 2016 +0200 -- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/de8da42a/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index ab86c1b..bbe4050 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -434,7 +434,7 @@ 0.9.2 16.0 0.9.2_1 -2.2.8.Final +2.3.1.Final 3.4.1 5.3.4.Final 3.0.1
[2/2] camel git commit: CAMEL-10296: fix checkstyle issues and make varible basicReturnReceived volatile
CAMEL-10296: fix checkstyle issues and make varible basicReturnReceived volatile Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fbca40a6 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fbca40a6 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fbca40a6 Branch: refs/heads/master Commit: fbca40a6d048870031509066b90105548936a0c9 Parents: 0ce6444 Author: Florian GessnerAuthored: Thu Sep 8 09:02:32 2016 +0200 Committer: Andrea Cosentino Committed: Thu Sep 8 09:36:32 2016 +0200 -- .../rabbitmq/RabbitMQMessagePublisher.java | 30 +--- 1 file changed, 14 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/fbca40a6/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessagePublisher.java -- diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessagePublisher.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessagePublisher.java index 248df21..bde0430 100644 --- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessagePublisher.java +++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessagePublisher.java @@ -26,6 +26,7 @@ import java.util.concurrent.TimeoutException; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; import com.rabbitmq.client.ReturnListener; + import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.NoTypeConversionAvailableException; @@ -38,22 +39,20 @@ import org.slf4j.LoggerFactory; * A method object for publishing to RabbitMQ */ public class RabbitMQMessagePublisher { -private final ReturnListener GUARANTEED_DELIVERY_RETURN_LISTENER = new ReturnListener() { -@Override -public void handleReturn(int replyCode, String replyText, String exchange, String routingKey, AMQP.BasicProperties properties, byte[] body) throws IOException { -LOG.warn("Delivery failed for exchange {} and routing key {}; replyCode = {}; replyText = {}", exchange, routingKey, replyCode, replyText); -basicReturnReceived = true; -} -}; - private static final Logger LOG = LoggerFactory.getLogger(RabbitMQMessagePublisher.class); private final Exchange camelExchange; private final Channel channel; private final String routingKey; private final RabbitMQEndpoint endpoint; private final Message message; - -private boolean basicReturnReceived = false; +private volatile boolean basicReturnReceived; +private final ReturnListener guaranteedDeliveryReturnListener = new ReturnListener() { +@Override +public void handleReturn(int replyCode, String replyText, String exchange, String routingKey, AMQP.BasicProperties properties, byte[] body) throws IOException { +LOG.warn("Delivery failed for exchange {} and routing key {}; replyCode = {}; replyText = {}", exchange, routingKey, replyCode, replyText); +basicReturnReceived = true; +} +}; public RabbitMQMessagePublisher(final Exchange camelExchange, final Channel channel, final String routingKey, final RabbitMQEndpoint endpoint) { this.camelExchange = camelExchange; @@ -113,9 +112,8 @@ public class RabbitMQMessagePublisher { channel.confirmSelect(); } if (endpoint.isGuaranteedDeliveries()) { - basicReturnReceived = false; -channel.addReturnListener(GUARANTEED_DELIVERY_RETURN_LISTENER); - +basicReturnReceived = false; +channel.addReturnListener(guaranteedDeliveryReturnListener); } try { @@ -125,7 +123,7 @@ public class RabbitMQMessagePublisher { } } finally { if (endpoint.isGuaranteedDeliveries()) { - channel.removeReturnListener(GUARANTEED_DELIVERY_RETURN_LISTENER); +channel.removeReturnListener(guaranteedDeliveryReturnListener); } } } @@ -138,8 +136,8 @@ public class RabbitMQMessagePublisher { try { LOG.debug("Waiting for publisher acknowledgements for {}ms", endpoint.getPublisherAcknowledgementsTimeout()); channel.waitForConfirmsOrDie(endpoint.getPublisherAcknowledgementsTimeout()); -if(basicReturnReceived){ - throw new RuntimeCamelException("Failed to deliver message; basic.return received"); +if (basicReturnReceived) { +throw new RuntimeCamelException("Failed to deliver message;
[1/2] camel git commit: CAMEL-10296: waitForConfirmsOrDie does not return if no timeout is set for publisher acks and guaranteed delivery
Repository: camel Updated Branches: refs/heads/master a59700876 -> fbca40a6d CAMEL-10296: waitForConfirmsOrDie does not return if no timeout is set for publisher acks and guaranteed delivery Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0ce6 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0ce6 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0ce6 Branch: refs/heads/master Commit: 0ce6371a6ded33c2aeb50a2f563fed9ec855 Parents: a597008 Author: Florian GessnerAuthored: Wed Sep 7 21:04:10 2016 +0200 Committer: Andrea Cosentino Committed: Thu Sep 8 09:36:18 2016 +0200 -- .../component/rabbitmq/RabbitMQMessagePublisher.java | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/0ce6/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessagePublisher.java -- diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessagePublisher.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessagePublisher.java index 15f69ff..248df21 100644 --- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessagePublisher.java +++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessagePublisher.java @@ -38,10 +38,11 @@ import org.slf4j.LoggerFactory; * A method object for publishing to RabbitMQ */ public class RabbitMQMessagePublisher { -private static final ReturnListener GUARANTEED_DELIVERY_RETURN_LISTENER = new ReturnListener() { +private final ReturnListener GUARANTEED_DELIVERY_RETURN_LISTENER = new ReturnListener() { @Override public void handleReturn(int replyCode, String replyText, String exchange, String routingKey, AMQP.BasicProperties properties, byte[] body) throws IOException { -throw new RuntimeCamelException("Delivery failed for exchange " + exchange + " and routing key " + routingKey + "; replyCode = " + replyCode + " replyText = " + replyText); +LOG.warn("Delivery failed for exchange {} and routing key {}; replyCode = {}; replyText = {}", exchange, routingKey, replyCode, replyText); +basicReturnReceived = true; } }; @@ -51,6 +52,8 @@ public class RabbitMQMessagePublisher { private final String routingKey; private final RabbitMQEndpoint endpoint; private final Message message; + +private boolean basicReturnReceived = false; public RabbitMQMessagePublisher(final Exchange camelExchange, final Channel channel, final String routingKey, final RabbitMQEndpoint endpoint) { this.camelExchange = camelExchange; @@ -110,6 +113,7 @@ public class RabbitMQMessagePublisher { channel.confirmSelect(); } if (endpoint.isGuaranteedDeliveries()) { + basicReturnReceived = false; channel.addReturnListener(GUARANTEED_DELIVERY_RETURN_LISTENER); } @@ -134,6 +138,9 @@ public class RabbitMQMessagePublisher { try { LOG.debug("Waiting for publisher acknowledgements for {}ms", endpoint.getPublisherAcknowledgementsTimeout()); channel.waitForConfirmsOrDie(endpoint.getPublisherAcknowledgementsTimeout()); +if(basicReturnReceived){ + throw new RuntimeCamelException("Failed to deliver message; basic.return received"); +} } catch (InterruptedException | TimeoutException e) { LOG.warn("Acknowledgement error for {}", camelExchange); throw new RuntimeCamelException(e);
[camel] Git Push Summary
Repository: camel Updated Branches: refs/heads/ftpfix [deleted] 7d312e25c
[2/5] camel git commit: CAMEL-10297 Added a unit Test and use byteArray instead of InputStream
CAMEL-10297 Added a unit Test and use byteArray instead of InputStream Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c4bfbe4b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c4bfbe4b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c4bfbe4b Branch: refs/heads/master Commit: c4bfbe4b13acc16981546eff4a391fa23e44a530 Parents: e04d343 Author: Andrea CosentinoAuthored: Wed Sep 7 13:11:00 2016 +0200 Committer: Andrea Cosentino Committed: Thu Sep 8 08:17:36 2016 +0200 -- .../component/file/remote/FtpOperations.java| 4 +- .../src/test/data/ftptextfile/textexample.txt | 3 + .../file/remote/FtpConsumerFileSplitTest.java | 72 3 files changed, 76 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/c4bfbe4b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java -- diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java index db58a9c..f2447ff 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java @@ -370,9 +370,7 @@ public class FtpOperations implements RemoteFileOperations { // close the stream after done IOHelper.close(bos); -// and then set the body as an input stream so we can read the content easily -InputStream is = new ByteArrayInputStream(bos.toByteArray()); -target.setBody(is); +target.setBody(bos.toByteArray()); } // store client reply information after the operation http://git-wip-us.apache.org/repos/asf/camel/blob/c4bfbe4b/components/camel-ftp/src/test/data/ftptextfile/textexample.txt -- diff --git a/components/camel-ftp/src/test/data/ftptextfile/textexample.txt b/components/camel-ftp/src/test/data/ftptextfile/textexample.txt new file mode 100644 index 000..83db48f --- /dev/null +++ b/components/camel-ftp/src/test/data/ftptextfile/textexample.txt @@ -0,0 +1,3 @@ +line1 +line2 +line3 http://git-wip-us.apache.org/repos/asf/camel/blob/c4bfbe4b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java -- diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java new file mode 100644 index 000..3f2bf76 --- /dev/null +++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java @@ -0,0 +1,72 @@ +/** + * 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.component.file.remote; + +import java.io.File; + +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.junit.Before; +import org.junit.Test; + +/** + * @version + */ +public class FtpConsumerFileSplitTest extends FtpServerTestSupport { + +private String getFtpUrl() { +return "ftp://admin@localhost:; + getPort() + "/incoming/?password=admin" ++ "=false"; +} + +@Override +@Before +public void setUp() throws Exception { +super.setUp(); +prepareFtpServer(); +} + +@Test +public void testFtpRoute() throws Exception { +MockEndpoint resultEndpoint = getMockEndpoint("mock:result"); +resultEndpoint.expectedMessageCount(3); +
[5/5] camel git commit: Fixed CS
Fixed CS Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a5970087 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a5970087 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a5970087 Branch: refs/heads/master Commit: a59700876b9316b384ad54ad4a0e5bb11fbc7ca6 Parents: b429e48 Author: Andrea CosentinoAuthored: Thu Sep 8 08:37:56 2016 +0200 Committer: Andrea Cosentino Committed: Thu Sep 8 08:37:56 2016 +0200 -- .../camel/component/file/remote/FtpConsumerFileSplitTest.java| 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/a5970087/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java -- diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java index 6cba739..1692156 100644 --- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java +++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java @@ -36,7 +36,7 @@ public class FtpConsumerFileSplitTest extends FtpServerTestSupport { @Test public void testFtpRoute() throws Exception { MockEndpoint resultEndpoint = getMockEndpoint("mock:result"); -resultEndpoint.expectedBodiesReceived("line1","line2","line3"); +resultEndpoint.expectedBodiesReceived("line1", "line2", "line3"); template.sendBodyAndHeader(getFtpUrl(), new File("src/test/data/ftptextfile/textexample.txt"), Exchange.FILE_NAME, "textexample.txt"); @@ -54,4 +54,4 @@ public class FtpConsumerFileSplitTest extends FtpServerTestSupport { } }; } -} \ No newline at end of file +}
[4/5] camel git commit: CAMEL-10297 camel-ftp - updated known_hosts file used for testing to make the test pass
CAMEL-10297 camel-ftp - updated known_hosts file used for testing to make the test pass Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b429e483 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b429e483 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b429e483 Branch: refs/heads/master Commit: b429e4833467a714c54ddec5068e0c5430570440 Parents: 5484967 Author: Claus IbsenAuthored: Wed Sep 7 15:24:56 2016 +0200 Committer: Andrea Cosentino Committed: Thu Sep 8 08:17:47 2016 +0200 -- components/camel-ftp/src/test/resources/known_hosts | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b429e483/components/camel-ftp/src/test/resources/known_hosts -- diff --git a/components/camel-ftp/src/test/resources/known_hosts b/components/camel-ftp/src/test/resources/known_hosts index b2026cb..bf617c5 100644 --- a/components/camel-ftp/src/test/resources/known_hosts +++ b/components/camel-ftp/src/test/resources/known_hosts @@ -1 +1,2 @@ [localhost]:21000 ssh-rsa B3NzaC1yc2EDAQABgQDdfIWeSV4o68dRrKSzFd/Bk51E65UTmmSrmW0O1ohtzi6HzsDPjXgCtlTt3FqTcfFfI92IlTr4JWqC9UK1QT1ZTeng0MkPQmv68hDANHbt5CpETZHjW5q4OOgWhVvj5IyOC2NZHtKlJBkdsMAa15ouOOJLzBvAvbqOR/yUROsEiQ== +[localhost]:21001 ssh-rsa B3NzaC1yc2EDAQABgQDdfIWeSV4o68dRrKSzFd/Bk51E65UTmmSrmW0O1ohtzi6HzsDPjXgCtlTt3FqTcfFfI92IlTr4JWqC9UK1QT1ZTeng0MkPQmv68hDANHbt5CpETZHjW5q4OOgWhVvj5IyOC2NZHtKlJBkdsMAa15ouOOJLzBvAvbqOR/yUROsEiQ==
[1/5] camel git commit: CAMEL-10297 Downloaded FTP file should be easy to read as an InputStream instead of OutputStream.
Repository: camel Updated Branches: refs/heads/master be9ee3490 -> a59700876 CAMEL-10297 Downloaded FTP file should be easy to read as an InputStream instead of OutputStream. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e04d343c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e04d343c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e04d343c Branch: refs/heads/master Commit: e04d343c8fe0c2def13c7f48692deacf058d698c Parents: be9ee34 Author: Claus IbsenAuthored: Wed Sep 7 09:42:12 2016 +0200 Committer: Andrea Cosentino Committed: Thu Sep 8 08:16:00 2016 +0200 -- .../camel/component/file/remote/FtpOperations.java | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e04d343c/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java -- diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java index cfc72f7..db58a9c 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java @@ -325,7 +325,7 @@ public class FtpOperations implements RemoteFileOperations { if (is != null) { try { -is.close(); +IOHelper.close(is); client.completePendingCommand(); } catch (IOException e) { throw new GenericFileOperationFailedException(e.getMessage(), e); @@ -335,7 +335,6 @@ public class FtpOperations implements RemoteFileOperations { @SuppressWarnings("unchecked") private boolean retrieveFileToStreamInBody(String name, Exchange exchange) throws GenericFileOperationFailedException { -OutputStream os = null; boolean result; try { GenericFile target = (GenericFile) exchange.getProperty(FileComponent.FILE_EXCHANGE_FILE); @@ -365,9 +364,15 @@ public class FtpOperations implements RemoteFileOperations { exchange.getIn().setHeader(RemoteFileComponent.REMOTE_FILE_INPUT_STREAM, is); result = true; } else { -os = new ByteArrayOutputStream(); -target.setBody(os); -result = client.retrieveFile(remoteName, os); +// read the entire file into memory in the byte array +ByteArrayOutputStream bos = new ByteArrayOutputStream(); +result = client.retrieveFile(remoteName, bos); +// close the stream after done +IOHelper.close(bos); + +// and then set the body as an input stream so we can read the content easily +InputStream is = new ByteArrayInputStream(bos.toByteArray()); +target.setBody(is); } // store client reply information after the operation @@ -381,8 +386,6 @@ public class FtpOperations implements RemoteFileOperations { } catch (IOException e) { throw new GenericFileOperationFailedException(client.getReplyCode(), client.getReplyString(), e.getMessage(), e); -} finally { -IOHelper.close(os, "retrieve: " + name, log); } return result;
[3/5] camel git commit: CAMEL-10297 Fixed camel-ftp to work with splitter loading the remote file content and not its directory listing
CAMEL-10297 Fixed camel-ftp to work with splitter loading the remote file content and not its directory listing Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5484967e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5484967e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5484967e Branch: refs/heads/master Commit: 5484967eb3ccc1f11d44662f855a257225fdcbf9 Parents: c4bfbe4 Author: Claus IbsenAuthored: Wed Sep 7 14:49:54 2016 +0200 Committer: Andrea Cosentino Committed: Thu Sep 8 08:17:47 2016 +0200 -- .../main/java/org/apache/camel/WrappedFile.java | 7 + .../org/apache/camel/util/ObjectHelper.java | 10 -- .../file/remote/FtpConsumerFileSplitTest.java | 33 ++-- 3 files changed, 24 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5484967e/camel-core/src/main/java/org/apache/camel/WrappedFile.java -- diff --git a/camel-core/src/main/java/org/apache/camel/WrappedFile.java b/camel-core/src/main/java/org/apache/camel/WrappedFile.java index 856a15a..9b1d768 100644 --- a/camel-core/src/main/java/org/apache/camel/WrappedFile.java +++ b/camel-core/src/main/java/org/apache/camel/WrappedFile.java @@ -28,4 +28,11 @@ public interface WrappedFile { */ T getFile(); +/** + * Gets the content of the file. + * + * @return the content of the file. + */ +Object getBody(); + } http://git-wip-us.apache.org/repos/asf/camel/blob/5484967e/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java -- diff --git a/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java b/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java index 1a18a4b..0f10eaf 100644 --- a/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java +++ b/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java @@ -1805,9 +1805,15 @@ public final class ObjectHelper { */ public static Scanner getScanner(Exchange exchange, Object value) { if (value instanceof WrappedFile) { -// generic file is just a wrapper for the real file so call again with the real file WrappedFile gf = (WrappedFile) value; -return getScanner(exchange, gf.getFile()); +Object body = gf.getBody(); +if (body != null) { +// we have loaded the file content into the body so use that +value = body; +} else { +// generic file is just a wrapper for the real file so call again with the real file +return getScanner(exchange, gf.getFile()); +} } String charset = exchange.getProperty(Exchange.CHARSET_NAME, String.class); http://git-wip-us.apache.org/repos/asf/camel/blob/5484967e/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java -- diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java index 3f2bf76..6cba739 100644 --- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java +++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerFileSplitTest.java @@ -30,42 +30,27 @@ import org.junit.Test; public class FtpConsumerFileSplitTest extends FtpServerTestSupport { private String getFtpUrl() { -return "ftp://admin@localhost:; + getPort() + "/incoming/?password=admin" -+ "=false"; -} - -@Override -@Before -public void setUp() throws Exception { -super.setUp(); -prepareFtpServer(); +return "ftp://admin@localhost:; + getPort() + "/incoming/?password=admin=true"; } @Test public void testFtpRoute() throws Exception { MockEndpoint resultEndpoint = getMockEndpoint("mock:result"); -resultEndpoint.expectedMessageCount(3); -resultEndpoint.expectedBodiesReceived("line1","line2"); -resultEndpoint.assertIsSatisfied(); - -// assert the file -File file = new File("target/ftptest/textexample.txt"); -assertTrue("The text file should exists", file.exists()); -} +resultEndpoint.expectedBodiesReceived("line1","line2","line3"); -private void prepareFtpServer() throws Exception { -// prepares the FTP Server by creating a file on the server that we want to