svn commit: r1001989 [2/2] - in /websites/production/camel/content: cache/main.pageCache http4.html
Modified: websites/production/camel/content/http4.html == --- websites/production/camel/content/http4.html (original) +++ websites/production/camel/content/http4.html Fri Dec 2 01:18:41 2016 @@ -85,7 +85,7 @@ -HTTP4 ComponentAvailable as of Camel 2.3The http4: component provides HTTP based endpoints for calling external HTTP resources (as a client to call external servers using HTTP).Maven users will need to add the following dependency to their pom.xml for this component: +HTTP4 ComponentAvailable as of Camel 2.3Thecamel-http4 component provides HTTP based endpoints for calling external HTTP resources (as a client to call external servers using HTTP).Maven users will need to add the following dependency to their pom.xml for this component: -camel-http4 vs camel-httpCamel-http4 uses http://hc.apache.org/httpcomponents-client-ga/;>Apache HttpClient 4.x while camel-http uses http://hc.apache.org/httpclient-3.x/;>Apache HttpClient 3.x.URI format +camel-http4 vs camel-httpCamel-http4 uses http://hc.apache.org/httpcomponents-client-ga/;>Apache HttpClient 4.x whilecamel-http uses http://hc.apache.org/httpclient-3.x/;>Apache HttpClient 3.x.URI format -Will by default use port 80 for HTTP and 443 for HTTPS.You can append query options to the URI in the following format, ?option=valueoption=value...camel-http4 vs camel-jettyYou can only produce to endpoints generated by the HTTP4 component. Therefore it should never be used as input into your Camel Routes. To bind/expose an HTTP endpoint via a HTTP server as input to a Camel route, use the Jetty Component instead.HttpComponent OptionsNameDefault ValueDescriptionmaxTotalConnections200The maximum number of connections.connectionsPerRoute20The maximum number of connections per route.cookieStorenullCamel 2.11.2/2.12.0: To use a custom org.apache.http.client.CookieStore. By default the org.apache.http.impl.client.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookies shouldn't be stored as we are just bridging (eg acting as a proxy).httpClientConfigurernullReference to a org.apache.camel.component.http.HttpClientConfigurer in the Registry.clientConnectionManagernullTo use a custom org.apache.http.conn.ClientConnectionManager.httpBindingnullTo use a custom org.apache.camel.component.http.HttpBinding.httpContextnullCamel 2.9.2: To use a custom org.apache.http.protocol.HttpContext when executing requests.sslContextParametersnullCamel 2.8: To use a custom org.apache.camel.util.jsse.SSLContextParam eters. See Using the JSSE Configuration Utility. Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent. If you need to use 2 or more different instances, you need to define a new HttpComponent per instance you need. See further below for more details.x509HostnameVerifierBrowserCompatHostnameVerifierCamel 2.7: You can refer to a different org.apache.http.conn.ssl.X509HostnameVerifier instance in the Registry such as org.apache.http.conn.ssl.StrictHostnameVerifier or org.apache.http.conn.ssl.AllowAllHostnameVerifier.< /p>connectionTimeToLive-1Camel 2.11.0: The time for connection to live, the time unit is millisecond, the default value is always keep alive.allowJavaSerializedObjectfalseCamel 2.16.1/2.15.5: Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk.HttpEndpoint OptionsNameDefault ValueDescriptionthrowExceptionOnFailuretrueOption to disable throwing the HttpOperationFailedException in case of failed responses from the remote server. This allows you to get all responses regardless of the HTTP status code.bridgeEndpointfalse If true, HttpProducer will ignore the Exchange.HTTP_URI header, and use the endpoint's URI for request. You may also set the throwExcpetionOnFailure to be false to let the HttpProducer send all fault responses back. Also if set to true HttpProducer and CamelServlet will skip the gzip processing if the content-encoding is "gzip".clearExpiredCookiestrueCamel 2.11.2/2.12.0: Whether to clear expired cookies before sending the HTTP request. This ensures the cookies store does not keep growing by adding new cookies which is newer removed when they are expired.cookieStorenull< td colspan="1"
svn commit: r1001989 [1/2] - in /websites/production/camel/content: cache/main.pageCache http4.html
Author: buildbot Date: Fri Dec 2 01:18:41 2016 New Revision: 1001989 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/http4.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available.
[2/2] camel git commit: CAMEL-10272: Added a debug log covering for instance a runtime exception thrown from a custom aggregation strategy
CAMEL-10272: Added a debug log covering for instance a runtime exception thrown from a custom aggregation strategy Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/62d19db0 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/62d19db0 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/62d19db0 Branch: refs/heads/master Commit: 62d19db070a1b2c6a83f3ccd942b72f90c3cba37 Parents: 5fa4f3e Author: aldettingerAuthored: Thu Dec 1 16:48:48 2016 +0100 Committer: Claus Ibsen Committed: Thu Dec 1 21:01:46 2016 +0100 -- .../main/java/org/apache/camel/processor/MulticastProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/62d19db0/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java index 5c5b361..e0cd13d 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java +++ b/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java @@ -531,7 +531,9 @@ public class MulticastProcessor extends ServiceSupport implements AsyncProcessor } } catch (Throwable e) { // wrap in exception to explain where it failed -subExchange.setException(new CamelExchangeException("Parallel processing failed for number " + aggregated.get(), subExchange, e)); +CamelExchangeException cex = new CamelExchangeException("Parallel processing failed for number " + aggregated.get(), subExchange, e); +subExchange.setException(cex); +LOG.debug(cex.getMessage(), cex); } finally { aggregated.incrementAndGet(); }
[1/2] camel git commit: CAMEL-10272: Completed the aggregation strategy javadoc
Repository: camel Updated Branches: refs/heads/master 5fa4f3eb5 -> 68e1a5431 CAMEL-10272: Completed the aggregation strategy javadoc Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/68e1a543 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/68e1a543 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/68e1a543 Branch: refs/heads/master Commit: 68e1a5431e93175514b21ae39d7f43bf4553073b Parents: 62d19db Author: aldettingerAuthored: Thu Dec 1 16:57:06 2016 +0100 Committer: Claus Ibsen Committed: Thu Dec 1 21:01:46 2016 +0100 -- .../org/apache/camel/processor/aggregate/AggregationStrategy.java | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/68e1a543/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationStrategy.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationStrategy.java b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationStrategy.java index e8cd90f..802e1b8 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationStrategy.java +++ b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationStrategy.java @@ -28,6 +28,9 @@ import org.apache.camel.Exchange; * or remove some headers. And a more common use case is for instance to count some values from the body payload. That * could be to sum up a total amount etc. * + * Note that oldExchange may be null more than once when this strategy is throwing a {@link java.lang.RuntimeException} + * and parallelProcessing is used. + * * It is possible that newExchange is null which could happen if there was no data possible * to acquire. Such as when using a {@link org.apache.camel.processor.PollEnricher} to poll from a JMS queue which * is empty and a timeout was set.
buildbot success in on camel-site-production
The Buildbot has detected a restored build on builder camel-site-production while building . Full details are available at: https://ci.apache.org/builders/camel-site-production/builds/12496 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The Nightly scheduler named 'camel-site-production' triggered this build Build Source Stamp: [branch camel/website] HEAD Blamelist: Build succeeded! Sincerely, -The Buildbot
camel git commit: Fix CS
Repository: camel Updated Branches: refs/heads/master 2fe9ed210 -> 5fa4f3eb5 Fix CS Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5fa4f3eb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5fa4f3eb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5fa4f3eb Branch: refs/heads/master Commit: 5fa4f3eb570c33abfab30e424a01eaddefdf3e85 Parents: 2fe9ed2 Author: lburgazzoliAuthored: Thu Dec 1 16:47:51 2016 +0100 Committer: lburgazzoli Committed: Thu Dec 1 16:47:51 2016 +0100 -- .../camel/spring/boot/CamelConfigurationProperties.java | 6 +++--- .../camel/spring/boot/SpringTypeConverterTest.java | 12 +++- 2 files changed, 10 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5fa4f3eb/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java -- diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java index b6bafe0..bded0e2 100644 --- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java +++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java @@ -5,9 +5,9 @@ * 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 - * + * + * 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. http://git-wip-us.apache.org/repos/asf/camel/blob/5fa4f3eb/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java -- diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java index 3ccc367..4814374 100644 --- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java +++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java @@ -98,17 +98,19 @@ public class SpringTypeConverterTest { @Override public String toString() { -return "Person{" + -"name='" + name + '\'' + -", age=" + age + -'}'; +return "Person{" ++ "name='" + name + '\'' ++ ", age=" + age ++ '}'; } } @Configuration @EnableAutoConfiguration( exclude = { -CamelAutoConfiguration.class, TypeConversionConfiguration.class, WebMvcAutoConfiguration.class +CamelAutoConfiguration.class, +TypeConversionConfiguration.class, +WebMvcAutoConfiguration.class } ) public static class SpringTypeConversionConfiguration {
[2/2] camel git commit: Fix test case
Fix test case Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/495cddd8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/495cddd8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/495cddd8 Branch: refs/heads/camel-2.18.x Commit: 495cddd8337755a33b5e5d6433df29ffafd8330d Parents: 65a67bc Author: lburgazzoliAuthored: Thu Dec 1 16:42:33 2016 +0100 Committer: lburgazzoli Committed: Thu Dec 1 16:42:33 2016 +0100 -- .../camel/spring/boot/SpringTypeConverterTest.java| 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/495cddd8/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java -- diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java index 3ccc367..8894df1 100644 --- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java +++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; +import org.apache.camel.spring.boot.health.CamelHealthAutoConfiguration; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -98,17 +99,20 @@ public class SpringTypeConverterTest { @Override public String toString() { -return "Person{" + -"name='" + name + '\'' + -", age=" + age + -'}'; +return "Person{" ++ "name='" + name + '\'' ++ ", age=" + age ++ '}'; } } @Configuration @EnableAutoConfiguration( exclude = { -CamelAutoConfiguration.class, TypeConversionConfiguration.class, WebMvcAutoConfiguration.class +CamelAutoConfiguration.class, +TypeConversionConfiguration.class, +WebMvcAutoConfiguration.class, +CamelHealthAutoConfiguration.class } ) public static class SpringTypeConversionConfiguration {
camel git commit: CAMEL-10548: Converter from List to String is not found when @EnableAutoConfiguration is used
Repository: camel Updated Branches: refs/heads/master 371a22e39 -> 2fe9ed210 CAMEL-10548: Converter from List to String is not found when @EnableAutoConfiguration is used Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2fe9ed21 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2fe9ed21 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2fe9ed21 Branch: refs/heads/master Commit: 2fe9ed2100b598417a1a7e37036915c3ddb6c9ae Parents: 371a22e Author: lburgazzoliAuthored: Thu Dec 1 15:06:44 2016 +0100 Committer: lburgazzoli Committed: Thu Dec 1 16:28:52 2016 +0100 -- .../camel/spring/boot/SpringTypeConverter.java | 31 - .../spring/boot/SpringTypeConverterTest.java| 129 +++ 2 files changed, 158 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2fe9ed21/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java -- diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java index 4e45c8e..af062b4 100644 --- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java +++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java @@ -19,20 +19,26 @@ package org.apache.camel.spring.boot; import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.apache.camel.Exchange; import org.apache.camel.TypeConversionException; import org.apache.camel.support.TypeConverterSupport; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.convert.ConversionFailedException; import org.springframework.core.convert.ConversionService; +import org.springframework.core.convert.ConverterNotFoundException; +import org.springframework.core.convert.TypeDescriptor; public class SpringTypeConverter extends TypeConverterSupport { private final List conversionServices; +private final ConcurrentHashMap types; @Autowired public SpringTypeConverter(List conversionServices) { this.conversionServices = conversionServices; +this.types = new ConcurrentHashMap<>(); } @Override @@ -47,12 +53,33 @@ public class SpringTypeConverter extends TypeConverterSupport { return null; } +TypeDescriptor sourceType = types.computeIfAbsent(value.getClass(), TypeDescriptor::valueOf); +TypeDescriptor targetType = types.computeIfAbsent(type, TypeDescriptor::valueOf); + for (ConversionService conversionService : conversionServices) { -if (conversionService.canConvert(value.getClass(), type)) { -return conversionService.convert(value, type); +if (conversionService.canConvert(sourceType, targetType)) { +try { +return (T)conversionService.convert(value, sourceType, targetType); +} catch (ConversionFailedException e) { +// if value is a collection or an array the check ConversionService::canConvert +// may return true but then the conversion of specific objects may fail +// +// https://issues.apache.org/jira/browse/CAMEL-10548 +// https://jira.spring.io/browse/SPR-14971 +// +if (e.getCause() instanceof ConverterNotFoundException && isArrayOrCollection(value)) { +return null; +} else { +throw new TypeConversionException(value, type, e); +} +} } } + return null; } +private boolean isArrayOrCollection(Object value) { +return value instanceof Collection || value.getClass().isArray(); +} } http://git-wip-us.apache.org/repos/asf/camel/blob/2fe9ed21/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java -- diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringTypeConverterTest.java new file mode 100644 index 000..3ccc367 --- /dev/null +++
buildbot failure in on camel-site-production
The Buildbot has detected a new failure on builder camel-site-production while building . Full details are available at: https://ci.apache.org/builders/camel-site-production/builds/12495 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The Nightly scheduler named 'camel-site-production' triggered this build Build Source Stamp: [branch camel/website] HEAD Blamelist: BUILD FAILED: failed compile Sincerely, -The Buildbot
svn commit: r1001948 - in /websites/production/camel/content: cache/main.pageCache camel-219-release.html
Author: buildbot Date: Thu Dec 1 12:18:53 2016 New Revision: 1001948 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-219-release.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/camel-219-release.html == --- websites/production/camel/content/camel-219-release.html (original) +++ websites/production/camel/content/camel-219-release.html Thu Dec 1 12:18:53 2016 @@ -85,7 +85,7 @@ -Camel 2.19.0 Release (currently in progress)http://camel.apache.org/images/camel-box-small.png; data-image-src="http://camel.apache.org/images/camel-box-small.png;>New and NoteworthyWelcome to the 2.19.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)ReturningnullfromBean should work similar to howsetBodyandtransformworks when they set anullbody.The Camel Spring Boot starter components now have their auto configuration depends onorg.apache.camel.springboot.CamelAutoConfiguration which makes it easier writing unit tests where you can excludeorg.apache.camel.springboot.CamelAutoConfiguration to turn off Camel Spring Boot auto configuration completely.Camel now supports OWASP dependency check maven pluginCamel-Nats component now supports TLSCamel-Nats component now supports explicit flushing (with timeout) of the connectionCamel-Metrics component now supports Gauge typeFileconsumer now supports idempotent-changed and idempotent-rename read lock strategies for clustering.Camel Catalog now supports custom runtime providers that only includes the supported Camel components, languages and data formats running in that container. For example for Karaf or Spring Boot in the camel-catalog-provider-karaf and camel-catalog-provider-sprin gboot.Thehttps://cwiki.apache.org/confluence/display/WW/bean;>bean component will when calling a method that returned an instance of Callablenow call that callable to obtain the chained result. This allows to call Groovy functions/closures etc.FailoverLoad Balancer with inheritErrorHandler=false, now allows Camel'sError Handler to react after the load balancer is exhausted.Salesforce component now supports limits, recent items and approvalsDumping Camel routes as XML now includes custom namespaces which are at xpath expressions etc. Likewise updating Camel routes from XML can now include namespaces which will be associated on xpath expressions.Fixed these issuesFixedHystrix EIP t o also execute fallback if execution was rejected or short-circuited or other reasons from Hystrix.Fixed adding new routes to running CamelContext and if the new routes would fail to startup, then before these routes would "hang around". Now only succesful started routes are added.Adding or removing routes that starts fromUndertow no longer restart the entire HTTP serverVM endpoint should prepare exchange with the CamelContext from the consumer and not from cached endpoint which can be differentFixed a bug when usingRest DSL withSERVLET could cause a java.io.IOException: Stream closed exception when using Beanin the route.Fixed an issue when usingpipeline in Java DSL not setting up the EIP corr ectly which could lead to runtime route not as intended.FixedDropbox to useStream caching to avoid reading entire file into memory so Camel can process big filesFixed Netty douhle buffer release leak inNetty4 andNetty4 HTTPNew Enterprise Integration PatternsNew Componentscamel-bonita -allow you to communicate with a remote Bonita engine.camel-google-pubsub - allow you communicate with Google Cloud Pub/SubNew DSLNew AnnotationsNew Data FormatNew LanguagesNew ExamplesNew TutorialsAPI breakingCamel-spring-LDAP now uses java.util.function.BiFunctionL, Q, S instead oforg.apache.camel.component.springldap.LdapOperationsFunctionQ, SKnown IssuesImportant changes to consider when upgradingCamel now uses Karaf 4.x API and therefore not possible to run on older Karaf versionscamel-spring-boot now don't include prototype scoped beans when auto scanning for RouteBuilder instances, which is how camel-spring works. You can turn this back using th eincludeNonSingletons option.Getting the DistributionsBinary DistributionsDescriptionDownload LinkPGP Signature file of downloadWindows Distributionhttp://www.apache.org/dyn/closer.cgi/camel/apache-camel/x.y.x/apache-camel-x.y.x.zip;>apache-camel-x.y.x.ziphttp://www.apache.org/dist/camel/apache-camel/x.y.x/apache-camel-x.y.x.zip.asc;>apache-camel-x. y.x.zip.ascUnix/Linux/Cygwin
[3/4] camel git commit: CAMEL-10344: RouteIdFactory for rest routes
CAMEL-10344: RouteIdFactory for rest routes Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b0025751 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b0025751 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b0025751 Branch: refs/heads/master Commit: b0025751386f59e7020ebd5cc19b9580eb477f46 Parents: 0da9713 Author: Tomasz KopczynskiAuthored: Sun Nov 27 20:05:49 2016 +0100 Committer: Claus Ibsen Committed: Thu Dec 1 12:23:22 2016 +0100 -- .../org/apache/camel/impl/RouteIdFactory.java | 126 --- .../apache/camel/model/rest/RestDefinition.java | 8 +- .../apache/camel/model/rest/VerbDefinition.java | 10 +- .../apache/camel/impl/RouteIdFactoryTest.java | 15 +++ 4 files changed, 143 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b0025751/camel-core/src/main/java/org/apache/camel/impl/RouteIdFactory.java -- diff --git a/camel-core/src/main/java/org/apache/camel/impl/RouteIdFactory.java b/camel-core/src/main/java/org/apache/camel/impl/RouteIdFactory.java index 5fdb51c..06044ea 100644 --- a/camel-core/src/main/java/org/apache/camel/impl/RouteIdFactory.java +++ b/camel-core/src/main/java/org/apache/camel/impl/RouteIdFactory.java @@ -22,20 +22,22 @@ import java.util.Optional; import org.apache.camel.NamedNode; import org.apache.camel.model.FromDefinition; import org.apache.camel.model.RouteDefinition; -import org.apache.camel.model.rest.RestBindingDefinition; +import org.apache.camel.model.rest.RestDefinition; +import org.apache.camel.model.rest.VerbDefinition; import org.apache.camel.spi.NodeIdFactory; /** * Factory for generating route ids based on uris. * * For direct/seda routes it returns route name (direct:start -> start). - * For rest routes it returns its context path. + * For rest routes it returns its method and context path formatted as one string. * * When id cannot be generated, falls back to other {@link NodeIdFactory} implementation. * If none is passed in the constructor, then {@link DefaultNodeIdFactory} is used. */ public class RouteIdFactory implements NodeIdFactory { +private static final char SEPARATOR = '-'; private NodeIdFactory defaultNodeIdFactory; public RouteIdFactory() { @@ -62,6 +64,14 @@ public class RouteIdFactory implements NodeIdFactory { } } +if (definition instanceof VerbDefinition) { +Optional id = extractIdFromVerb((VerbDefinition) definition); + +if (id.isPresent()) { +return id.get(); +} +} + return defaultNodeIdFactory.createId(definition); } @@ -69,6 +79,10 @@ public class RouteIdFactory implements NodeIdFactory { * Extract id from routes */ private Optional extractId(RouteDefinition routeDefinition) { +if (routeDefinition.getRestDefinition() != null) { +return Optional.empty(); +} + List inputs = routeDefinition.getInputs(); if (inputs == null || inputs.isEmpty()) { @@ -97,27 +111,111 @@ public class RouteIdFactory implements NodeIdFactory { } /** - * Extract id from rest route. + * Extract id from a rest route. */ private Optional extractIdFromRestDefinition(RouteDefinition route) { -if (route.getOutputs().get(0) instanceof RestBindingDefinition) { -if (route.getRestDefinition() == null) { -return Optional.empty(); -} +if (route.getRestDefinition() != null) { +return extractIdFromInput(route); +} -String path = route.getRestDefinition().getPath(); +return Optional.empty(); +} -if (path == null) { -return Optional.empty(); -} +/** + * Extract id from a rest verb definition. + */ +private Optional extractIdFromVerb(VerbDefinition verb) { +RestDefinition restDefinition = verb.getRest(); + +if (restDefinition != null) { +StringBuilder routeId = new StringBuilder(); +routeId.append(verb.asVerb()); +appendWithSeparator(routeId, prepareUri(restDefinition.getPath())); -if (path.indexOf('/') > 0) { -return Optional.of(path.substring(0, path.indexOf('/'))); +if (verb.getUri() != null && verb.getUri().length() > 0) { +appendWithSeparator(routeId, prepareUri(verb.getUri())); } -return Optional.of(path); +verb.setUsedForGeneratingNodeId(true); + +return Optional.of(routeId.toString()); } return
[1/4] camel git commit: CAMEL-10509: Fixed model helper to work without camel context which was optiona. Such as camel-swagger-java uses that.
Repository: camel Updated Branches: refs/heads/camel-2.18.x ba7fa060d -> 6cb200c09 refs/heads/master 0da97136b -> 371a22e39 CAMEL-10509: Fixed model helper to work without camel context which was optiona. Such as camel-swagger-java uses that. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/371a22e3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/371a22e3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/371a22e3 Branch: refs/heads/master Commit: 371a22e39c7ed7f78444d46a77b8d0768d3bcd88 Parents: 9e685b1 Author: Claus IbsenAuthored: Thu Dec 1 11:35:36 2016 +0100 Committer: Claus Ibsen Committed: Thu Dec 1 12:23:22 2016 +0100 -- .../org/apache/camel/model/ModelHelper.java | 58 1 file changed, 48 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/371a22e3/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java -- diff --git a/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java b/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java index a1d30fd..db40f63 100644 --- a/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java +++ b/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java @@ -38,6 +38,7 @@ import org.w3c.dom.Node; import org.apache.camel.CamelContext; import org.apache.camel.Expression; import org.apache.camel.NamedNode; +import org.apache.camel.TypeConversionException; import org.apache.camel.converter.jaxp.XmlConverter; import org.apache.camel.model.language.ExpressionDefinition; import org.apache.camel.spi.NamespaceAware; @@ -83,7 +84,14 @@ public final class ModelHelper { StringWriter buffer = new StringWriter(); marshaller.marshal(definition, buffer); -Document dom = context.getTypeConverter().convertTo(Document.class, buffer.toString()); +XmlConverter xmlConverter = newXmlConverter(context); +String xml = buffer.toString(); +Document dom; +try { +dom = xmlConverter.toDOMDocument(xml, null); +} catch (Exception e) { +throw new TypeConversionException(xml, Document.class, e); +} // Add additional namespaces to the document root element Element documentElement = dom.getDocumentElement(); @@ -92,9 +100,6 @@ public final class ModelHelper { } // We invoke the type converter directly because we need to pass some custom XML output options -TypeConverterRegistry registry = context.getTypeConverterRegistry(); -XmlConverter xmlConverter = registry.getInjector().newInstance(XmlConverter.class); - Properties outputProperties = new Properties(); outputProperties.put(OutputKeys.INDENT, "yes"); outputProperties.put(OutputKeys.STANDALONE, "yes"); @@ -103,7 +108,6 @@ public final class ModelHelper { } catch (TransformerException e) { throw new IllegalStateException("Failed converting document object to string", e); } - } /** @@ -116,7 +120,7 @@ public final class ModelHelper { * @throws javax.xml.bind.JAXBException is thrown if error unmarshalling from xml to model */ public static T createModelFromXml(CamelContext context, String xml, Class type) throws JAXBException { -return modelToXml(context, xml, type); +return modelToXml(context, null, xml, type); } /** @@ -129,7 +133,7 @@ public final class ModelHelper { * @throws javax.xml.bind.JAXBException is thrown if error unmarshalling from xml to model */ public static T createModelFromXml(CamelContext context, InputStream stream, Class type) throws JAXBException { -return modelToXml(context, stream, type); +return modelToXml(context, stream, null, type); } /** @@ -142,8 +146,10 @@ public final class ModelHelper { public static RoutesDefinition loadRoutesDefinition(CamelContext context, InputStream inputStream) throws Exception { JAXBContext jaxbContext = getJAXBContext(context); +XmlConverter xmlConverter = newXmlConverter(context); +Document dom = xmlConverter.toDOMDocument(inputStream, null); + Map namespaces = new LinkedHashMap<>(); -Document dom = context.getTypeConverter().mandatoryConvertTo(Document.class, inputStream); extractNamespaces(dom, namespaces); Binder binder = jaxbContext.createBinder(); @@ -172,11 +178,25 @@ public final class ModelHelper { return answer; } -private static T modelToXml(CamelContext context, Object object, Class type) throws JAXBException { +
[4/4] camel git commit: CAMEL-10509: Fixed model helper to work without camel context which was optiona. Such as camel-swagger-java uses that.
CAMEL-10509: Fixed model helper to work without camel context which was optiona. Such as camel-swagger-java uses that. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6cb200c0 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6cb200c0 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6cb200c0 Branch: refs/heads/camel-2.18.x Commit: 6cb200c09b20a9ac2919c17f747d6f0243601531 Parents: ba7fa06 Author: Claus IbsenAuthored: Thu Dec 1 11:35:36 2016 +0100 Committer: Claus Ibsen Committed: Thu Dec 1 12:24:34 2016 +0100 -- .../org/apache/camel/model/ModelHelper.java | 58 1 file changed, 48 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6cb200c0/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java -- diff --git a/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java b/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java index a1d30fd..db40f63 100644 --- a/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java +++ b/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java @@ -38,6 +38,7 @@ import org.w3c.dom.Node; import org.apache.camel.CamelContext; import org.apache.camel.Expression; import org.apache.camel.NamedNode; +import org.apache.camel.TypeConversionException; import org.apache.camel.converter.jaxp.XmlConverter; import org.apache.camel.model.language.ExpressionDefinition; import org.apache.camel.spi.NamespaceAware; @@ -83,7 +84,14 @@ public final class ModelHelper { StringWriter buffer = new StringWriter(); marshaller.marshal(definition, buffer); -Document dom = context.getTypeConverter().convertTo(Document.class, buffer.toString()); +XmlConverter xmlConverter = newXmlConverter(context); +String xml = buffer.toString(); +Document dom; +try { +dom = xmlConverter.toDOMDocument(xml, null); +} catch (Exception e) { +throw new TypeConversionException(xml, Document.class, e); +} // Add additional namespaces to the document root element Element documentElement = dom.getDocumentElement(); @@ -92,9 +100,6 @@ public final class ModelHelper { } // We invoke the type converter directly because we need to pass some custom XML output options -TypeConverterRegistry registry = context.getTypeConverterRegistry(); -XmlConverter xmlConverter = registry.getInjector().newInstance(XmlConverter.class); - Properties outputProperties = new Properties(); outputProperties.put(OutputKeys.INDENT, "yes"); outputProperties.put(OutputKeys.STANDALONE, "yes"); @@ -103,7 +108,6 @@ public final class ModelHelper { } catch (TransformerException e) { throw new IllegalStateException("Failed converting document object to string", e); } - } /** @@ -116,7 +120,7 @@ public final class ModelHelper { * @throws javax.xml.bind.JAXBException is thrown if error unmarshalling from xml to model */ public static T createModelFromXml(CamelContext context, String xml, Class type) throws JAXBException { -return modelToXml(context, xml, type); +return modelToXml(context, null, xml, type); } /** @@ -129,7 +133,7 @@ public final class ModelHelper { * @throws javax.xml.bind.JAXBException is thrown if error unmarshalling from xml to model */ public static T createModelFromXml(CamelContext context, InputStream stream, Class type) throws JAXBException { -return modelToXml(context, stream, type); +return modelToXml(context, stream, null, type); } /** @@ -142,8 +146,10 @@ public final class ModelHelper { public static RoutesDefinition loadRoutesDefinition(CamelContext context, InputStream inputStream) throws Exception { JAXBContext jaxbContext = getJAXBContext(context); +XmlConverter xmlConverter = newXmlConverter(context); +Document dom = xmlConverter.toDOMDocument(inputStream, null); + Map namespaces = new LinkedHashMap<>(); -Document dom = context.getTypeConverter().mandatoryConvertTo(Document.class, inputStream); extractNamespaces(dom, namespaces); Binder binder = jaxbContext.createBinder(); @@ -172,11 +178,25 @@ public final class ModelHelper { return answer; } -private static T modelToXml(CamelContext context, Object object, Class type) throws JAXBException { +private static T modelToXml(CamelContext context, InputStream is, String xml, Class type) throws JAXBException {
[2/4] camel git commit: Polished
Polished Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9e685b19 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9e685b19 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9e685b19 Branch: refs/heads/master Commit: 9e685b1993e18eee7bcd12390e1824ec7d8a58aa Parents: b002575 Author: Claus IbsenAuthored: Thu Dec 1 11:05:00 2016 +0100 Committer: Claus Ibsen Committed: Thu Dec 1 12:23:22 2016 +0100 -- .../java/org/apache/camel/spring/boot/SpringTypeConverter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/9e685b19/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java -- diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java index 5f4021a..4e45c8e 100644 --- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java +++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java @@ -42,7 +42,7 @@ public class SpringTypeConverter extends TypeConverterSupport { return null; } -// do not attempt to convert List -> Map. Ognl expression may use this converter as a fallback expecting null +// do not attempt to convert List -> Map. Ognl expression may use this converter as a fallback expecting null if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof Collection)) { return null; }
svn commit: r1001944 - in /websites/production/camel/content: cache/main.pageCache camel-219-release.html
Author: buildbot Date: Thu Dec 1 10:19:53 2016 New Revision: 1001944 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-219-release.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/camel-219-release.html == --- websites/production/camel/content/camel-219-release.html (original) +++ websites/production/camel/content/camel-219-release.html Thu Dec 1 10:19:53 2016 @@ -85,7 +85,7 @@ -Camel 2.19.0 Release (currently in progress)http://camel.apache.org/images/camel-box-small.png; data-image-src="http://camel.apache.org/images/camel-box-small.png;>New and NoteworthyWelcome to the 2.19.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)ReturningnullfromBean should work similar to howsetBodyandtransformworks when they set anullbody.The Camel Spring Boot starter components now have their auto configuration depends onorg.apache.camel.springboot.CamelAutoConfiguration which makes it easier writing unit tests where you can excludeorg.apache.camel.springboot.CamelAutoConfiguration to turn off Camel Spring Boot auto configuration completely.Camel now supports OWASP dependency check maven pluginCamel-Nats component now supports TLSCamel-Nats component now supports explicit flushing (with timeout) of the connectionCamel-Metrics component now supports Gauge typeFileconsumer now supports idempotent-changed and idempotent-rename read lock strategies for clustering.Camel Catalog now supports custom runtime providers that only includes the supported Camel components, languages and data formats running in that container. For example for Karaf or Spring Boot in the camel-catalog-provider-karaf and camel-catalog-provider-sprin gboot.Thehttps://cwiki.apache.org/confluence/display/WW/bean;>bean component will when calling a method that returned an instance of Callablenow call that callable to obtain the chained result. This allows to call Groovy functions/closures etc.FailoverLoad Balancer with inheritErrorHandler=false, now allows Camel'sError Handler to react after the load balancer is exhausted.Salesforce component now supports limits, recent items and approvalsDumping Camel routes as XML now includes custom namespaces which are at xpath expressions etc. Likewise updating Camel routes from XML can now include namespaces which will be associated on xpath expressions.Fixed these issuesFixedHystrix EIP t o also execute fallback if execution was rejected or short-circuited or other reasons from Hystrix.Fixed adding new routes to running CamelContext and if the new routes would fail to startup, then before these routes would "hang around". Now only succesful started routes are added.Adding or removing routes that starts fromUndertow no longer restart the entire HTTP serverVM endpoint should prepare exchange with the CamelContext from the consumer and not from cached endpoint which can be differentFixed a bug when usingRest DSL withSERVLET could cause a java.io.IOException: Stream closed exception when using Beanin the route.Fixed an issue when usingpipeline in Java DSL not setting up the EIP corr ectly which could lead to runtime route not as intended.FixedDropbox to useStream caching to avoid reading entire file into memory so Camel can process big filesFixed Netty douhle buffer release leak inNetty4 andNetty4 HTTPNew Enterprise Integration PatternsNew Componentscamel-bonita -allow you to communicate with a remote Bonita engine.camel-firebase - allow you to communicate with Google Firebase Databasecamel-google-pubsub - allow you communicate with Google Cloud Pub/SubNew DSLNew AnnotationsNew Data FormatNew LanguagesNew ExamplesNew TutorialsAPI breakingKnown IssuesImportant changes to consider when upgradingCamel now uses Karaf 4.x API and therefore not possible to run on older Karaf versionscamel-spring-boot now don't include prototype scoped beans when auto scanning for RouteBuilder instances, which is how camel-spring works. You can turn this back using theincludeNonSingletons option.Get ting the DistributionsBinary DistributionsDescriptionDownload LinkPGP Signature file of downloadWindows Distributionhttp://www.apache.org/dyn/closer.cgi/camel/apache-camel/x.y.x/apache-camel-x.y.x.zip;>apache-camel-x.y.x.ziphttp://www.apache.org/dist/camel/apache-camel/x.y.x/apache-camel-x.y.x.zip.asc;>apache-camel-x.y.x.zip.ascUnix/Linux/Cy gwin
camel git commit: CAMEL-10491 - Spring-LDAP - Utilizing java.util.function.BiFunction (Java 8) for FUNCTION_DRIVEN operation.
Repository: camel Updated Branches: refs/heads/master 2310011d1 -> 0da97136b CAMEL-10491 - Spring-LDAP - Utilizing java.util.function.BiFunction (Java 8) for FUNCTION_DRIVEN operation. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0da97136 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0da97136 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0da97136 Branch: refs/heads/master Commit: 0da97136b05ca4d004a14984e919c388e14b1c12 Parents: 2310011 Author: ThakkerAuthored: Tue Nov 29 14:13:13 2016 -0500 Committer: Andrea Cosentino Committed: Thu Dec 1 10:53:31 2016 +0100 -- .../src/main/docs/spring-ldap-component.adoc| 2 +- .../component/springldap/LdapOperation.java | 4 +- .../springldap/LdapOperationsFunction.java | 39 .../springldap/SpringLdapProducer.java | 3 +- .../springldap/SpringLdapProducerTest.java | 15 +++- 5 files changed, 12 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/0da97136/components/camel-spring-ldap/src/main/docs/spring-ldap-component.adoc -- diff --git a/components/camel-spring-ldap/src/main/docs/spring-ldap-component.adoc b/components/camel-spring-ldap/src/main/docs/spring-ldap-component.adoc index 8c7c200..5d0e813 100644 --- a/components/camel-spring-ldap/src/main/docs/spring-ldap-component.adoc +++ b/components/camel-spring-ldap/src/main/docs/spring-ldap-component.adoc @@ -120,7 +120,7 @@ http://docs.oracle.com/javase/6/docs/api/javax/naming/directory/ModificationItem Function-Driven -The message body must have entries with the keys *`function`* and *`request`*. The *`function`* value must be of type `org.apache.camel.component.springldap.LdapOperationsFunction `. The *`request`* value must be the same type as the `Q` type parameter in the *`function`* and it must encapsulate the parameters expected by the LdapTemplate method being invoked within the *`function`*. The `S` type parameter represents the response type as returned by the LdapTemplate method being invoked. +The message body must have entries with the keys *`function`* and *`request`*. The *`function`* value must be of type `java.util.function.BiFunction`. The `L` type parameter must be of type `org.springframework.ldap.core.LdapOperations`. The *`request`* value must be the same type as the `Q` type parameter in the *`function`* and it must encapsulate the parameters expected by the LdapTemplate method being invoked within the *`function`*. The `S` type parameter represents the response type as returned by the LdapTemplate method being invoked. This operation allows dynamic invocation of LdapTemplate methods that are not covered by the operations mentioned above. *Key definitions* http://git-wip-us.apache.org/repos/asf/camel/blob/0da97136/components/camel-spring-ldap/src/main/java/org/apache/camel/component/springldap/LdapOperation.java -- diff --git a/components/camel-spring-ldap/src/main/java/org/apache/camel/component/springldap/LdapOperation.java b/components/camel-spring-ldap/src/main/java/org/apache/camel/component/springldap/LdapOperation.java index c88e00f..c0fefed 100644 --- a/components/camel-spring-ldap/src/main/java/org/apache/camel/component/springldap/LdapOperation.java +++ b/components/camel-spring-ldap/src/main/java/org/apache/camel/component/springldap/LdapOperation.java @@ -16,13 +16,15 @@ */ package org.apache.camel.component.springldap; +import java.util.function.BiFunction; + import org.springframework.ldap.core.LdapOperations; /** * The list of supported LDAP operations. Currently supported operations are * search, bind, and unbind, authenticate and modify_attributes. The * function_driven operation expects a request {@link Object} along with an - * instance of {@link LdapOperationsFunction} that can be used to invoke any + * instance of {@link BiFunction} that can be used to invoke any * method on the {@link LdapOperations} instance */ public enum LdapOperation { http://git-wip-us.apache.org/repos/asf/camel/blob/0da97136/components/camel-spring-ldap/src/main/java/org/apache/camel/component/springldap/LdapOperationsFunction.java -- diff --git a/components/camel-spring-ldap/src/main/java/org/apache/camel/component/springldap/LdapOperationsFunction.java b/components/camel-spring-ldap/src/main/java/org/apache/camel/component/springldap/LdapOperationsFunction.java deleted file mode 100644 index ae3cf21..000 ---