[camel] branch master updated: CAMEL-13550: Fixed some integration tests in camel-salesforce
This is an automated email from the ASF dual-hosted git repository. aldettinger 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 e61138b CAMEL-13550: Fixed some integration tests in camel-salesforce e61138b is described below commit e61138b9f2834bf4a3d0c3e8cf868e5de8faea70 Author: aldettinger AuthorDate: Mon May 20 17:55:18 2019 +0200 CAMEL-13550: Fixed some integration tests in camel-salesforce --- .../camel-salesforce-component/README.md| 3 ++- .../SalesforceComponentVerifierExtension.java | 17 +++-- .../component/salesforce/HttpProxyIntegrationTest.java | 6 +++--- .../PlatformEventsConsumerIntegrationTest.java | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/components/camel-salesforce/camel-salesforce-component/README.md b/components/camel-salesforce/camel-salesforce-component/README.md index c0f145b..943c64e 100644 --- a/components/camel-salesforce/camel-salesforce-component/README.md +++ b/components/camel-salesforce/camel-salesforce-component/README.md @@ -99,7 +99,7 @@ If your tests cannot be run alongside other tests you can use `@Category(Standal Manual Salesforce instance setup for integration tests -This is include for those that wish to setup the Salesforce instance manually for integration tests. +This is include for those that wish to setup the Salesforce instance manually for integration tests. It could also help to double-check your setup. Besides that account you'll need a _test user_ account that has `Bulk API Hard Delete` permission. You can create one by going to _My Developer Account_ (link from [developer.salesforce.com](https://login.salesforce.com/?lt=de)). Under _Administer_ expand _Manage Users_ and select _Profiles_ find _System Administrator_ profile and select _Clone_. Use `System Administrator With Hard Delete` as the profile name, and after saving under _Administrative Permissions_ click edit and tick _Bulk [...] @@ -111,6 +111,7 @@ Install the Warehouse package, tested with _Spring 2013_ (version 1.2) that can - delete custom fields `Quantity`, `Invoice`, `Line_Item_Total` from the `Line_Item` object - delete custom field `Quantity` from the `Merchanidise` object, you will need to delete dependencies (ApexClass and Visualforce Page) - create new ApexClass named `MerchandiseRestResource` with the content of `MerchandiseRestResource.apxc` + - deactivate the `Contact Duplicate Rule` in salesforce configuration You'll need to access a Merchandise record and run a `Test Report` in order for them to appear in _Recent Items_ and _Recent Reports_. Do this by accessing _Warehouse_ application from the menu in the top right, and selecting _Merchandise_ click _Go!_ (preselected is View: _All_) and click on the single Merchandise item available. Next go to Reports and select and run _Test Report_ from _Test Reports_. This is needed by the integration tests as they access recent items and recently run reports. diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponentVerifierExtension.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponentVerifierExtension.java index b9f7946..cce1658 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponentVerifierExtension.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponentVerifierExtension.java @@ -77,20 +77,17 @@ public class SalesforceComponentVerifierExtension extends DefaultComponentVerifi try { SalesforceClientTemplate.invoke(getCamelContext(), parameters, client -> { -client.getVersions(Collections.emptyMap(), -(response, headers, exception) -> processSalesforceException(builder, Optional.ofNullable(exception))); +client.getVersions(Collections.emptyMap(), (response, headers, exception) -> processSalesforceException(builder, Optional.ofNullable(exception))); return null; }); } catch (NoSuchOptionException e) { -builder.error( -ResultErrorBuilder.withMissingOption(e.getOptionName()).build() -); -} catch (SalesforceException e) { -processSalesforceException(builder, Optional.of(e)); + builder.error(ResultErrorBuilder.withMissingOption(e.getOptionName()).build()); } catch (Exception e) { -builder.error( -ResultErrorBuilder.withException(e).build() -); +if (e.getCause() instanceof SalesforceException) { +
[camel] branch master updated: Upgrade Jackson to version 2.9.9
This is an automated email from the ASF dual-hosted git repository. acosentino 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 33e2142 Upgrade Jackson to version 2.9.9 33e2142 is described below commit 33e21425dada07ed105a028c08bb231538d7e540 Author: Andrea Cosentino AuthorDate: Mon May 20 16:11:29 2019 +0200 Upgrade Jackson to version 2.9.9 --- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent/pom.xml b/parent/pom.xml index 81c2c57..c83c37c 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -317,7 +317,7 @@ 1.9.12 2.4.5 2.6.1 -2.9.8 +2.9.9 2.19.3 15.0 1.2.154_2
[camel-k] 01/01: chore(lint): better naming (#672)
This is an automated email from the ASF dual-hosted git repository. zregvart pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git commit e57a961201549e9a9a426622740105a08d5d775d Merge: 42c1cfd cd9f4ac Author: Zoran Regvart AuthorDate: Mon May 20 15:05:26 2019 +0200 chore(lint): better naming (#672) chore(lint): better naming pkg/apis/camel/v1alpha1/integration_types_support_test.go | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-)
[camel-k] branch master updated (42c1cfd -> e57a961)
This is an automated email from the ASF dual-hosted git repository. zregvart pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git. from 42c1cfd chore(lint): fix findings add cd9f4ac chore(lint): better naming new e57a961 chore(lint): better naming (#672) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: pkg/apis/camel/v1alpha1/integration_types_support_test.go | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-)
[camel-k] branch master updated: chore(lint): fix findings
This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git The following commit(s) were added to refs/heads/master by this push: new 42c1cfd chore(lint): fix findings 42c1cfd is described below commit 42c1cfd12fff25c7cb090ce100857e986a096263 Author: lburgazzoli AuthorDate: Mon May 20 13:45:17 2019 +0200 chore(lint): fix findings --- pkg/apis/camel/v1alpha1/integration_types_support_test.go | 1 + pkg/cmd/describe.go | 8 ++-- pkg/cmd/run.go| 2 +- pkg/trait/knative_service.go | 10 +++--- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/pkg/apis/camel/v1alpha1/integration_types_support_test.go b/pkg/apis/camel/v1alpha1/integration_types_support_test.go index 48e6e26..c6a4c23 100644 --- a/pkg/apis/camel/v1alpha1/integration_types_support_test.go +++ b/pkg/apis/camel/v1alpha1/integration_types_support_test.go @@ -36,6 +36,7 @@ func TestAllLanguages(t *testing.T) { func TestLanguageFromName(t *testing.T) { for _, l := range Languages { + l := l t.Run(string(l), func(t *testing.T) { code := SourceSpec{ DataSpec: DataSpec{ diff --git a/pkg/cmd/describe.go b/pkg/cmd/describe.go index c407f0f..95c59c6 100644 --- a/pkg/cmd/describe.go +++ b/pkg/cmd/describe.go @@ -51,10 +51,6 @@ func (iw *indentedWriter) write(indentLevel int, format string, i ...interface{} fmt.Fprintf(iw.out, prefix+format, i...) } -func (iw *indentedWriter) writeLine(i ...interface{}) { - fmt.Fprintln(iw.out, i...) -} - func (iw *indentedWriter) Flush() { if f, ok := iw.out.(flusher); ok { f.flush() @@ -104,8 +100,8 @@ func indentedString(f func(io.Writer)) string { f(out) out.Flush() - str := string(buf.String()) - return str + + return buf.String() } func newCmdDescribe(rootCmdOptions *RootCmdOptions) *cobra.Command { diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index a70fff7..9fb6e8a 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -149,7 +149,7 @@ func (o *runCmdOptions) validateArgs(_ *cobra.Command, args []string) error { for _, volume := range o.Volumes { volumeConfig := strings.Split(volume, ":") if len(volumeConfig) != 2 || len(strings.TrimSpace(volumeConfig[0])) == 0 || len(strings.TrimSpace(volumeConfig[1])) == 0 { - return fmt.Errorf("Volume '%s' is invalid. It should be in the format: pvcname:/container/path", volume) + return fmt.Errorf("volume '%s' is invalid, it should be in the format: pvcname:/container/path", volume) } } diff --git a/pkg/trait/knative_service.go b/pkg/trait/knative_service.go index 4731353..bae73dd 100644 --- a/pkg/trait/knative_service.go +++ b/pkg/trait/knative_service.go @@ -110,11 +110,7 @@ func (t *knativeServiceTrait) Configure(e *Environment) (bool, error) { } func (t *knativeServiceTrait) Apply(e *Environment) error { - svc, err := t.getServiceFor(e) - if err != nil { - return err - } - + svc := t.getServiceFor(e) maps := e.ComputeConfigMaps() e.Resources.Add(svc) @@ -123,7 +119,7 @@ func (t *knativeServiceTrait) Apply(e *Environment) error { return nil } -func (t *knativeServiceTrait) getServiceFor(e *Environment) (*serving.Service, error) { +func (t *knativeServiceTrait) getServiceFor(e *Environment) *serving.Service { labels := map[string]string{ "camel.apache.org/integration": e.Integration.Name, } @@ -212,5 +208,5 @@ func (t *knativeServiceTrait) getServiceFor(e *Environment) (*serving.Service, e , ) - return , nil + return }
[camel] 01/01: CAMEL-13546 - as < and > is invalid in windows
This is an automated email from the ASF dual-hosted git repository. onders pushed a commit to branch CAMEL-13546 in repository https://gitbox.apache.org/repos/asf/camel.git commit 9bc24fd3f9941a0756b6653e87f3d2bd62420e47 Author: önder sezgin AuthorDate: Mon May 20 14:49:07 2019 +0300 CAMEL-13546 - as < and > is invalid in windows bypass if type starts with java.util. --- .../apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java index 139915e..7de51d4 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java @@ -1140,7 +1140,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { // read java type from project, returns null if not found private JavaClass readJavaType(String type) { -if (!type.startsWith("java.lang.")) { +if (!type.startsWith("java.lang.") && !type.startsWith("java.util.")) { final String fileName = type.replaceAll("[\\[\\]]", "").replaceAll("\\.", "\\/") + ".java"; Path sourcePath = project.getCompileSourceRoots().stream().map(Paths::get).map(p -> p.resolve(fileName)).filter(Files::isRegularFile).findFirst().orElse(null); if (sourcePath == null) {
[camel] branch CAMEL-13546 created (now 9bc24fd)
This is an automated email from the ASF dual-hosted git repository. onders pushed a change to branch CAMEL-13546 in repository https://gitbox.apache.org/repos/asf/camel.git. at 9bc24fd CAMEL-13546 - as < and > is invalid in windows This branch includes the following new commits: new 9bc24fd CAMEL-13546 - as < and > is invalid in windows The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[camel] 03/03: CAMEL-13456: CamelContext - Move API that are not related to end users to an ExtendedCamelContext
This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch extended in repository https://gitbox.apache.org/repos/asf/camel.git commit 584209deaf92505f3f91b82138c4395d2e4b513e Author: Claus Ibsen AuthorDate: Mon May 20 13:08:45 2019 +0200 CAMEL-13456: CamelContext - Move API that are not related to end users to an ExtendedCamelContext --- .../src/main/java/org/apache/camel/component/bean/MethodInfo.java | 8 .../main/java/org/apache/camel/component/bean/ProxyHelper.java| 3 ++- .../camel/component/cxf/CxfGreeterCXFMessageRouterTest.java | 4 ++-- .../apache/camel/component/hystrix/processor/HystrixReifier.java | 3 ++- .../main/java/org/apache/camel/component/seda/SedaEndpoint.java | 3 ++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/MethodInfo.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/MethodInfo.java index 8a7a443..8296fe9 100644 --- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/MethodInfo.java +++ b/components/camel-bean/src/main/java/org/apache/camel/component/bean/MethodInfo.java @@ -38,6 +38,7 @@ import org.apache.camel.Exchange; import org.apache.camel.ExchangePattern; import org.apache.camel.Expression; import org.apache.camel.ExpressionEvaluationException; +import org.apache.camel.ExtendedCamelContext; import org.apache.camel.Message; import org.apache.camel.NoTypeConversionAvailableException; import org.apache.camel.Pattern; @@ -56,7 +57,6 @@ import org.slf4j.LoggerFactory; import static org.apache.camel.util.ObjectHelper.asString; - /** * Information about a method to be used for invocation. */ @@ -124,7 +124,7 @@ public class MethodInfo { org.apache.camel.RoutingSlip routingSlipAnnotation = (org.apache.camel.RoutingSlip)collectedMethodAnnotation.get(org.apache.camel.RoutingSlip.class); if (routingSlipAnnotation != null && matchContext(routingSlipAnnotation.context())) { -routingSlip = camelContext.getAnnotationBasedProcessorFactory().createRoutingSlip(camelContext, routingSlipAnnotation); +routingSlip = camelContext.adapt(ExtendedCamelContext.class).getAnnotationBasedProcessorFactory().createRoutingSlip(camelContext, routingSlipAnnotation); // add created routingSlip as a service so we have its lifecycle managed try { camelContext.addService(routingSlip); @@ -137,7 +137,7 @@ public class MethodInfo { (org.apache.camel.DynamicRouter)collectedMethodAnnotation.get(org.apache.camel.DynamicRouter.class); if (dynamicRouterAnnotation != null && matchContext(dynamicRouterAnnotation.context())) { -dynamicRouter = camelContext.getAnnotationBasedProcessorFactory().createDynamicRouter(camelContext, dynamicRouterAnnotation); +dynamicRouter = camelContext.adapt(ExtendedCamelContext.class).getAnnotationBasedProcessorFactory().createDynamicRouter(camelContext, dynamicRouterAnnotation); // add created dynamicRouter as a service so we have its lifecycle managed try { camelContext.addService(dynamicRouter); @@ -150,7 +150,7 @@ public class MethodInfo { (org.apache.camel.RecipientList)collectedMethodAnnotation.get(org.apache.camel.RecipientList.class); if (recipientListAnnotation != null && matchContext(recipientListAnnotation.context())) { -recipientList = camelContext.getAnnotationBasedProcessorFactory().createRecipientList(camelContext, recipientListAnnotation); +recipientList = camelContext.adapt(ExtendedCamelContext.class).getAnnotationBasedProcessorFactory().createRecipientList(camelContext, recipientListAnnotation); // add created recipientList as a service so we have its lifecycle managed try { camelContext.addService(recipientList); diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/ProxyHelper.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/ProxyHelper.java index 51b8848..0192c08 100644 --- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/ProxyHelper.java +++ b/components/camel-bean/src/main/java/org/apache/camel/component/bean/ProxyHelper.java @@ -19,6 +19,7 @@ package org.apache.camel.component.bean; import java.lang.reflect.Proxy; import org.apache.camel.Endpoint; +import org.apache.camel.ExtendedCamelContext; import org.apache.camel.Producer; /** @@ -51,7 +52,7 @@ public final class ProxyHelper { * Creates a Proxy which sends the exchange to the endpoint. */ public static T createProxy(Endpoint endpoint, boolean binding, ClassLoader cl, Class[] interfaceClasses, MethodInfoCache methodCache) throws Exception { -Producer
[camel] branch extended created (now 584209d)
This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a change to branch extended in repository https://gitbox.apache.org/repos/asf/camel.git. at 584209d CAMEL-13456: CamelContext - Move API that are not related to end users to an ExtendedCamelContext This branch includes the following new commits: new d99ecec CAMEL-13456: CamelContext - Move API that are not related to end users to an ExtendedCamelContext new 48b876c CAMEL-13456: CamelContext - Move API that are not related to end users to an ExtendedCamelContext new 584209d CAMEL-13456: CamelContext - Move API that are not related to end users to an ExtendedCamelContext The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[camel] 02/03: CAMEL-13456: CamelContext - Move API that are not related to end users to an ExtendedCamelContext
This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch extended in repository https://gitbox.apache.org/repos/asf/camel.git commit 48b876cbdeaf09fb3a7abb8f1aa59536f52475f9 Author: Claus Ibsen AuthorDate: Mon May 20 12:55:33 2019 +0200 CAMEL-13456: CamelContext - Move API that are not related to end users to an ExtendedCamelContext --- MIGRATION.md | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MIGRATION.md b/MIGRATION.md index c8766a8..4ff7b5d 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -21,6 +21,7 @@ In Camel 2.x camel-core was one JAR file, which now has been splitup into many J - camel-caffeine-lrucache - camel-cloud - camel-core +- camel-jaxp - camel-management-api - camel-management-impl - camel-support @@ -155,6 +156,12 @@ In Camel 2.x we have deprecated `getProperties` on `CamelContext` in favour of ` +### Extended CamelContext + +The APIs on `CamelContext` has been reducded a bit to focus on relevant API for Camel end users. The advanced use-cases and for SPI and component developers, then some of the APIs from `CamelContext` has been moved to `ExtendedCamelContext` which you can access via adapt: + +ExtendedCamelContext ecc = context.adapt(ExtendedCamelContext.class); + ### Main class The `Main` class from `camel-core`, `camel-spring` and `camel-cdi` has been modified to only support a single `CamelContext` which was really its intention, but there was some old crufy code for multiple Camels. The method `getCamelContextMap` has been removed, and there is just a `getCamelContext` method now.
[camel] 01/03: CAMEL-13456: CamelContext - Move API that are not related to end users to an ExtendedCamelContext
This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch extended in repository https://gitbox.apache.org/repos/asf/camel.git commit d99ecec8a3d7c4f2d24eec40533367cbb7647a52 Author: Claus Ibsen AuthorDate: Mon May 20 12:53:22 2019 +0200 CAMEL-13456: CamelContext - Move API that are not related to end users to an ExtendedCamelContext --- .../main/java/org/apache/camel/CamelContext.java | 122 + .../org/apache/camel/ExtendedCamelContext.java | 146 + .../camel/impl/engine/AbstractCamelContext.java| 3 +- .../apache/camel/impl/engine/DefaultInjector.java | 3 +- .../impl/engine/SubscribeMethodProcessor.java | 4 +- .../impl/cloud/DefaultServiceCallProcessor.java| 3 +- .../core/xml/AbstractCamelContextFactoryBean.java | 13 +- .../camel/builder/ErrorHandlerBuilderRef.java | 3 +- .../org/apache/camel/builder/ProxyBuilder.java | 3 +- .../org/apache/camel/builder/RouteBuilder.java | 5 +- .../camel/impl/CamelPostProcessorHelper.java | 5 +- .../camel/impl/DefaultExecutorServiceManager.java | 5 +- .../java/org/apache/camel/impl/DefaultModel.java | 3 +- .../org/apache/camel/impl/DefaultRouteContext.java | 5 +- .../apache/camel/impl/ReloadStrategySupport.java | 3 +- .../java/org/apache/camel/impl/RouteService.java | 3 +- .../java/org/apache/camel/main/MainSupport.java| 5 +- .../java/org/apache/camel/model/ModelHelper.java | 3 +- .../model/RestContextRefDefinitionHelper.java | 3 +- .../model/RouteContextRefDefinitionHelper.java | 3 +- .../apache/camel/model/RouteDefinitionHelper.java | 9 +- .../apache/camel/model/rest/RestDefinition.java| 3 +- .../java/org/apache/camel/reifier/BeanReifier.java | 3 +- .../org/apache/camel/reifier/ProcessorReifier.java | 20 +-- .../org/apache/camel/reifier/RouteReifier.java | 5 +- .../java/org/apache/camel/reifier/StepReifier.java | 3 +- .../camel/builder/ContextErrorHandlerTest.java | 3 +- .../camel/builder/ErrorHandlerBuilderRefTest.java | 3 +- .../camel/impl/BeanInjectRouteBuilderTest.java | 3 +- .../CamelContextAddRestDefinitionsFromXmlTest.java | 3 +- ...CamelContextAddRouteDefinitionsFromXmlTest.java | 3 +- .../CamelProduceInterfaceEventNotifierTest.java| 3 +- .../org/apache/camel/impl/CustomIdFactoryTest.java | 5 +- .../impl/DefaultCamelBeanPostProcessorTest.java| 3 +- .../camel/impl/model/RouteIdFactoryTest.java | 3 +- ...ScopedOnExceptionMultipleRouteBuildersTest.java | 3 +- .../issues/OnExceptionContinuedIssueTest.java | 3 +- ...ScopedOnExceptionMultipleRouteBuildersTest.java | 3 +- .../processor/CustomProcessorFactoryTest.java | 3 +- .../camel/management/DefaultManagementAgent.java | 3 +- .../camel/management/mbean/ManagedProcessor.java | 5 +- 41 files changed, 254 insertions(+), 181 deletions(-) diff --git a/core/camel-api/src/main/java/org/apache/camel/CamelContext.java b/core/camel-api/src/main/java/org/apache/camel/CamelContext.java index 5712d40..34d6caf 100644 --- a/core/camel-api/src/main/java/org/apache/camel/CamelContext.java +++ b/core/camel-api/src/main/java/org/apache/camel/CamelContext.java @@ -20,21 +20,15 @@ import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledExecutorService; -import org.apache.camel.spi.AnnotationBasedProcessorFactory; import org.apache.camel.spi.AsyncProcessorAwaitManager; -import org.apache.camel.spi.BeanProcessorFactory; -import org.apache.camel.spi.BeanProxyFactory; -import org.apache.camel.spi.CamelBeanPostProcessor; import org.apache.camel.spi.CamelContextNameStrategy; import org.apache.camel.spi.ClassResolver; import org.apache.camel.spi.DataFormat; import org.apache.camel.spi.DataFormatResolver; import org.apache.camel.spi.DataType; import org.apache.camel.spi.Debugger; -import org.apache.camel.spi.DeferServiceFactory; import org.apache.camel.spi.EndpointRegistry; import org.apache.camel.spi.EndpointStrategy; import org.apache.camel.spi.ExecutorServiceManager; @@ -47,14 +41,10 @@ import org.apache.camel.spi.InterceptStrategy; import org.apache.camel.spi.Language; import org.apache.camel.spi.LifecycleStrategy; import org.apache.camel.spi.LogListener; -import org.apache.camel.spi.ManagementMBeanAssembler; import org.apache.camel.spi.ManagementNameStrategy; import org.apache.camel.spi.ManagementStrategy; import org.apache.camel.spi.MessageHistoryFactory; -import org.apache.camel.spi.ModelJAXBContextFactory; -import org.apache.camel.spi.NodeIdFactory; import org.apache.camel.spi.PackageScanClassResolver; -import org.apache.camel.spi.ProcessorFactory; import org.apache.camel.spi.PropertiesComponent; import org.apache.camel.spi.Registry; import org.apache.camel.spi.ReloadStrategy; @@
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/33996 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] branch master updated: camel3 - Polished
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 c33bc2f camel3 - Polished c33bc2f is described below commit c33bc2f9bcc3ff520ec95c0ddbfb17df5df9fb07 Author: Claus Ibsen AuthorDate: Mon May 20 12:28:16 2019 +0200 camel3 - Polished --- .../main/java/org/apache/camel/CamelContext.java | 38 -- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/core/camel-api/src/main/java/org/apache/camel/CamelContext.java b/core/camel-api/src/main/java/org/apache/camel/CamelContext.java index 2862fc6..5712d40 100644 --- a/core/camel-api/src/main/java/org/apache/camel/CamelContext.java +++ b/core/camel-api/src/main/java/org/apache/camel/CamelContext.java @@ -463,7 +463,9 @@ public interface CamelContext extends StatefulService, RuntimeConfiguration { * Returns a new {@link Map} containing all of the endpoints from the {@link org.apache.camel.spi.EndpointRegistry} * * @return map of endpoints + * @deprecated use {@link #getEndpointRegistry()} */ +@Deprecated Map getEndpointMap(); /** @@ -520,28 +522,20 @@ public interface CamelContext extends StatefulService, RuntimeConfiguration { //--- /** - * NOTE: experimental api + * Sets a custom {@link RouteController} to use * * @param routeController the route controller */ void setRouteController(RouteController routeController); /** - * NOTE: experimental api + * Gets the {@link RouteController} * - * @return the route controller or null if not set. + * @return the route controller. */ RouteController getRouteController(); /** - * Method to signal to {@link CamelContext} that the process to initialize setup routes is in progress. - * - * @param done false to start the process, call again with true to signal its done. - * @see #isSetupRoutes() - */ -void setupRoutes(boolean done); - -/** * Sets a custom {@link org.apache.camel.spi.RestConfiguration} * * @param restConfiguration the REST configuration @@ -661,6 +655,14 @@ public interface CamelContext extends StatefulService, RuntimeConfiguration { boolean removeRoute(String routeId) throws Exception; /** + * Method to signal to {@link CamelContext} that the process to initialize setup routes is in progress. + * + * @param done false to start the process, call again with true to signal its done. + * @see #isSetupRoutes() + */ +void setupRoutes(boolean done); + +/** * Indicates whether current thread is setting up route(s) as part of starting Camel from spring/blueprint. * * This can be useful to know by {@link LifecycleStrategy} or the likes, in case @@ -802,7 +804,9 @@ public interface CamelContext extends StatefulService, RuntimeConfiguration { * Gets a readonly list with the names of the languages currently registered. * * @return a readonly list with the names of the languages + * @deprecated not in use */ +@Deprecated List getLanguageNames(); /** @@ -1085,18 +1089,18 @@ public interface CamelContext extends StatefulService, RuntimeConfiguration { ClassResolver getClassResolver(); /** - * Returns the package scanning class resolver + * Sets the class resolver to be use * - * @return the resolver + * @param resolver the resolver */ -PackageScanClassResolver getPackageScanClassResolver(); +void setClassResolver(ClassResolver resolver); /** - * Sets the class resolver to be use + * Returns the package scanning class resolver * - * @param resolver the resolver + * @return the resolver */ -void setClassResolver(ClassResolver resolver); +PackageScanClassResolver getPackageScanClassResolver(); /** * Sets the package scanning class resolver to use
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/33995 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
[camel] branch master updated: Upgrade Tika to version 1.21
This is an automated email from the ASF dual-hosted git repository. acosentino 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 2b3173c Upgrade Tika to version 1.21 2b3173c is described below commit 2b3173ca85908c29a87eed43829299b0f986da2a Author: Andrea Cosentino AuthorDate: Mon May 20 11:47:21 2019 +0200 Upgrade Tika to version 1.21 --- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent/pom.xml b/parent/pom.xml index 1117b2b..81c2c57 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -675,7 +675,7 @@ 1.11.2 6.14.2 2.1.1 -1.20 +1.21 7.9.1 4.0.7_1 4.0.7
[camel] branch master updated: CAMEL-11497 documentation Moved files from core/camel-core/src/main/docs/ to docs/user-manual/modules/ROOT/pages/ flattening the directories. Fixed the broken image in t
This is an automated email from the ASF dual-hosted git repository. zregvart 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 0dc62ea CAMEL-11497 documentation Moved files from core/camel-core/src/main/docs/ to docs/user-manual/modules/ROOT/pages/ flattening the directories. Fixed the broken image in the Controlbus Component documentation Added enterprise-integration-patterns.adoc to the navigation Added all moved files to the navigation(16 at the root & 82 in the eips), respecting their headers in the files. 0dc62ea is described below commit 0dc62ead04726f9a2eb12245f904736bd913485f Author: Fatih Pense AuthorDate: Mon May 20 00:10:26 2019 +0300 CAMEL-11497 documentation Moved files from core/camel-core/src/main/docs/ to docs/user-manual/modules/ROOT/pages/ flattening the directories. Fixed the broken image in the Controlbus Component documentation Added enterprise-integration-patterns.adoc to the navigation Added all moved files to the navigation(16 at the root & 82 in the eips), respecting their headers in the files. --- .../controlbus-component.data}/ControlBus.gif | Bin .../modules/ROOT/pages/controlbus-component.adoc | 2 +- docs/user-manual/modules/ROOT/nav.adoc | 101 + .../modules/ROOT/pages}/aggregate-eip.adoc | 0 .../modules/ROOT/pages}/batch-config-eip.adoc | 0 .../user-manual/modules/ROOT/pages}/bean-eip.adoc | 0 .../modules/ROOT/pages}/bean-language.adoc | 0 .../modules/ROOT/pages}/choice-eip.adoc| 0 .../modules/ROOT/pages}/circuitBreaker-eip.adoc| 0 .../modules/ROOT/pages}/claimCheck-eip.adoc| 0 .../modules/ROOT/pages}/clustering.adoc| 0 .../modules/ROOT/pages}/constant-language.adoc | 0 .../ROOT/pages}/content-based-router-eip.adoc | 0 .../modules/ROOT/pages}/content-filter-eip.adoc| 0 .../modules/ROOT/pages}/convertBodyTo-eip.adoc | 0 .../ROOT/pages}/correlation-identifier.adoc| 0 .../ROOT/pages}/customLoadBalancer-eip.adoc| 0 .../modules/ROOT/pages}/dead-letter-channel.adoc | 0 .../user-manual/modules/ROOT/pages}/delay-eip.adoc | 0 .../modules/ROOT/pages}/dynamic-router.adoc| 0 .../modules/ROOT/pages}/dynamicRouter-eip.adoc | 0 .../modules/ROOT/pages}/enrich-eip.adoc| 0 .../modules/ROOT/pages}/event-message.adoc | 0 .../ROOT/pages}/eventDrivenConsumer-eip.adoc | 0 .../ROOT/pages}/exchangeProperty-language.adoc | 0 .../modules/ROOT/pages}/failover-eip.adoc | 0 .../modules/ROOT/pages}/file-language.adoc | 0 .../modules/ROOT/pages}/filter-eip.adoc| 0 .../user-manual/modules/ROOT/pages}/from-eip.adoc | 0 .../modules/ROOT/pages}/guaranteed-delivery.adoc | 0 .../modules/ROOT/pages}/header-language.adoc | 0 .../modules/ROOT/pages}/health-check.adoc | 0 .../modules/ROOT/pages}/hystrix-eip.adoc | 0 .../ROOT/pages}/hystrixConfiguration-eip.adoc | 0 .../ROOT/pages}/idempotentConsumer-eip.adoc| 0 .../modules/ROOT/pages}/inOnly-eip.adoc| 0 .../user-manual/modules/ROOT/pages}/inOut-eip.adoc | 0 .../modules/ROOT/pages}/loadBalance-eip.adoc | 0 .../user-manual/modules/ROOT/pages}/log-eip.adoc | 0 .../user-manual/modules/ROOT/pages}/loop-eip.adoc | 0 .../modules/ROOT/pages}/marshal-eip.adoc | 0 .../modules/ROOT/pages}/message-bus.adoc | 0 .../modules/ROOT/pages}/message-channel.adoc | 0 .../modules/ROOT/pages}/message-endpoint.adoc | 0 .../modules/ROOT/pages}/message-router.adoc| 0 .../modules/ROOT/pages}/message-translator.adoc| 0 .../user-manual/modules/ROOT/pages}/message.adoc | 0 .../modules/ROOT/pages}/multicast-eip.adoc | 0 .../modules/ROOT/pages}/onFallback-eip.adoc| 0 .../modules/ROOT/pages}/otherwise-eip.adoc | 0 .../modules/ROOT/pages}/pipeline-eip.adoc | 0 .../ROOT/pages}/point-to-point-channel.adoc| 0 .../modules/ROOT/pages}/pollEnrich-eip.adoc| 0 .../modules/ROOT/pages}/process-eip.adoc | 0 .../ROOT/pages}/publish-subscribe-channel.adoc | 0 .../modules/ROOT/pages}/random-eip.adoc| 0 .../modules/ROOT/pages}/recipientList-eip.adoc | 0 .../modules/ROOT/pages}/ref-language.adoc | 0 .../modules/ROOT/pages}/removeHeader-eip.adoc | 0 .../modules/ROOT/pages}/removeHeaders-eip.adoc | 0 .../modules/ROOT/pages}/removeProperties-eip.adoc | 0 .../modules/ROOT/pages}/removeProperty-eip.adoc| 0 .../modules/ROOT/pages}/requestReply-eip.adoc | 0 .../modules/ROOT/pages}/resequence-eip.adoc| 0 .../user-manual/modules/ROOT/pages}/rest-dsl.adoc | 0
[camel-k] branch master updated: fix wrong log method used to log formatted content
This is an automated email from the ASF dual-hosted git repository. nferraro pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git The following commit(s) were added to refs/heads/master by this push: new 6aec40f fix wrong log method used to log formatted content 6aec40f is described below commit 6aec40fbec6f80a2034d2a7b9f26e4147d73705f Author: lburgazzoli AuthorDate: Sun May 19 18:27:06 2019 +0200 fix wrong log method used to log formatted content --- pkg/controller/build/recovery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/build/recovery.go b/pkg/controller/build/recovery.go index eea46a0..9c6d18a 100644 --- a/pkg/controller/build/recovery.go +++ b/pkg/controller/build/recovery.go @@ -106,7 +106,7 @@ func (action *errorRecoveryAction) Handle(ctx context.Context, build *v1alpha1.B target.Status.Failure.Recovery.Attempt = build.Status.Failure.Recovery.Attempt + 1 target.Status.Failure.Recovery.AttemptTime = metav1.Now() - action.L.Info("Recovery attempt (%d/%d)", + action.L.Infof("Recovery attempt (%d/%d)", target.Status.Failure.Recovery.Attempt, target.Status.Failure.Recovery.AttemptMax, )
[camel] branch master updated: Fixed micrometer NPE
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 12d5ca8 Fixed micrometer NPE 12d5ca8 is described below commit 12d5ca89c955d3b41a62b5eeb4e7d7e94e14aba1 Author: Claus Ibsen AuthorDate: Mon May 20 11:16:33 2019 +0200 Fixed micrometer NPE --- .../messagehistory/MicrometerMessageHistoryFactory.java | 8 +++- .../ExceptionRouteMicrometerMessageHistoryTest.java | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/messagehistory/MicrometerMessageHistoryFactory.java b/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/messagehistory/MicrometerMessageHistoryFactory.java index 0b56a25..eb2f582 100644 --- a/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/messagehistory/MicrometerMessageHistoryFactory.java +++ b/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/messagehistory/MicrometerMessageHistoryFactory.java @@ -24,6 +24,7 @@ import org.apache.camel.CamelContextAware; import org.apache.camel.MessageHistory; import org.apache.camel.NamedNode; import org.apache.camel.NonManagedService; +import org.apache.camel.Route; import org.apache.camel.RuntimeCamelException; import org.apache.camel.StaticService; import org.apache.camel.component.micrometer.MicrometerUtils; @@ -102,7 +103,12 @@ public class MicrometerMessageHistoryFactory extends ServiceSupport implements C @Override public MessageHistory newMessageHistory(String routeId, NamedNode namedNode, long timestamp) { -return new MicrometerMessageHistory(getMeterRegistry(), camelContext.getRoute(routeId), namedNode, getNamingStrategy(), timestamp); +Route route = camelContext.getRoute(routeId); +if (route != null) { +return new MicrometerMessageHistory(getMeterRegistry(), route, namedNode, getNamingStrategy(), timestamp); +} else { +return null; +} } @Override diff --git a/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/messagehistory/ExceptionRouteMicrometerMessageHistoryTest.java b/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/messagehistory/ExceptionRouteMicrometerMessageHistoryTest.java index c97f64b..281e286 100644 --- a/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/messagehistory/ExceptionRouteMicrometerMessageHistoryTest.java +++ b/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/messagehistory/ExceptionRouteMicrometerMessageHistoryTest.java @@ -56,7 +56,7 @@ public class ExceptionRouteMicrometerMessageHistoryTest extends CamelTestSupport assertMockEndpointsSatisfied(); // there should be 3 names -assertEquals(5, registry.getMeters().size()); +assertEquals(3, registry.getMeters().size()); // get the message history service MicrometerMessageHistoryService service = context.hasService(MicrometerMessageHistoryService.class); @@ -67,7 +67,6 @@ public class ExceptionRouteMicrometerMessageHistoryTest extends CamelTestSupport assertTrue(json.contains("\"nodeId\" : \"foo\"")); assertTrue(json.contains("\"nodeId\" : \"bar\"")); -assertTrue(json.contains("\"nodeId\" : \"exception\"")); } @Override
[camel] branch camel-2.24.x updated: CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used
This is an automated email from the ASF dual-hosted git repository. valdar pushed a commit to branch camel-2.24.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-2.24.x by this push: new d7edce1 CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used d7edce1 is described below commit d7edce1f9504d9d3a8dd147801addfef3a66aa97 Author: Andrea Tarocchi AuthorDate: Fri May 17 22:32:09 2019 +0200 CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used --- .../component/hystrix/processor/HystrixProcessorCommand.java | 10 +- .../camel/component/hystrix/processor/HystrixTimeoutTest.java | 4 ++-- .../hystrix/processor/HystrixTimeoutWithFallbackTest.java | 9 ++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java index 9275285..e2e58c8 100644 --- a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java +++ b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java @@ -117,6 +117,15 @@ public class HystrixProcessorCommand extends HystrixCommand { copy.setException(e); } +// if hystrix execution timeout is enabled and fallback is enabled and a timeout occurs +// then a hystrix timer thread executes the fallback so we can stop run() execution +if(getProperties().executionTimeoutEnabled().get() +&& getProperties().fallbackEnabled().get() +&& isCommandTimedOut.get() == TimedOutStatus.TIMED_OUT) { +LOG.debug("Exiting run command due to a hystrix execution timeout in processing exchange: {}", exchange); +return null; +} + // when a hystrix timeout occurs then a hystrix timer thread executes the fallback // and therefore we need this thread to not do anymore if fallback is already in process if (fallbackInUse.get()) { @@ -129,7 +138,6 @@ public class HystrixProcessorCommand extends HystrixCommand { Exception camelExchangeException = copy.getException(); synchronized (lock) { - // when a hystrix timeout occurs then a hystrix timer thread executes the fallback // and therefore we need this thread to not do anymore if fallback is already in process if (fallbackInUse.get()) { diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java index b36203c..00568b8 100644 --- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java +++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java @@ -40,7 +40,7 @@ public class HystrixTimeoutTest extends CamelTestSupport { // this calls the slow route and therefore causes a timeout which triggers an exception try { template.requestBody("direct:start", "slow"); -fail("Should fail due timeout"); +fail("Should fail due to timeout"); } catch (Exception e) { // expected a timeout assertIsInstanceOf(TimeoutException.class, e.getCause().getCause()); @@ -54,7 +54,7 @@ public class HystrixTimeoutTest extends CamelTestSupport { try { log.info(">>> test run " + i + " <<<"); template.requestBody("direct:start", "slow"); -fail("Should fail due timeout"); +fail("Should fail due to timeout"); } catch (Exception e) { // expected a timeout assertIsInstanceOf(TimeoutException.class, e.getCause().getCause()); diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java index 27790bb..a66b2ae 100644 --- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java +++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java @@ -30,14 +30,14 @@ public class HystrixTimeoutWithFallbackTest extends CamelTestSupport { public void testFast() throws Exception { // this calls the fast route and therefore we get a
[camel] branch camel-2.x updated: CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used
This is an automated email from the ASF dual-hosted git repository. valdar pushed a commit to branch camel-2.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-2.x by this push: new faf5ad3 CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used faf5ad3 is described below commit faf5ad3ad244e64710c9df56729e9d3d62292f6c Author: Andrea Tarocchi AuthorDate: Fri May 17 22:32:09 2019 +0200 CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used --- .../component/hystrix/processor/HystrixProcessorCommand.java | 10 +- .../camel/component/hystrix/processor/HystrixTimeoutTest.java | 4 ++-- .../hystrix/processor/HystrixTimeoutWithFallbackTest.java | 9 ++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java index 9275285..e2e58c8 100644 --- a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java +++ b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java @@ -117,6 +117,15 @@ public class HystrixProcessorCommand extends HystrixCommand { copy.setException(e); } +// if hystrix execution timeout is enabled and fallback is enabled and a timeout occurs +// then a hystrix timer thread executes the fallback so we can stop run() execution +if(getProperties().executionTimeoutEnabled().get() +&& getProperties().fallbackEnabled().get() +&& isCommandTimedOut.get() == TimedOutStatus.TIMED_OUT) { +LOG.debug("Exiting run command due to a hystrix execution timeout in processing exchange: {}", exchange); +return null; +} + // when a hystrix timeout occurs then a hystrix timer thread executes the fallback // and therefore we need this thread to not do anymore if fallback is already in process if (fallbackInUse.get()) { @@ -129,7 +138,6 @@ public class HystrixProcessorCommand extends HystrixCommand { Exception camelExchangeException = copy.getException(); synchronized (lock) { - // when a hystrix timeout occurs then a hystrix timer thread executes the fallback // and therefore we need this thread to not do anymore if fallback is already in process if (fallbackInUse.get()) { diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java index b36203c..00568b8 100644 --- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java +++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java @@ -40,7 +40,7 @@ public class HystrixTimeoutTest extends CamelTestSupport { // this calls the slow route and therefore causes a timeout which triggers an exception try { template.requestBody("direct:start", "slow"); -fail("Should fail due timeout"); +fail("Should fail due to timeout"); } catch (Exception e) { // expected a timeout assertIsInstanceOf(TimeoutException.class, e.getCause().getCause()); @@ -54,7 +54,7 @@ public class HystrixTimeoutTest extends CamelTestSupport { try { log.info(">>> test run " + i + " <<<"); template.requestBody("direct:start", "slow"); -fail("Should fail due timeout"); +fail("Should fail due to timeout"); } catch (Exception e) { // expected a timeout assertIsInstanceOf(TimeoutException.class, e.getCause().getCause()); diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java index 27790bb..a66b2ae 100644 --- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java +++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java @@ -30,14 +30,14 @@ public class HystrixTimeoutWithFallbackTest extends CamelTestSupport { public void testFast() throws Exception { // this calls the fast route and therefore we get a response
[camel] branch camel-2.23.x updated: CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used
This is an automated email from the ASF dual-hosted git repository. valdar pushed a commit to branch camel-2.23.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-2.23.x by this push: new d043425 CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used d043425 is described below commit d04342509c5a112b6c3dd21fc5e8080fc6343810 Author: Andrea Tarocchi AuthorDate: Fri May 17 22:32:09 2019 +0200 CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used --- .../component/hystrix/processor/HystrixProcessorCommand.java | 10 +- .../camel/component/hystrix/processor/HystrixTimeoutTest.java | 4 ++-- .../hystrix/processor/HystrixTimeoutWithFallbackTest.java | 9 ++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java index 9275285..e2e58c8 100644 --- a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java +++ b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java @@ -117,6 +117,15 @@ public class HystrixProcessorCommand extends HystrixCommand { copy.setException(e); } +// if hystrix execution timeout is enabled and fallback is enabled and a timeout occurs +// then a hystrix timer thread executes the fallback so we can stop run() execution +if(getProperties().executionTimeoutEnabled().get() +&& getProperties().fallbackEnabled().get() +&& isCommandTimedOut.get() == TimedOutStatus.TIMED_OUT) { +LOG.debug("Exiting run command due to a hystrix execution timeout in processing exchange: {}", exchange); +return null; +} + // when a hystrix timeout occurs then a hystrix timer thread executes the fallback // and therefore we need this thread to not do anymore if fallback is already in process if (fallbackInUse.get()) { @@ -129,7 +138,6 @@ public class HystrixProcessorCommand extends HystrixCommand { Exception camelExchangeException = copy.getException(); synchronized (lock) { - // when a hystrix timeout occurs then a hystrix timer thread executes the fallback // and therefore we need this thread to not do anymore if fallback is already in process if (fallbackInUse.get()) { diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java index b36203c..00568b8 100644 --- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java +++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java @@ -40,7 +40,7 @@ public class HystrixTimeoutTest extends CamelTestSupport { // this calls the slow route and therefore causes a timeout which triggers an exception try { template.requestBody("direct:start", "slow"); -fail("Should fail due timeout"); +fail("Should fail due to timeout"); } catch (Exception e) { // expected a timeout assertIsInstanceOf(TimeoutException.class, e.getCause().getCause()); @@ -54,7 +54,7 @@ public class HystrixTimeoutTest extends CamelTestSupport { try { log.info(">>> test run " + i + " <<<"); template.requestBody("direct:start", "slow"); -fail("Should fail due timeout"); +fail("Should fail due to timeout"); } catch (Exception e) { // expected a timeout assertIsInstanceOf(TimeoutException.class, e.getCause().getCause()); diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java index 27790bb..a66b2ae 100644 --- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java +++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java @@ -30,14 +30,14 @@ public class HystrixTimeoutWithFallbackTest extends CamelTestSupport { public void testFast() throws Exception { // this calls the fast route and therefore we get a
[camel] branch master updated: Upgrade Zipkin to version 2.14.0
This is an automated email from the ASF dual-hosted git repository. acosentino 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 27d1af9 Upgrade Zipkin to version 2.14.0 27d1af9 is described below commit 27d1af9a62090aeae57b966abbef540671d68a94 Author: Andrea Cosentino AuthorDate: Mon May 20 10:05:12 2019 +0200 Upgrade Zipkin to version 2.14.0 --- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent/pom.xml b/parent/pom.xml index 19d62a9..1117b2b 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -726,7 +726,7 @@ 1.2.5 0.6.2 2.8.2 -2.13.0 +2.14.0 0.3.0 3.4.13 16.0
[camel] branch master updated: CAMEL-13545: fix netty4-http memory issues
This is an automated email from the ASF dual-hosted git repository. acosentino 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 4094279 CAMEL-13545: fix netty4-http memory issues new 9bf74a5 Merge pull request #2929 from zregvart/CAMEL-13545 4094279 is described below commit 409427932593ac2003a487435fe9cd9682326b2b Author: Zoran Regvart AuthorDate: Sun May 19 19:38:54 2019 +0200 CAMEL-13545: fix netty4-http memory issues `DefaultNettyHttpBinding::toNettyRequest` could allocate a new Netty `ByteBuf` (e.g. via `NettyConverter::toByteBuffer`) which in turn might or might not be passed to the `FullHttpRequest` depending on the resulting buffer size: if it's 0 it will not be set as content of the request. In that case this causes a memory leak. The buffer having the size of 0 is quite common for `GET` or `OPTIONS` HTTP method requests, so releasing the buffer if the incoming request is received when acting as a proxy will cause the any downstream Netty requests (say in a scenario `from("netty-http:proxy:...").toD("netty-http:...")`) to block. So additional optimization was added to store the proxy HTTP request in the `Exchange` property and to check if the current request in the `NettyHttpMessage` has the same reference; and in that case the proxy HTTP request will be reused, only changes to the HTTP method, protocol or request URL will be applied. --- .../netty4/http/DefaultNettyHttpBinding.java | 81 +++--- .../component/netty4/http/NettyHttpConstants.java | 1 + .../http/handlers/HttpServerChannelHandler.java| 2 + 3 files changed, 59 insertions(+), 25 deletions(-) diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java index a626c0e..e51f65f 100644 --- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java +++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java @@ -509,37 +509,68 @@ public class DefaultNettyHttpBinding implements NettyHttpBinding, Cloneable { httpMethod = HttpMethod.valueOf(headerMethod); } -FullHttpRequest request = new DefaultFullHttpRequest(protocol, httpMethod, uriForRequest); -if (body != null) { -// support bodies as native Netty -ByteBuf buffer; -if (body instanceof ByteBuf) { -buffer = (ByteBuf) body; -} else { -// try to convert to buffer first -buffer = message.getBody(ByteBuf.class); -if (buffer == null) { -// fallback to byte array as last resort -byte[] data = message.getMandatoryBody(byte[].class); - -if (data.length > 0) { -buffer = NettyConverter.toByteBuffer(data); +final Exchange exchange = message.getExchange(); +final Object proxyRequest; +if (exchange != null) { +proxyRequest = exchange.getProperty(NettyHttpConstants.PROXY_REQUEST); +} else { +proxyRequest = null; +} + +FullHttpRequest request = null; +if (message instanceof NettyHttpMessage) { +// if the request is already given we should set the values +// from message headers and pass on the same request +final FullHttpRequest givenRequest = ((NettyHttpMessage) message).getHttpRequest(); +// we need to make sure that the givenRequest is the original +// request received by the proxy +if (givenRequest != null && proxyRequest == givenRequest) { +request = givenRequest +.setProtocolVersion(protocol) +.setMethod(httpMethod) +.setUri(uriForRequest); +} +} + +if (request == null) { +request = new DefaultFullHttpRequest(protocol, httpMethod, uriForRequest); + +if (body != null) { +// support bodies as native Netty +ByteBuf buffer; +if (body instanceof ByteBuf) { +buffer = (ByteBuf) body; +} else { +// try to convert to buffer first +buffer = message.getBody(ByteBuf.class); +if (buffer == null) { +// fallback to byte array as last resort +byte[] data = message.getMandatoryBody(byte[].class); + +if (data.length > 0) { +
[camel] 01/02: CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git commit 650466734eedbeb61cbb4e98a6c269ab4e541d1e Author: Andrea Tarocchi AuthorDate: Fri May 17 22:32:09 2019 +0200 CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used --- .../component/hystrix/processor/HystrixProcessorCommand.java | 10 +- .../camel/component/hystrix/processor/HystrixTimeoutTest.java | 4 ++-- .../hystrix/processor/HystrixTimeoutWithFallbackTest.java | 9 ++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java index e8aa26c..94289ff 100644 --- a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java +++ b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java @@ -117,6 +117,15 @@ public class HystrixProcessorCommand extends HystrixCommand { copy.setException(e); } +// if hystrix execution timeout is enabled and fallback is enabled and a timeout occurs +// then a hystrix timer thread executes the fallback so we can stop run() execution +if(getProperties().executionTimeoutEnabled().get() +&& getProperties().fallbackEnabled().get() +&& isCommandTimedOut.get() == TimedOutStatus.TIMED_OUT) { +LOG.debug("Exiting run command due to a hystrix execution timeout in processing exchange: {}", exchange); +return null; +} + // when a hystrix timeout occurs then a hystrix timer thread executes the fallback // and therefore we need this thread to not do anymore if fallback is already in process if (fallbackInUse.get()) { @@ -129,7 +138,6 @@ public class HystrixProcessorCommand extends HystrixCommand { Exception camelExchangeException = copy.getException(); synchronized (lock) { - // when a hystrix timeout occurs then a hystrix timer thread executes the fallback // and therefore we need this thread to not do anymore if fallback is already in process if (fallbackInUse.get()) { diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java index d0ebdb6..7e78057 100644 --- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java +++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutTest.java @@ -40,7 +40,7 @@ public class HystrixTimeoutTest extends CamelTestSupport { // this calls the slow route and therefore causes a timeout which triggers an exception try { template.requestBody("direct:start", "slow"); -fail("Should fail due timeout"); +fail("Should fail due to timeout"); } catch (Exception e) { // expected a timeout assertIsInstanceOf(TimeoutException.class, e.getCause().getCause()); @@ -54,7 +54,7 @@ public class HystrixTimeoutTest extends CamelTestSupport { try { log.info(">>> test run " + i + " <<<"); template.requestBody("direct:start", "slow"); -fail("Should fail due timeout"); +fail("Should fail due to timeout"); } catch (Exception e) { // expected a timeout assertIsInstanceOf(TimeoutException.class, e.getCause().getCause()); diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java index ee9ebe9..dfaae57 100644 --- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java +++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixTimeoutWithFallbackTest.java @@ -30,14 +30,14 @@ public class HystrixTimeoutWithFallbackTest extends CamelTestSupport { public void testFast() throws Exception { // this calls the fast route and therefore we get a response Object out = template.requestBody("direct:start", "fast"); -assertEquals("Fast response", out); +assertEquals("LAST CHANGE", out); } @Test public void testSlow() throws Exception { //
[camel] branch master updated (7b2f54a -> 34eeb10)
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel.git. from 7b2f54a Add first version to pulsar new 6504667 CAMEL-13541: fixed Race condition in camel-hystrix when xecutionTimeoutInMilliseconds() and onFallback() are used new 34eeb10 CAMEL-13541 - Fixed CS The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../component/hystrix/processor/HystrixProcessorCommand.java | 10 +- .../camel/component/hystrix/processor/HystrixTimeoutTest.java | 4 ++-- .../hystrix/processor/HystrixTimeoutWithFallbackTest.java | 9 ++--- 3 files changed, 17 insertions(+), 6 deletions(-)
[camel] 02/02: CAMEL-13541 - Fixed CS
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git commit 34eeb10d1a4e12cc20b20ddda471043e777d42a4 Author: Andrea Cosentino AuthorDate: Mon May 20 08:58:39 2019 +0200 CAMEL-13541 - Fixed CS --- .../camel/component/hystrix/processor/HystrixProcessorCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java index 94289ff..efa9c9b 100644 --- a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java +++ b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java @@ -119,7 +119,7 @@ public class HystrixProcessorCommand extends HystrixCommand { // if hystrix execution timeout is enabled and fallback is enabled and a timeout occurs // then a hystrix timer thread executes the fallback so we can stop run() execution -if(getProperties().executionTimeoutEnabled().get() +if (getProperties().executionTimeoutEnabled().get() && getProperties().fallbackEnabled().get() && isCommandTimedOut.get() == TimedOutStatus.TIMED_OUT) { LOG.debug("Exiting run command due to a hystrix execution timeout in processing exchange: {}", exchange);