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 adccd26 Regen adccd26 is described below commit adccd268d02c3be58f92729363221e338a865dd2 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Feb 15 08:07:33 2019 +0100 Regen --- .../camel-jsch/src/main/docs/scp-component.adoc | 2 +- docs/components/modules/ROOT/nav.adoc | 1 + .../modules/ROOT/pages/ftp-component.adoc | 2 +- .../modules/ROOT/pages/ftps-component.adoc | 2 +- .../modules/ROOT/pages/jcache-policy.adoc | 134 +++++++++++++++++++++ .../modules/ROOT/pages/scp-component.adoc | 2 +- .../modules/ROOT/pages/sftp-component.adoc | 2 +- .../components/modules/ROOT/pages/spring-boot.adoc | 2 +- .../camel-spring-boot-dependencies/pom.xml | 20 --- 9 files changed, 141 insertions(+), 26 deletions(-) diff --git a/components/camel-jsch/src/main/docs/scp-component.adoc b/components/camel-jsch/src/main/docs/scp-component.adoc index ac37c3e..405d472 100644 --- a/components/camel-jsch/src/main/docs/scp-component.adoc +++ b/components/camel-jsch/src/main/docs/scp-component.adoc @@ -99,7 +99,7 @@ with the following path and query parameters: | *disconnectOnBatchComplete* (producer) | Whether or not to disconnect from remote FTP server right after a Batch upload is complete. disconnectOnBatchComplete will only disconnect the current connection to the FTP server. | false | boolean | *moveExistingFileStrategy* (producer) | Strategy (Custom Strategy) used to move file with special naming token to use when fileExist=Move is configured. By default, there is an implementation used if no custom strategy is provided | | FileMoveExisting Strategy | *connectTimeout* (advanced) | Sets the connect timeout for waiting for a connection to be established Used by both FTPClient and JSCH | 10000 | int -| *soTimeout* (advanced) | Sets the so timeout Used only by FTPClient | 300000 | int +| *soTimeout* (advanced) | Sets the so timeout FTP and FTPS Only for Camel 2.4. SFTP for Camel 2.14.3/2.15.3/2.16 onwards. Is the SocketOptions.SO_TIMEOUT value in millis. Recommended option is to set this to 300000 so as not have a hanged connection. On SFTP this option is set as timeout on the JSCH Session instance. | 300000 | int | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean | *timeout* (advanced) | Sets the data timeout for waiting for reply Used only by FTPClient | 30000 | int | *knownHostsFile* (security) | Sets the known_hosts file, so that the jsch endpoint can do host key verification. You can prefix with classpath: to load the file from classpath instead of file system. | | String diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc index 38ca6e0..e71ab83 100644 --- a/docs/components/modules/ROOT/nav.adoc +++ b/docs/components/modules/ROOT/nav.adoc @@ -163,6 +163,7 @@ * xref:jaxb-dataformat.adoc[JAXB DataFormat] * xref:jbpm-component.adoc[JBPM Component] * xref:jcache-component.adoc[JCache Component] +* xref:jcache-policy.adoc[JCache Policy] * xref:jclouds-component.adoc[JClouds Component] * xref:jcr-component.adoc[JCR Component] * xref:jdbc-component.adoc[JDBC Component] diff --git a/docs/components/modules/ROOT/pages/ftp-component.adoc b/docs/components/modules/ROOT/pages/ftp-component.adoc index 44ce825..af17b7d 100644 --- a/docs/components/modules/ROOT/pages/ftp-component.adoc +++ b/docs/components/modules/ROOT/pages/ftp-component.adoc @@ -165,7 +165,7 @@ with the following path and query parameters: | *maximumReconnectAttempts* (advanced) | Specifies the maximum reconnect attempts Camel performs when it tries to connect to the remote FTP server. Use 0 to disable this behavior. | | int | *reconnectDelay* (advanced) | Delay in millis Camel will wait before performing a reconnect attempt. | | long | *siteCommand* (advanced) | Sets optional site command(s) to be executed after successful login. Multiple site commands can be separated using a new line character. | | String -| *soTimeout* (advanced) | Sets the so timeout Used only by FTPClient | 300000 | int +| *soTimeout* (advanced) | Sets the so timeout FTP and FTPS Only for Camel 2.4. SFTP for Camel 2.14.3/2.15.3/2.16 onwards. Is the SocketOptions.SO_TIMEOUT value in millis. Recommended option is to set this to 300000 so as not have a hanged connection. On SFTP this option is set as timeout on the JSCH Session instance. | 300000 | int | *stepwise* (advanced) | Sets whether we should stepwise change directories while traversing file structures when downloading files, or as well when uploading a file to a directory. You can disable this if you for example are in a situation where you cannot change directory on the FTP server due security reasons. | true | boolean | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean | *throwExceptionOnConnect Failed* (advanced) | Should an exception be thrown if connection failed (exhausted) By default exception is not thrown and a WARN is logged. You can use this to enable exception being thrown and handle the thrown exception from the org.apache.camel.spi.PollingConsumerPollStrategy rollback method. | false | boolean diff --git a/docs/components/modules/ROOT/pages/ftps-component.adoc b/docs/components/modules/ROOT/pages/ftps-component.adoc index 3993d4f..3b6c776 100644 --- a/docs/components/modules/ROOT/pages/ftps-component.adoc +++ b/docs/components/modules/ROOT/pages/ftps-component.adoc @@ -125,7 +125,7 @@ with the following path and query parameters: | *maximumReconnectAttempts* (advanced) | Specifies the maximum reconnect attempts Camel performs when it tries to connect to the remote FTP server. Use 0 to disable this behavior. | | int | *reconnectDelay* (advanced) | Delay in millis Camel will wait before performing a reconnect attempt. | | long | *siteCommand* (advanced) | Sets optional site command(s) to be executed after successful login. Multiple site commands can be separated using a new line character. | | String -| *soTimeout* (advanced) | Sets the so timeout Used only by FTPClient | 300000 | int +| *soTimeout* (advanced) | Sets the so timeout FTP and FTPS Only for Camel 2.4. SFTP for Camel 2.14.3/2.15.3/2.16 onwards. Is the SocketOptions.SO_TIMEOUT value in millis. Recommended option is to set this to 300000 so as not have a hanged connection. On SFTP this option is set as timeout on the JSCH Session instance. | 300000 | int | *stepwise* (advanced) | Sets whether we should stepwise change directories while traversing file structures when downloading files, or as well when uploading a file to a directory. You can disable this if you for example are in a situation where you cannot change directory on the FTP server due security reasons. | true | boolean | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean | *throwExceptionOnConnect Failed* (advanced) | Should an exception be thrown if connection failed (exhausted) By default exception is not thrown and a WARN is logged. You can use this to enable exception being thrown and handle the thrown exception from the org.apache.camel.spi.PollingConsumerPollStrategy rollback method. | false | boolean diff --git a/docs/components/modules/ROOT/pages/jcache-policy.adoc b/docs/components/modules/ROOT/pages/jcache-policy.adoc new file mode 100644 index 0000000..a7846e8 --- /dev/null +++ b/docs/components/modules/ROOT/pages/jcache-policy.adoc @@ -0,0 +1,134 @@ +[[jcache-policy]] +== JCache Policy + +The JCachePolicy is an interceptor around a route that caches the "result of the route" - the message body - after the route is completed. + If next time the route is called with a "similar" Exchange, the cached value is used on the Exchange instead of executing the route. + The policy uses the JSR107/JCache API of a cache implementation. + +The policy takes a _key_ value from the received Exchange to get or store values in the cache. By default the _key_ is the message body. + For example if the route - having a JCachePolicy - receives an Exchange with a String body "fruit" and the body at the + end of the route is "apple", it stores a _key/value_ pair "fruit=apple" in the cache. If next time another Exchange arrives + with a body "fruit", the value "apple" is taken from the cache instead of letting the route process the Exchange. + +So by default the message body at the beginning of the route is the cache _key_ and the body at the end is the stored _value_. It's possible to use something else as _key_ by setting a Camel Expression via _.setKeyExpression()_ +that will be used to determine the key. + +The policy needs a JCache Cache. It can be set directly by _.setCache()_ or the policy will try to get or create the Cache + based on the other parameters set. + +Similar caching solution is available for example in Spring using the @Cacheable annotation. + +=== JCachePolicy Fields + + +[width="100%",cols="2,5,3,2",options="header"] +|=== +| Name | Description | Default | Type +| *cache* | The Cache to use to store the cached values. If this value is set, _cacheManager_, _cacheName_ and _cacheConfiguration_ is ignored. | | Cache +| *cacheManager* | The CacheManager to use to lookup or create the Cache. Used only if _cache_ is not set. | Try to find a CacheManager in CamelContext registry or calls the standard JCache _Caching.getCachingProvider().getCacheManager()_. | CacheManager +| *cacheName* | Name of the cache. Get the Cache from cacheManager or create a new one if it doesn't exist. | RouteId of the route. | String +| *cacheConfiguration* | JCache cache configuration to use if a new Cache is created | Default new _MutableConfiguration_ object. | CacheConfiguration +| *keyExpression* | An Expression to evaluate to determine the cache key. | Exchange body | Expression +| *enabled* | If policy is not enabled, no wrapper processor is added to the route. It has impact only during startup, not during runtime. For example it can be used to disable caching from properties. | true | boolean +|=== + +## How to determine cache to use? + + +### Set cache + +The cache used by the policy can be set directly. This means you have to configure the cache yourself and get a JCache Cache object, + but this gives the most flexibility. For example it can be setup in the config xml of the cache provider (Hazelcast, EhCache, ...) + and used here. Or it's possible to use the standard Caching API as below: + + +[source,java] +---------------------------- +MutableConfiguration configuration = new MutableConfiguration<>(); +configuration.setTypes(String.class, Object.class); +configuration.setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.MINUTES, 60))); +CacheManager cacheManager = Caching.getCachingProvider().getCacheManager(); +Cache cache = cacheManager.createCache("orders",configuration); + +JCachePolicy jcachePolicy = new JCachePolicy(); +jcachePolicy.setCache(cache); + +from("direct:get-orders") + .policy(jcachePolicy) + .log("Getting order with id: ${body}") + .bean(OrderService.class,"findOrderById(${body})"); +---------------------------- + +### Set cacheManager + +If the _cache_ is not set, the policy will try to lookup or create the cache automatically. + If the _cacheManager_ is set on the policy, it will try to get cache with the set _cacheName_ (routeId by default) from the CacheManager. + Is the cache does not exist it will create a new one using the _cacheConfiguration_ (new MutableConfiguration by default). + +[source,java] +---------------------------- +//In a Spring environment for example the CacheManager may already exist as a bean +@Autowire +CacheManager cacheManager; +... + +//Cache "items" is used or created if not exists +JCachePolicy jcachePolicy = new JCachePolicy(); +jcachePolicy.setCacheManager(cacheManager); +jcachePolicy.setCacheName("items") +---------------------------- + +### Find cacheManager + +If _cacheManager_ (and the _cache_) is not set, the policy will try to find a JCache CacheManager object: + +* Lookup a CacheManager in Camel registry - that falls back on JNDI or Spring context based on the environment +* Use the standard api _Caching.getCachingProvider().getCacheManager()_ + +[source,java] +---------------------------- +//A Cache "getorders" will be used (or created) from the found CacheManager +from("direct:get-orders").routeId("getorders") + .policy(new JCachePolicy()) + .log("Getting order with id: ${body}") + .bean(OrderService.class,"findOrderById(${body})"); +---------------------------- + +## KeyExpression + +By default the policy uses the received Exchange body as _key_, so the default expression is like _simple("${body})_. + We can set a different Camel Expression as _keyExpression_ which will be evaluated to determine the key. + For example if we try to find an _order_ by an _orderId_ which is in the message headers, + set _header("orderId")_ (or _simple("${header.orderId})_ as _keyExpression_. + +The expression is evaluated only once at the beginning of the route to determine the _key_. If nothing was found in cache, + this _key_ is used to store the _value_ in cache at the end of the route. + +[source,java] +---------------------------- +MutableConfiguration configuration = new MutableConfiguration<>(); +configuration.setTypes(String.class, Order.class); +configuration.setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.MINUTES, 10))); + +JCachePolicy jcachePolicy = new JCachePolicy(); +jcachePolicy.setCacheConfiguration(configuration); +jcachePolicy.setCacheName("orders") +jcachePolicy.setKeyExpression(simple("${header.orderId})) + +//The cache key is taken from "orderId" header. +from("direct:get-orders") + .policy(jcachePolicy) + .log("Getting order with id: ${header.orderId}") + .bean(OrderService.class,"findOrderById(${header.orderId})"); +---------------------------- + +## Special scenarios and error handling + +If the Cache used by the policy is closed (can be done dynamically), the whole caching functionality is skipped, + the route will be executed every time. + +If the determined _key_ is _null_, nothing is looked up or stored in cache. + +In case of an exception during the route, the error handled is called as always. If the exception gets _handled()_, + the policy stores the Exchange body, otherwise nothing is added to the cache. + If an exception happens during evaluating the keyExpression, the routing fails, the error handler is called as normally. diff --git a/docs/components/modules/ROOT/pages/scp-component.adoc b/docs/components/modules/ROOT/pages/scp-component.adoc index ac37c3e..405d472 100644 --- a/docs/components/modules/ROOT/pages/scp-component.adoc +++ b/docs/components/modules/ROOT/pages/scp-component.adoc @@ -99,7 +99,7 @@ with the following path and query parameters: | *disconnectOnBatchComplete* (producer) | Whether or not to disconnect from remote FTP server right after a Batch upload is complete. disconnectOnBatchComplete will only disconnect the current connection to the FTP server. | false | boolean | *moveExistingFileStrategy* (producer) | Strategy (Custom Strategy) used to move file with special naming token to use when fileExist=Move is configured. By default, there is an implementation used if no custom strategy is provided | | FileMoveExisting Strategy | *connectTimeout* (advanced) | Sets the connect timeout for waiting for a connection to be established Used by both FTPClient and JSCH | 10000 | int -| *soTimeout* (advanced) | Sets the so timeout Used only by FTPClient | 300000 | int +| *soTimeout* (advanced) | Sets the so timeout FTP and FTPS Only for Camel 2.4. SFTP for Camel 2.14.3/2.15.3/2.16 onwards. Is the SocketOptions.SO_TIMEOUT value in millis. Recommended option is to set this to 300000 so as not have a hanged connection. On SFTP this option is set as timeout on the JSCH Session instance. | 300000 | int | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean | *timeout* (advanced) | Sets the data timeout for waiting for reply Used only by FTPClient | 30000 | int | *knownHostsFile* (security) | Sets the known_hosts file, so that the jsch endpoint can do host key verification. You can prefix with classpath: to load the file from classpath instead of file system. | | String diff --git a/docs/components/modules/ROOT/pages/sftp-component.adoc b/docs/components/modules/ROOT/pages/sftp-component.adoc index 7679935..0b5bcce 100644 --- a/docs/components/modules/ROOT/pages/sftp-component.adoc +++ b/docs/components/modules/ROOT/pages/sftp-component.adoc @@ -109,7 +109,7 @@ with the following path and query parameters: | *reconnectDelay* (advanced) | Delay in millis Camel will wait before performing a reconnect attempt. | | long | *serverAliveCountMax* (advanced) | Allows you to set the serverAliveCountMax of the sftp session | 1 | int | *serverAliveInterval* (advanced) | Allows you to set the serverAliveInterval of the sftp session | | int -| *soTimeout* (advanced) | Sets the so timeout Used only by FTPClient | 300000 | int +| *soTimeout* (advanced) | Sets the so timeout FTP and FTPS Only for Camel 2.4. SFTP for Camel 2.14.3/2.15.3/2.16 onwards. Is the SocketOptions.SO_TIMEOUT value in millis. Recommended option is to set this to 300000 so as not have a hanged connection. On SFTP this option is set as timeout on the JSCH Session instance. | 300000 | int | *stepwise* (advanced) | Sets whether we should stepwise change directories while traversing file structures when downloading files, or as well when uploading a file to a directory. You can disable this if you for example are in a situation where you cannot change directory on the FTP server due security reasons. | true | boolean | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean | *throwExceptionOnConnect Failed* (advanced) | Should an exception be thrown if connection failed (exhausted) By default exception is not thrown and a WARN is logged. You can use this to enable exception being thrown and handle the thrown exception from the org.apache.camel.spi.PollingConsumerPollStrategy rollback method. | false | boolean diff --git a/docs/components/modules/ROOT/pages/spring-boot.adoc b/docs/components/modules/ROOT/pages/spring-boot.adoc index 7d7defc..38e5dcd 100644 --- a/docs/components/modules/ROOT/pages/spring-boot.adoc +++ b/docs/components/modules/ROOT/pages/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/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml index fa66a79..e1f3cc4 100644 --- a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml +++ b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml @@ -163,11 +163,6 @@ </dependency> <dependency> <groupId>io.nessus</groupId> - <artifactId>nessus-ipfs</artifactId> - <version>1.0.0.Beta1</version> - </dependency> - <dependency> - <groupId>io.nessus</groupId> <artifactId>nessus-ipfs-client</artifactId> <version>1.0.0.Beta4</version> </dependency> @@ -679,16 +674,6 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-core-minimal</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core-minimal-starter</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> <artifactId>camel-core-osgi</artifactId> <version>${project.version}</version> </dependency> @@ -2535,11 +2520,6 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring-boot-minimal-starter</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> <artifactId>camel-spring-boot-starter</artifactId> <version>${project.version}</version> </dependency>