[camel-k-runtime] 02/03: loaders(quarkus): consistent test class naming
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git commit bc124ee7418cfaceea10342144bca9e29c64ea9f Author: lburgazzoli AuthorDate: Wed Aug 19 17:18:43 2020 +0200 loaders(quarkus): consistent test class naming --- .../camel/k/core/quarkus/deployment/{ExtensionIT.java => CoreIT.java} | 2 +- .../k/core/quarkus/deployment/{ExtensionTest.java => CoreTest.java} | 2 +- .../camel/k/quarkus/cron/deployment/{ExtensionIT.java => CronIT.java} | 2 +- .../k/quarkus/cron/deployment/{ExtensionTest.java => CronTest.java} | 2 +- .../k/quarkus/knative/deployment/{ExtensionIT.java => KnativeIT.java} | 2 +- .../knative/deployment/{ExtensionTest.java => KnativeTest.java} | 2 +- .../loader/yaml/quarkus/{ExtensionTest.java => GroovyLoaderTest.java} | 4 ++-- .../k/loader/java/java/{ExtensionTest.java => JavaLoaderTest.java}| 4 ++-- .../k/loader/js/quarkus/{ExtensionIT.java => JavaScriptLoaderIT.java} | 2 +- .../js/quarkus/{ExtensionTest.java => JavaScriptLoaderTest.java} | 4 ++-- .../camel/k/loader/xml/quarkus/{ExtensionIT.java => XmlLoaderIT.java} | 2 +- .../k/loader/xml/quarkus/{ExtensionTest.java => XmlLoaderTest.java} | 4 ++-- .../k/loader/yaml/quarkus/{ExtensionIT.java => YamlLoaderIT.java} | 2 +- .../k/loader/yaml/quarkus/{ExtensionTest.java => YamlLoaderTest.java} | 4 ++-- .../k/itests/polyglot/quarkus/{ExtensionIT.java => PolyglotIT.java} | 2 +- .../itests/polyglot/quarkus/{ExtensionTest.java => PolyglotTest.java} | 4 ++-- 16 files changed, 22 insertions(+), 22 deletions(-) diff --git a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/ExtensionIT.java b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/CoreIT.java similarity index 94% rename from camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/ExtensionIT.java rename to camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/CoreIT.java index 5b75cc4..0f7c614 100644 --- a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/ExtensionIT.java +++ b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/CoreIT.java @@ -19,5 +19,5 @@ package org.apache.camel.k.core.quarkus.deployment; import io.quarkus.test.junit.NativeImageTest; @NativeImageTest -public class ExtensionIT extends ExtensionTest { +public class CoreIT extends CoreTest { } \ No newline at end of file diff --git a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/ExtensionTest.java b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/CoreTest.java similarity index 98% rename from camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/ExtensionTest.java rename to camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/CoreTest.java index bbf417c..3ac5bf2 100644 --- a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/ExtensionTest.java +++ b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/test/java/org/apache/camel/k/core/quarkus/deployment/CoreTest.java @@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.is; @QuarkusTest -public class ExtensionTest { +public class CoreTest { @Test public void testServices() { JsonPath p = RestAssured.given() diff --git a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-cron/src/test/java/org/apache/camel/k/quarkus/cron/deployment/ExtensionIT.java b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-cron/src/test/java/org/apache/camel/k/quarkus/cron/deployment/CronIT.java similarity index 94% rename from camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-cron/src/test/java/org/apache/camel/k/quarkus/cron/deployment/ExtensionIT.java rename to camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-cron/src/test/java/org/apache/camel/k/quarkus/cron/deployment/CronIT.java index 9039b12..ea435b8 100644 --- a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-cron/src/test/java/org/apache/camel/k/quarkus/cron/deployment/ExtensionIT.java +++ b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-ites
[camel-k-runtime] branch master updated: kotlin: cleanup loader and tests
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 3706645 kotlin: cleanup loader and tests 3706645 is described below commit 37066451dfa2519aaa80d0a597c209161ccce9fd Author: lburgazzoli AuthorDate: Wed Aug 19 16:38:56 2020 +0200 kotlin: cleanup loader and tests --- ...LoaderTest.java => KotlinSourceLoaderTest.java} | 2 +- .../k/loader/kotlin/KotlinSourceLoaderTest.kt | 176 + .../org/apache/camel/k/loader/kotlin/LoaderTest.kt | 97 .../camel/k/loader/kotlin/dsl/IntegrationTest.kt | 166 --- .../camel/k/loader/kotlin/support/TestRuntime.kt | 73 + 5 files changed, 250 insertions(+), 264 deletions(-) diff --git a/camel-k-loader-kotlin/camel-k-loader-kotlin-itests/src/test/java/org/apache/camel/k/loader/kotlin/itests/LoaderTest.java b/camel-k-loader-kotlin/camel-k-loader-kotlin-itests/src/test/java/org/apache/camel/k/loader/kotlin/itests/KotlinSourceLoaderTest.java similarity index 97% rename from camel-k-loader-kotlin/camel-k-loader-kotlin-itests/src/test/java/org/apache/camel/k/loader/kotlin/itests/LoaderTest.java rename to camel-k-loader-kotlin/camel-k-loader-kotlin-itests/src/test/java/org/apache/camel/k/loader/kotlin/itests/KotlinSourceLoaderTest.java index bc25de7..b0b5f0a 100644 --- a/camel-k-loader-kotlin/camel-k-loader-kotlin-itests/src/test/java/org/apache/camel/k/loader/kotlin/itests/LoaderTest.java +++ b/camel-k-loader-kotlin/camel-k-loader-kotlin-itests/src/test/java/org/apache/camel/k/loader/kotlin/itests/KotlinSourceLoaderTest.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; -public class LoaderTest { +public class KotlinSourceLoaderTest { @Test public void testLoad() throws Exception { final CamelContext context = new DefaultCamelContext(); diff --git a/camel-k-loader-kotlin/camel-k-loader-kotlin/src/test/kotlin/org/apache/camel/k/loader/kotlin/KotlinSourceLoaderTest.kt b/camel-k-loader-kotlin/camel-k-loader-kotlin/src/test/kotlin/org/apache/camel/k/loader/kotlin/KotlinSourceLoaderTest.kt new file mode 100644 index 000..441c038 --- /dev/null +++ b/camel-k-loader-kotlin/camel-k-loader-kotlin/src/test/kotlin/org/apache/camel/k/loader/kotlin/KotlinSourceLoaderTest.kt @@ -0,0 +1,176 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.k.loader.kotlin + +import org.apache.camel.Predicate +import org.apache.camel.Processor +import org.apache.camel.RuntimeCamelException +import org.apache.camel.component.jackson.JacksonDataFormat +import org.apache.camel.component.log.LogComponent +import org.apache.camel.component.seda.SedaComponent +import org.apache.camel.k.loader.kotlin.support.TestRuntime +import org.apache.camel.language.bean.BeanLanguage +import org.apache.camel.model.ProcessDefinition +import org.apache.camel.model.ToDefinition +import org.apache.camel.model.rest.GetVerbDefinition +import org.apache.camel.model.rest.PostVerbDefinition +import org.apache.camel.processor.FatalFallbackErrorHandler +import org.apache.camel.support.DefaultHeaderFilterStrategy +import org.assertj.core.api.Assertions +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import javax.sql.DataSource + +class KotlinSourceLoaderTest { + +@Test +fun `load routes`() { +val runtime = TestRuntime() +runtime.loadRoutes("classpath:routes.kts") + +val routes = runtime.context.routeDefinitions +assertThat(routes).hasSize(1) +assertThat(routes[0].input.endpointUri).isEqualTo("timer:tick") + assertThat(routes[0].outputs[0]).isInstanceOf(ProcessDefinition::class.java) +assertThat(routes[0].outputs[1]).isInstanceOf(ToDefinition::class.java) +} + +@Test +fun `load routes with endpoint dsl`() { +val runtime = TestRuntime() +runtime.loadRoutes("classpath:rout
[camel-k-runtime] branch master updated: xml: cleanup loader and tests
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new dbd3cf2 xml: cleanup loader and tests dbd3cf2 is described below commit dbd3cf2961a975422e6290f64cc17bc3a6f6e0b0 Author: lburgazzoli AuthorDate: Wed Aug 19 15:34:21 2020 +0200 xml: cleanup loader and tests --- camel-k-loader-xml/pom.xml | 18 .../camel/k/loader/xml/XmlSourceLoaderTest.groovy | 48 ++ .../camel/k/loader/xml/support/TestRuntime.groovy | 78 .../camel/k/loader/xml/RoutesLoaderTest.java | 102 - 4 files changed, 144 insertions(+), 102 deletions(-) diff --git a/camel-k-loader-xml/pom.xml b/camel-k-loader-xml/pom.xml index 9a2565d..bbd7e4f 100644 --- a/camel-k-loader-xml/pom.xml +++ b/camel-k-loader-xml/pom.xml @@ -107,6 +107,24 @@ +org.codehaus.gmavenplus +gmavenplus-plugin +${gmavenplus-plugin.version} + + + +addSources +addTestSources +compile +compileTests + + + + +true + + + org.jboss.jandex jandex-maven-plugin diff --git a/camel-k-loader-xml/src/test/groovy/org/apache/camel/k/loader/xml/XmlSourceLoaderTest.groovy b/camel-k-loader-xml/src/test/groovy/org/apache/camel/k/loader/xml/XmlSourceLoaderTest.groovy new file mode 100644 index 000..a3eadd0 --- /dev/null +++ b/camel-k-loader-xml/src/test/groovy/org/apache/camel/k/loader/xml/XmlSourceLoaderTest.groovy @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.k.loader.xml + +import org.apache.camel.k.loader.xml.support.TestRuntime +import org.apache.camel.model.ToDefinition +import spock.lang.AutoCleanup +import spock.lang.Specification + +class XmlSourceLoaderTest extends Specification { +@AutoCleanup +def runtime = new TestRuntime() + +def 'load routes'() { +when: +runtime.loadRoutes('classpath:routes.xml') +then: +with(runtime.context.routeDefinitions) { +it[0].input.endpointUri ==~ /timer:.*tick/ +it[0].outputs[0] instanceof ToDefinition +} + +} + +def 'load rests'() { +when: +runtime.loadRoutes('classpath:rests.xml') +then: +with(runtime.context.restDefinitions) { +size() == 1 +} + +} +} diff --git a/camel-k-loader-xml/src/test/groovy/org/apache/camel/k/loader/xml/support/TestRuntime.groovy b/camel-k-loader-xml/src/test/groovy/org/apache/camel/k/loader/xml/support/TestRuntime.groovy new file mode 100644 index 000..b62e678 --- /dev/null +++ b/camel-k-loader-xml/src/test/groovy/org/apache/camel/k/loader/xml/support/TestRuntime.groovy @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.a
[camel-k-runtime] branch master updated: js: cleanup loader and tests
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 75ca3c0 js: cleanup loader and tests 75ca3c0 is described below commit 75ca3c0d44facd8237cab0e0e4b102e0c3a65a99 Author: lburgazzoli AuthorDate: Wed Aug 19 14:49:54 2020 +0200 js: cleanup loader and tests --- camel-k-loader-js/pom.xml | 18 +++ .../k/loader/js/JavaScriptSourceLoaderTest.groovy | 105 .../camel/k/loader/js/support/TestRuntime.groovy | 78 .../apache/camel/k/loader/js/RoutesLoaderTest.java | 95 -- .../camel/k/loader/js/dsl/IntegrationTest.java | 139 - 5 files changed, 201 insertions(+), 234 deletions(-) diff --git a/camel-k-loader-js/pom.xml b/camel-k-loader-js/pom.xml index 540ed2d..ff1b0c3 100644 --- a/camel-k-loader-js/pom.xml +++ b/camel-k-loader-js/pom.xml @@ -110,6 +110,24 @@ +org.codehaus.gmavenplus +gmavenplus-plugin +${gmavenplus-plugin.version} + + + +addSources +addTestSources +compile +compileTests + + + + +true + + + org.jboss.jandex jandex-maven-plugin diff --git a/camel-k-loader-js/src/test/groovy/org/apache/camel/k/loader/js/JavaScriptSourceLoaderTest.groovy b/camel-k-loader-js/src/test/groovy/org/apache/camel/k/loader/js/JavaScriptSourceLoaderTest.groovy new file mode 100644 index 000..1d71575 --- /dev/null +++ b/camel-k-loader-js/src/test/groovy/org/apache/camel/k/loader/js/JavaScriptSourceLoaderTest.groovy @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.k.loader.js + +import org.apache.camel.component.seda.SedaComponent +import org.apache.camel.k.loader.js.support.TestRuntime +import org.apache.camel.model.FromDefinition +import org.apache.camel.model.ToDefinition +import org.apache.camel.model.TransformDefinition +import org.apache.camel.model.rest.GetVerbDefinition +import spock.lang.AutoCleanup +import spock.lang.Specification + +class JavaScriptSourceLoaderTest extends Specification { +@AutoCleanup +def runtime = new TestRuntime() + +def 'load'(location) { +expect: +runtime.loadRoutes(location) + +with(runtime.context.routeDefinitions) { +it[0].input.endpointUri ==~ /timer:.*tick/ +it[0].outputs[0] instanceof ToDefinition +} +where: +location << [ +'classpath:routes.js', +'classpath:routes-with-endpoint-dsl.js', + 'classpath:routes-compressed.js.gz.b64?language=js&compression=true', +'classpath:routes.mytype?language=js' +] + +} + +def 'load routes with component configuration'() { +when: + runtime.loadRoutes('classpath:routes-with-component-configuration.js') +then: +with(runtime.context.getComponent('seda', SedaComponent.class)) { +queueSize == 1234 +} +} + +def 'load routes with rest configuration'() { +when: +runtime.loadRoutes('classpath:routes-with-rest-configuration.js') +then: +with(runtime.context.restConfiguration) { +component == 'undertow' +port == 1234 +} +} + +def 'load routes with rest dsl'() { +when: +runtime.loadRoutes('classpath:routes-with-rest-dsl.js') +then: +
[camel-k-runtime] branch master updated: Update groovy.adoc
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 3b8c064 Update groovy.adoc 3b8c064 is described below commit 3b8c0646d20812a8b20e9a0fd8062b7061499a08 Author: PoojaChandak AuthorDate: Wed Aug 19 18:29:59 2020 +0530 Update groovy.adoc Observed a few changes. Suggesting the same. Kindly check. --- docs/modules/languages/pages/groovy.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/languages/pages/groovy.adoc b/docs/modules/languages/pages/groovy.adoc index 5232b6b..0e9b75d 100644 --- a/docs/modules/languages/pages/groovy.adoc +++ b/docs/modules/languages/pages/groovy.adoc @@ -56,7 +56,7 @@ camel { <2> configure the properties of the component whit name _log_ <3> creates and configure a component of type `SedaComponent` whose name is _mySeda_ + -Setting the property _exchangeFormatter_ looks a little ugly as you have to declare the type of your closure. For demonstration purpose we have created a Groovy extension module that simplify configuring the _exchangeFormatter_ so you can rewrite your DSL as +Setting the property _exchangeFormatter_ looks a little ugly as you have to declare the type of your closure. For demonstration purpose, we have created a Groovy extension module that simplifies configuring the _exchangeFormatter_ so you can rewrite your DSL as + [source,groovy]
[camel-k-runtime] branch master updated: java: cleanup loader and tests
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 33fcf5c java: cleanup loader and tests 33fcf5c is described below commit 33fcf5c9e1b99f1ddb920d10fce2c54d8302081e Author: lburgazzoli AuthorDate: Wed Aug 19 13:54:28 2020 +0200 java: cleanup loader and tests --- camel-k-loader-groovy/pom.xml | 23 --- camel-k-loader-java/pom.xml| 18 ++ .../k/loader/java/JavaSourceLoaderTest.groovy | 98 +++ .../camel/k/loader/java/model/EmployeeDTO.groovy} | 35 +--- .../camel/k/loader/java/support/TestRuntime.groovy | 75 .../camel/k/loader/java/RoutesLoaderTest.java | 191 - .../src/main/java/org/apache/camel/k/Runtime.java | 7 +- tooling/camel-k-test/pom.xml | 16 ++ 8 files changed, 220 insertions(+), 243 deletions(-) diff --git a/camel-k-loader-groovy/pom.xml b/camel-k-loader-groovy/pom.xml index 5fe3c55..41a1daa 100644 --- a/camel-k-loader-groovy/pom.xml +++ b/camel-k-loader-groovy/pom.xml @@ -76,12 +76,6 @@ org.apache.camel.k camel-k-test test - - -org.codehaus.groovy -* - - org.apache.camel @@ -120,23 +114,6 @@ -org.spockframework -spock-core -${spock.version} -test - - -org.codehaus.groovy -* - - -junit -* - - - - - org.apache.commons commons-dbcp2 ${commons-dbcp2.version} diff --git a/camel-k-loader-java/pom.xml b/camel-k-loader-java/pom.xml index c280a7c..fe2fda1 100644 --- a/camel-k-loader-java/pom.xml +++ b/camel-k-loader-java/pom.xml @@ -110,6 +110,24 @@ +org.codehaus.gmavenplus +gmavenplus-plugin +${gmavenplus-plugin.version} + + + +addSources +addTestSources +compile +compileTests + + + + +true + + + org.jboss.jandex jandex-maven-plugin diff --git a/camel-k-loader-java/src/test/groovy/org/apache/camel/k/loader/java/JavaSourceLoaderTest.groovy b/camel-k-loader-java/src/test/groovy/org/apache/camel/k/loader/java/JavaSourceLoaderTest.groovy new file mode 100644 index 000..2b868f8 --- /dev/null +++ b/camel-k-loader-java/src/test/groovy/org/apache/camel/k/loader/java/JavaSourceLoaderTest.groovy @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.k.loader.java + + +import org.apache.camel.k.loader.java.model.EmployeeDTO +import org.apache.camel.k.loader.java.support.TestRuntime +import org.apache.camel.model.ProcessDefinition +import org.apache.camel.model.SetBodyDefinition +import org.apache.camel.model.ToDefinition +import spock.lang.AutoCleanup +import spock.lang.Specification + +class JavaSourceLoaderTest extends Specification { +@AutoCleanup +def runtime = new TestRuntime() + +def "load routes with nested class"() { +when: +runtime.loadRoutes("classpath:MyRoutesWithNestedClass.java") +then: +with(runtime.context.routeDefinitions) { +it.size() == 1 + +it[0].outputs[0] instanceof SetBodyDefinition +it[0].outputs[1] instanceof ProcessDefinition +it[0].outputs[2] instanceof ToDefinition + +
[camel-quarkus] 05/05: Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit f1bbe512576d3c924553ec8411639c90151e91ff Author: lburgazzoli AuthorDate: Tue Aug 18 15:49:17 2020 +0200 Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538 --- .../org/apache/camel/quarkus/component/http/it/HttpResource.java| 6 +++--- .../java/org/apache/camel/quarkus/component/http/it/HttpTest.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java index 181930b..dcb7616 100644 --- a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java +++ b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java @@ -60,7 +60,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String getHttps() { return producerTemplate - .to("ahc:https://restcountries.eu/rest/v2/alpha/cz?bridgeEndpoint=true";) + .to("ahc:https://restcountries.com/v2/alpha/cz?bridgeEndpoint=true";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } @@ -117,7 +117,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String httpGetHttps() { return producerTemplate - .to("https://restcountries.eu/rest/v2/alpha/cz?bridgeEndpoint=true";) + .to("https://restcountries.com/v2/alpha/cz?bridgeEndpoint=true";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } @@ -156,7 +156,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String nettyHttpGetHttps() { return producerTemplate - .to("netty-http:https://restcountries.eu/rest/v2/alpha/cz?ssl=true&passphrase=changeit&keyStoreResource=classpath:jsse/keystore.p12&trustStoreResource=file:{{javax.net.ssl.trustStore}}";) + .to("netty-http:https://restcountries.com/v2/alpha/cz?ssl=true&passphrase=changeit&keyStoreResource=classpath:jsse/keystore.p12&trustStoreResource=file:{{javax.net.ssl.trustStore}}";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } diff --git a/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java b/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java index a1f7d48..a730a72 100644 --- a/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java +++ b/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java @@ -68,11 +68,11 @@ class HttpTest { public void restcountries() throws Exception { RestAssured .given() -.baseUri("https://restcountries.eu";) +.baseUri("https://restcountries.com";) .port(443) .when() .accept("application/json") -.get("/rest/v2/alpha/cz") +.get("/v2/alpha/cz") .then() .statusCode(200) .body(containsString("Czech Republic"));
[camel-quarkus] 02/05: Upgarde to camel v3.4.3 (fix MainShutdownStrategy)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit 6db3edeecb027d5dc26175c22de7d6034803c7b5 Author: lburgazzoli AuthorDate: Wed Aug 12 13:30:41 2020 +0200 Upgarde to camel v3.4.3 (fix MainShutdownStrategy) --- .../org/apache/camel/quarkus/main/CamelMain.java | 53 ++ 1 file changed, 5 insertions(+), 48 deletions(-) diff --git a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java index 7e71a52..ab75ad5 100644 --- a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java +++ b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java @@ -18,8 +18,6 @@ package org.apache.camel.quarkus.main; import java.util.Collection; import java.util.Collections; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import io.quarkus.runtime.Quarkus; @@ -31,6 +29,7 @@ import org.apache.camel.main.MainCommandLineSupport; import org.apache.camel.main.MainConfigurationProperties; import org.apache.camel.main.MainListener; import org.apache.camel.main.MainShutdownStrategy; +import org.apache.camel.main.SimpleMainShutdownStrategy; import org.apache.camel.spi.CamelBeanPostProcessor; import org.apache.camel.spi.HasCamelContext; import org.apache.camel.support.service.ServiceHelper; @@ -59,7 +58,10 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC @Override protected void doInit() throws Exception { -setShutdownStrategy(new ShutdownStrategy()); +MainShutdownStrategy shutdownStrategy = new SimpleMainShutdownStrategy(); +shutdownStrategy.addShutdownListener(() -> Quarkus.asyncExit(getExitCode())); + +setShutdownStrategy(shutdownStrategy); super.doInit(); initCamelContext(); @@ -148,49 +150,4 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC parseArguments(args); runEngine(); } - -/** - * Implementation of a {@link MainShutdownStrategy} based on Quarkus Command Mode. - * - * @see https://quarkus.io/guides/command-mode-reference";>Quarkus Command Mode Applications - */ -private class ShutdownStrategy implements MainShutdownStrategy { -private final AtomicBoolean completed; -private final CountDownLatch latch; - -public ShutdownStrategy() { -this.completed = new AtomicBoolean(false); -this.latch = new CountDownLatch(1); -} - -@Override -public boolean isRunAllowed() { -return !completed.get(); -} - -@Override -public boolean shutdown() { -if (completed.compareAndSet(false, true)) { -latch.countDown(); -Quarkus.asyncExit(getExitCode()); -return true; -} - -return false; -} - -@Override -public void await() throws InterruptedException { -latch.await(); -} - -@Override -public void await(long timeout, TimeUnit unit) throws InterruptedException { -if (!latch.await(timeout, unit)) { -LOGGER.warn( -"Could not await stopping CamelMain within {} {}. You may want to increase camel.main.shutdown.timeout", -timeout, unit); -} -} -} }
[camel-quarkus] branch 1.0.x updated (efdac19 -> f1bbe51)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git. from efdac19 Fixup 1.0.0 Qute component metadata new d23f5c1 Upgarde to camel v3.4.3 new 6db3ede Upgarde to camel v3.4.3 (fix MainShutdownStrategy) new ebb0987 chore(build): configure ci to run on release rbanches new 9d7bbe5 Regen new f1bbe51 Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538 The 5 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: .github/workflows/ci-build.yaml| 2 + .github/workflows/pr-validate.yml | 1 + .../org/apache/camel/quarkus/main/CamelMain.java | 53 ++ .../org/apache/camel/component/qute/qute.json | 2 +- .../quarkus/component/http/it/HttpResource.java| 6 +-- .../camel/quarkus/component/http/it/HttpTest.java | 4 +- pom.xml| 3 +- 7 files changed, 15 insertions(+), 56 deletions(-)
[camel-quarkus] 03/05: chore(build): configure ci to run on release rbanches
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit ebb098794c613f56009cbf74c7447286d8240f65 Author: lburgazzoli AuthorDate: Tue Aug 18 09:39:13 2020 +0200 chore(build): configure ci to run on release rbanches --- .github/workflows/ci-build.yaml | 2 ++ .github/workflows/pr-validate.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index ee98ab8..d7f4273 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -23,6 +23,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS' @@ -33,6 +34,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS' diff --git a/.github/workflows/pr-validate.yml b/.github/workflows/pr-validate.yml index a3a3667..bc9b847 100644 --- a/.github/workflows/pr-validate.yml +++ b/.github/workflows/pr-validate.yml @@ -23,6 +23,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS'
[camel-quarkus] 01/05: Upgarde to camel v3.4.3
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit d23f5c1d835d767d0146d84216099108645d2f16 Author: lburgazzoli AuthorDate: Wed Aug 12 12:34:17 2020 +0200 Upgarde to camel v3.4.3 --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f687cc2..c65d485 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ 1.11.714 1.11.22 2.13.33 -3.4.2 +3.4.3 1.2.0.Final 2.3.30 1.111 @@ -960,4 +960,3 @@ -
[camel-quarkus] 04/05: Regen
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit 9d7bbe5f9f39e75f484baf8a341128ffdb5ba4a5 Author: lburgazzoli AuthorDate: Tue Aug 18 12:17:10 2020 +0200 Regen --- .../src/generated/resources/org/apache/camel/component/qute/qute.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json b/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json index 060ed1d..96795db 100644 --- a/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json +++ b/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json @@ -11,7 +11,7 @@ "supportLevel": "Preview", "groupId": "org.apache.camel.quarkus", "artifactId": "camel-quarkus-qute-component", -"version": "1.0.0", +"version": "1.0.1-SNAPSHOT", "scheme": "qute", "extendsScheme": "", "syntax": "qute:resourceUri",
[camel-quarkus] 01/05: Upgarde to camel v3.4.3
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit d23f5c1d835d767d0146d84216099108645d2f16 Author: lburgazzoli AuthorDate: Wed Aug 12 12:34:17 2020 +0200 Upgarde to camel v3.4.3 --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f687cc2..c65d485 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ 1.11.714 1.11.22 2.13.33 -3.4.2 +3.4.3 1.2.0.Final 2.3.30 1.111 @@ -960,4 +960,3 @@ -
[camel-quarkus] 04/05: Regen
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit 9d7bbe5f9f39e75f484baf8a341128ffdb5ba4a5 Author: lburgazzoli AuthorDate: Tue Aug 18 12:17:10 2020 +0200 Regen --- .../src/generated/resources/org/apache/camel/component/qute/qute.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json b/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json index 060ed1d..96795db 100644 --- a/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json +++ b/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json @@ -11,7 +11,7 @@ "supportLevel": "Preview", "groupId": "org.apache.camel.quarkus", "artifactId": "camel-quarkus-qute-component", -"version": "1.0.0", +"version": "1.0.1-SNAPSHOT", "scheme": "qute", "extendsScheme": "", "syntax": "qute:resourceUri",
[camel-quarkus] branch 1.0.x updated (efdac19 -> f1bbe51)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git. from efdac19 Fixup 1.0.0 Qute component metadata new d23f5c1 Upgarde to camel v3.4.3 new 6db3ede Upgarde to camel v3.4.3 (fix MainShutdownStrategy) new ebb0987 chore(build): configure ci to run on release rbanches new 9d7bbe5 Regen new f1bbe51 Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538 The 5 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: .github/workflows/ci-build.yaml| 2 + .github/workflows/pr-validate.yml | 1 + .../org/apache/camel/quarkus/main/CamelMain.java | 53 ++ .../org/apache/camel/component/qute/qute.json | 2 +- .../quarkus/component/http/it/HttpResource.java| 6 +-- .../camel/quarkus/component/http/it/HttpTest.java | 4 +- pom.xml| 3 +- 7 files changed, 15 insertions(+), 56 deletions(-)
[camel-quarkus] 05/05: Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit f1bbe512576d3c924553ec8411639c90151e91ff Author: lburgazzoli AuthorDate: Tue Aug 18 15:49:17 2020 +0200 Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538 --- .../org/apache/camel/quarkus/component/http/it/HttpResource.java| 6 +++--- .../java/org/apache/camel/quarkus/component/http/it/HttpTest.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java index 181930b..dcb7616 100644 --- a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java +++ b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java @@ -60,7 +60,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String getHttps() { return producerTemplate - .to("ahc:https://restcountries.eu/rest/v2/alpha/cz?bridgeEndpoint=true";) + .to("ahc:https://restcountries.com/v2/alpha/cz?bridgeEndpoint=true";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } @@ -117,7 +117,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String httpGetHttps() { return producerTemplate - .to("https://restcountries.eu/rest/v2/alpha/cz?bridgeEndpoint=true";) + .to("https://restcountries.com/v2/alpha/cz?bridgeEndpoint=true";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } @@ -156,7 +156,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String nettyHttpGetHttps() { return producerTemplate - .to("netty-http:https://restcountries.eu/rest/v2/alpha/cz?ssl=true&passphrase=changeit&keyStoreResource=classpath:jsse/keystore.p12&trustStoreResource=file:{{javax.net.ssl.trustStore}}";) + .to("netty-http:https://restcountries.com/v2/alpha/cz?ssl=true&passphrase=changeit&keyStoreResource=classpath:jsse/keystore.p12&trustStoreResource=file:{{javax.net.ssl.trustStore}}";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } diff --git a/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java b/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java index a1f7d48..a730a72 100644 --- a/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java +++ b/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java @@ -68,11 +68,11 @@ class HttpTest { public void restcountries() throws Exception { RestAssured .given() -.baseUri("https://restcountries.eu";) +.baseUri("https://restcountries.com";) .port(443) .when() .accept("application/json") -.get("/rest/v2/alpha/cz") +.get("/v2/alpha/cz") .then() .statusCode(200) .body(containsString("Czech Republic"));
[camel-quarkus] 02/05: Upgarde to camel v3.4.3 (fix MainShutdownStrategy)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit 6db3edeecb027d5dc26175c22de7d6034803c7b5 Author: lburgazzoli AuthorDate: Wed Aug 12 13:30:41 2020 +0200 Upgarde to camel v3.4.3 (fix MainShutdownStrategy) --- .../org/apache/camel/quarkus/main/CamelMain.java | 53 ++ 1 file changed, 5 insertions(+), 48 deletions(-) diff --git a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java index 7e71a52..ab75ad5 100644 --- a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java +++ b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java @@ -18,8 +18,6 @@ package org.apache.camel.quarkus.main; import java.util.Collection; import java.util.Collections; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import io.quarkus.runtime.Quarkus; @@ -31,6 +29,7 @@ import org.apache.camel.main.MainCommandLineSupport; import org.apache.camel.main.MainConfigurationProperties; import org.apache.camel.main.MainListener; import org.apache.camel.main.MainShutdownStrategy; +import org.apache.camel.main.SimpleMainShutdownStrategy; import org.apache.camel.spi.CamelBeanPostProcessor; import org.apache.camel.spi.HasCamelContext; import org.apache.camel.support.service.ServiceHelper; @@ -59,7 +58,10 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC @Override protected void doInit() throws Exception { -setShutdownStrategy(new ShutdownStrategy()); +MainShutdownStrategy shutdownStrategy = new SimpleMainShutdownStrategy(); +shutdownStrategy.addShutdownListener(() -> Quarkus.asyncExit(getExitCode())); + +setShutdownStrategy(shutdownStrategy); super.doInit(); initCamelContext(); @@ -148,49 +150,4 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC parseArguments(args); runEngine(); } - -/** - * Implementation of a {@link MainShutdownStrategy} based on Quarkus Command Mode. - * - * @see https://quarkus.io/guides/command-mode-reference";>Quarkus Command Mode Applications - */ -private class ShutdownStrategy implements MainShutdownStrategy { -private final AtomicBoolean completed; -private final CountDownLatch latch; - -public ShutdownStrategy() { -this.completed = new AtomicBoolean(false); -this.latch = new CountDownLatch(1); -} - -@Override -public boolean isRunAllowed() { -return !completed.get(); -} - -@Override -public boolean shutdown() { -if (completed.compareAndSet(false, true)) { -latch.countDown(); -Quarkus.asyncExit(getExitCode()); -return true; -} - -return false; -} - -@Override -public void await() throws InterruptedException { -latch.await(); -} - -@Override -public void await(long timeout, TimeUnit unit) throws InterruptedException { -if (!latch.await(timeout, unit)) { -LOGGER.warn( -"Could not await stopping CamelMain within {} {}. You may want to increase camel.main.shutdown.timeout", -timeout, unit); -} -} -} }
[camel-quarkus] 03/05: chore(build): configure ci to run on release rbanches
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit ebb098794c613f56009cbf74c7447286d8240f65 Author: lburgazzoli AuthorDate: Tue Aug 18 09:39:13 2020 +0200 chore(build): configure ci to run on release rbanches --- .github/workflows/ci-build.yaml | 2 ++ .github/workflows/pr-validate.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index ee98ab8..d7f4273 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -23,6 +23,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS' @@ -33,6 +34,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS' diff --git a/.github/workflows/pr-validate.yml b/.github/workflows/pr-validate.yml index a3a3667..bc9b847 100644 --- a/.github/workflows/pr-validate.yml +++ b/.github/workflows/pr-validate.yml @@ -23,6 +23,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS'
[camel-quarkus] branch 1.0.x updated (efdac19 -> f1bbe51)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git. from efdac19 Fixup 1.0.0 Qute component metadata new d23f5c1 Upgarde to camel v3.4.3 new 6db3ede Upgarde to camel v3.4.3 (fix MainShutdownStrategy) new ebb0987 chore(build): configure ci to run on release rbanches new 9d7bbe5 Regen new f1bbe51 Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538 The 5 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: .github/workflows/ci-build.yaml| 2 + .github/workflows/pr-validate.yml | 1 + .../org/apache/camel/quarkus/main/CamelMain.java | 53 ++ .../org/apache/camel/component/qute/qute.json | 2 +- .../quarkus/component/http/it/HttpResource.java| 6 +-- .../camel/quarkus/component/http/it/HttpTest.java | 4 +- pom.xml| 3 +- 7 files changed, 15 insertions(+), 56 deletions(-)
[camel-quarkus] 04/05: Regen
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit 9d7bbe5f9f39e75f484baf8a341128ffdb5ba4a5 Author: lburgazzoli AuthorDate: Tue Aug 18 12:17:10 2020 +0200 Regen --- .../src/generated/resources/org/apache/camel/component/qute/qute.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json b/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json index 060ed1d..96795db 100644 --- a/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json +++ b/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json @@ -11,7 +11,7 @@ "supportLevel": "Preview", "groupId": "org.apache.camel.quarkus", "artifactId": "camel-quarkus-qute-component", -"version": "1.0.0", +"version": "1.0.1-SNAPSHOT", "scheme": "qute", "extendsScheme": "", "syntax": "qute:resourceUri",
[camel-quarkus] 03/05: chore(build): configure ci to run on release rbanches
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit ebb098794c613f56009cbf74c7447286d8240f65 Author: lburgazzoli AuthorDate: Tue Aug 18 09:39:13 2020 +0200 chore(build): configure ci to run on release rbanches --- .github/workflows/ci-build.yaml | 2 ++ .github/workflows/pr-validate.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index ee98ab8..d7f4273 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -23,6 +23,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS' @@ -33,6 +34,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS' diff --git a/.github/workflows/pr-validate.yml b/.github/workflows/pr-validate.yml index a3a3667..bc9b847 100644 --- a/.github/workflows/pr-validate.yml +++ b/.github/workflows/pr-validate.yml @@ -23,6 +23,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS'
[camel-quarkus] 01/05: Upgarde to camel v3.4.3
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit d23f5c1d835d767d0146d84216099108645d2f16 Author: lburgazzoli AuthorDate: Wed Aug 12 12:34:17 2020 +0200 Upgarde to camel v3.4.3 --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f687cc2..c65d485 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ 1.11.714 1.11.22 2.13.33 -3.4.2 +3.4.3 1.2.0.Final 2.3.30 1.111 @@ -960,4 +960,3 @@ -
[camel-quarkus] 05/05: Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit f1bbe512576d3c924553ec8411639c90151e91ff Author: lburgazzoli AuthorDate: Tue Aug 18 15:49:17 2020 +0200 Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538 --- .../org/apache/camel/quarkus/component/http/it/HttpResource.java| 6 +++--- .../java/org/apache/camel/quarkus/component/http/it/HttpTest.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java index 181930b..dcb7616 100644 --- a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java +++ b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java @@ -60,7 +60,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String getHttps() { return producerTemplate - .to("ahc:https://restcountries.eu/rest/v2/alpha/cz?bridgeEndpoint=true";) + .to("ahc:https://restcountries.com/v2/alpha/cz?bridgeEndpoint=true";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } @@ -117,7 +117,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String httpGetHttps() { return producerTemplate - .to("https://restcountries.eu/rest/v2/alpha/cz?bridgeEndpoint=true";) + .to("https://restcountries.com/v2/alpha/cz?bridgeEndpoint=true";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } @@ -156,7 +156,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String nettyHttpGetHttps() { return producerTemplate - .to("netty-http:https://restcountries.eu/rest/v2/alpha/cz?ssl=true&passphrase=changeit&keyStoreResource=classpath:jsse/keystore.p12&trustStoreResource=file:{{javax.net.ssl.trustStore}}";) + .to("netty-http:https://restcountries.com/v2/alpha/cz?ssl=true&passphrase=changeit&keyStoreResource=classpath:jsse/keystore.p12&trustStoreResource=file:{{javax.net.ssl.trustStore}}";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } diff --git a/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java b/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java index a1f7d48..a730a72 100644 --- a/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java +++ b/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java @@ -68,11 +68,11 @@ class HttpTest { public void restcountries() throws Exception { RestAssured .given() -.baseUri("https://restcountries.eu";) +.baseUri("https://restcountries.com";) .port(443) .when() .accept("application/json") -.get("/rest/v2/alpha/cz") +.get("/v2/alpha/cz") .then() .statusCode(200) .body(containsString("Czech Republic"));
[camel-quarkus] 02/05: Upgarde to camel v3.4.3 (fix MainShutdownStrategy)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch 1.0.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit 6db3edeecb027d5dc26175c22de7d6034803c7b5 Author: lburgazzoli AuthorDate: Wed Aug 12 13:30:41 2020 +0200 Upgarde to camel v3.4.3 (fix MainShutdownStrategy) --- .../org/apache/camel/quarkus/main/CamelMain.java | 53 ++ 1 file changed, 5 insertions(+), 48 deletions(-) diff --git a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java index 7e71a52..ab75ad5 100644 --- a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java +++ b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java @@ -18,8 +18,6 @@ package org.apache.camel.quarkus.main; import java.util.Collection; import java.util.Collections; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import io.quarkus.runtime.Quarkus; @@ -31,6 +29,7 @@ import org.apache.camel.main.MainCommandLineSupport; import org.apache.camel.main.MainConfigurationProperties; import org.apache.camel.main.MainListener; import org.apache.camel.main.MainShutdownStrategy; +import org.apache.camel.main.SimpleMainShutdownStrategy; import org.apache.camel.spi.CamelBeanPostProcessor; import org.apache.camel.spi.HasCamelContext; import org.apache.camel.support.service.ServiceHelper; @@ -59,7 +58,10 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC @Override protected void doInit() throws Exception { -setShutdownStrategy(new ShutdownStrategy()); +MainShutdownStrategy shutdownStrategy = new SimpleMainShutdownStrategy(); +shutdownStrategy.addShutdownListener(() -> Quarkus.asyncExit(getExitCode())); + +setShutdownStrategy(shutdownStrategy); super.doInit(); initCamelContext(); @@ -148,49 +150,4 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC parseArguments(args); runEngine(); } - -/** - * Implementation of a {@link MainShutdownStrategy} based on Quarkus Command Mode. - * - * @see https://quarkus.io/guides/command-mode-reference";>Quarkus Command Mode Applications - */ -private class ShutdownStrategy implements MainShutdownStrategy { -private final AtomicBoolean completed; -private final CountDownLatch latch; - -public ShutdownStrategy() { -this.completed = new AtomicBoolean(false); -this.latch = new CountDownLatch(1); -} - -@Override -public boolean isRunAllowed() { -return !completed.get(); -} - -@Override -public boolean shutdown() { -if (completed.compareAndSet(false, true)) { -latch.countDown(); -Quarkus.asyncExit(getExitCode()); -return true; -} - -return false; -} - -@Override -public void await() throws InterruptedException { -latch.await(); -} - -@Override -public void await(long timeout, TimeUnit unit) throws InterruptedException { -if (!latch.await(timeout, unit)) { -LOGGER.warn( -"Could not await stopping CamelMain within {} {}. You may want to increase camel.main.shutdown.timeout", -timeout, unit); -} -} -} }
[camel-k-runtime] branch master updated: groovy: cleanup loader and tests
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 7fdd4ac groovy: cleanup loader and tests 7fdd4ac is described below commit 7fdd4ac8984168dee5e9c81d42113193b0858a76 Author: lburgazzoli AuthorDate: Wed Aug 19 09:23:34 2020 +0200 groovy: cleanup loader and tests --- .../k/loader/groovy/dsl/BeanConfiguration.groovy | 2 - .../groovy/dsl/ComponentsConfiguration.groovy | 2 - .../groovy/dsl/IntegrationConfiguration.groovy | 4 +- .../camel/k/loader/groovy/dsl/Support.groovy | 10 +- .../CamelContextExtensions.groovy} | 29 +++--- .../extension/ExpressionClauseExtensions.groovy| 3 +- .../groovy/extension/LogComponentExtension.groovy | 2 + .../extension/ProcessorDefinitionExtensions.groovy | 4 +- .../org.codehaus.groovy.runtime.ExtensionModule| 3 +- .../apache/camel/k/loader/groovy/LoaderTest.groovy | 59 +++- .../k/loader/groovy/dsl/IntegrationTest.groovy | 105 + .../extension/ExpressionClauseExtensionTest.groovy | 64 + .../k/loader/groovy/support/TestRuntime.groovy | 66 + .../org/apache/camel/k/support/RouteBuilders.java | 12 ++- 14 files changed, 187 insertions(+), 178 deletions(-) diff --git a/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/BeanConfiguration.groovy b/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/BeanConfiguration.groovy index feb0657..a8a4461 100644 --- a/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/BeanConfiguration.groovy +++ b/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/BeanConfiguration.groovy @@ -16,12 +16,10 @@ */ package org.apache.camel.k.loader.groovy.dsl -import groovy.util.logging.Slf4j import org.apache.camel.CamelContext import org.apache.camel.ExtendedCamelContext import org.apache.camel.support.PropertyBindingSupport -@Slf4j class BeanConfiguration { private final CamelContext context private final Object target diff --git a/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/ComponentsConfiguration.groovy b/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/ComponentsConfiguration.groovy index ed69798..9eae49f 100644 --- a/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/ComponentsConfiguration.groovy +++ b/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/ComponentsConfiguration.groovy @@ -16,11 +16,9 @@ */ package org.apache.camel.k.loader.groovy.dsl -import groovy.util.logging.Slf4j import org.apache.camel.CamelContext import org.apache.camel.Component -@Slf4j class ComponentsConfiguration { private final CamelContext context diff --git a/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/IntegrationConfiguration.groovy b/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/IntegrationConfiguration.groovy index ba9ca16..0e7432f 100644 --- a/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/IntegrationConfiguration.groovy +++ b/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/IntegrationConfiguration.groovy @@ -16,7 +16,6 @@ */ package org.apache.camel.k.loader.groovy.dsl - import org.apache.camel.builder.BuilderSupport import org.apache.camel.builder.EndpointConsumerBuilder import org.apache.camel.builder.ErrorHandlerBuilder @@ -28,6 +27,7 @@ import org.apache.camel.model.InterceptSendToEndpointDefinition import org.apache.camel.model.OnCompletionDefinition import org.apache.camel.model.OnExceptionDefinition import org.apache.camel.model.RouteDefinition +import org.apache.camel.model.rest.RestConfigurationDefinition import org.apache.camel.model.rest.RestDefinition import org.apache.camel.spi.Registry @@ -66,7 +66,7 @@ class IntegrationConfiguration extends BuilderSupport implements Support, Endpoi return builder.rest() } -RestConfiguration restConfiguration() { +RestConfigurationDefinition restConfiguration() { builder.restConfiguration(); } diff --git a/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/Support.groovy b/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/Support.groovy index 5a6cce7..80f0f09 100644 --- a/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/Support.groovy +++ b/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/dsl/Support.groovy @@ -17,19 +17,21 @@ package org.apache.camel.k.loader.groovy.dsl import org.apache.camel.Exchange +import org.apache.camel.Predicate +import
[camel-k-runtime] branch master updated: Add badges
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 43a3847 Add badges 43a3847 is described below commit 43a3847f41bd857af249453a760c77cd3e1a61bf Author: lburgazzoli AuthorDate: Wed Aug 19 08:19:09 2020 +0200 Add badges --- README.adoc | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.adoc b/README.adoc index 2e3f282..823d99e 100644 --- a/README.adoc +++ b/README.adoc @@ -1,7 +1,9 @@ -image:https://github.com/apache/camel-k-runtime/workflows/Build%20PR/badge.svg["Build Status", link="https://github.com/apache/camel-k-runtime/actions?query=workflow%3A%22Build+PR%22";] - - Apache Camel K Runtime == +image:https://img.shields.io/maven-central/v/org.apache.camel.k/camel-k-runtime-bom.svg["Maven Central", link="http://search.maven.org/#search%7Cga%7C1%7Corg.apache.camel.k";] +image:https://img.shields.io/github/license/openshift/origin.svg?maxAge=2592000["Licensed under Apache License version 2.0", link="https://www.apache.org/licenses/LICENSE-2.0";] +image:https://badges.gitter.im/apache/camel-k.svg["Chat on Gitter", link="https://gitter.im/apache/camel-k";] +image:https://github.com/apache/camel-k-runtime/workflows/Build/badge.svg["Build Status", link="https://github.com/apache/camel-k-runtime/actions?query=workflow%3ABuild";] + This repository contains the Apache Camel-K Runtime bits used by the https://github.com/apache/camel-k[_main project_]
[camel-k-runtime] branch master updated: Add badges
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 43a3847 Add badges 43a3847 is described below commit 43a3847f41bd857af249453a760c77cd3e1a61bf Author: lburgazzoli AuthorDate: Wed Aug 19 08:19:09 2020 +0200 Add badges --- README.adoc | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.adoc b/README.adoc index 2e3f282..823d99e 100644 --- a/README.adoc +++ b/README.adoc @@ -1,7 +1,9 @@ -image:https://github.com/apache/camel-k-runtime/workflows/Build%20PR/badge.svg["Build Status", link="https://github.com/apache/camel-k-runtime/actions?query=workflow%3A%22Build+PR%22";] - - Apache Camel K Runtime == +image:https://img.shields.io/maven-central/v/org.apache.camel.k/camel-k-runtime-bom.svg["Maven Central", link="http://search.maven.org/#search%7Cga%7C1%7Corg.apache.camel.k";] +image:https://img.shields.io/github/license/openshift/origin.svg?maxAge=2592000["Licensed under Apache License version 2.0", link="https://www.apache.org/licenses/LICENSE-2.0";] +image:https://badges.gitter.im/apache/camel-k.svg["Chat on Gitter", link="https://gitter.im/apache/camel-k";] +image:https://github.com/apache/camel-k-runtime/workflows/Build/badge.svg["Build Status", link="https://github.com/apache/camel-k-runtime/actions?query=workflow%3ABuild";] + This repository contains the Apache Camel-K Runtime bits used by the https://github.com/apache/camel-k[_main project_]
[camel-quarkus] branch master updated: Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git The following commit(s) were added to refs/heads/master by this push: new fcd238d Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538 fcd238d is described below commit fcd238dcc4a080a27719b5d4d132f4c5815026df Author: lburgazzoli AuthorDate: Tue Aug 18 15:49:17 2020 +0200 Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538 --- .../org/apache/camel/quarkus/component/http/it/HttpResource.java| 6 +++--- .../java/org/apache/camel/quarkus/component/http/it/HttpTest.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java index 181930b..dcb7616 100644 --- a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java +++ b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java @@ -60,7 +60,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String getHttps() { return producerTemplate - .to("ahc:https://restcountries.eu/rest/v2/alpha/cz?bridgeEndpoint=true";) + .to("ahc:https://restcountries.com/v2/alpha/cz?bridgeEndpoint=true";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } @@ -117,7 +117,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String httpGetHttps() { return producerTemplate - .to("https://restcountries.eu/rest/v2/alpha/cz?bridgeEndpoint=true";) + .to("https://restcountries.com/v2/alpha/cz?bridgeEndpoint=true";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } @@ -156,7 +156,7 @@ public class HttpResource { @Produces(MediaType.TEXT_PLAIN) public String nettyHttpGetHttps() { return producerTemplate - .to("netty-http:https://restcountries.eu/rest/v2/alpha/cz?ssl=true&passphrase=changeit&keyStoreResource=classpath:jsse/keystore.p12&trustStoreResource=file:{{javax.net.ssl.trustStore}}";) + .to("netty-http:https://restcountries.com/v2/alpha/cz?ssl=true&passphrase=changeit&keyStoreResource=classpath:jsse/keystore.p12&trustStoreResource=file:{{javax.net.ssl.trustStore}}";) .withHeader(Exchange.HTTP_METHOD, "GET") .request(String.class); } diff --git a/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java b/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java index a1f7d48..a730a72 100644 --- a/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java +++ b/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java @@ -68,11 +68,11 @@ class HttpTest { public void restcountries() throws Exception { RestAssured .given() -.baseUri("https://restcountries.eu";) +.baseUri("https://restcountries.com";) .port(443) .when() .accept("application/json") -.get("/rest/v2/alpha/cz") +.get("/v2/alpha/cz") .then() .statusCode(200) .body(containsString("Czech Republic"));
[camel-k-runtime] branch master updated: build(deps): bump maven-remote-resources-plugin from 1.5 to 1.7.0
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new e891e68 build(deps): bump maven-remote-resources-plugin from 1.5 to 1.7.0 e891e68 is described below commit e891e688ab29440ae643bfbbd9b388556a342c20 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> AuthorDate: Tue Aug 18 19:00:56 2020 + build(deps): bump maven-remote-resources-plugin from 1.5 to 1.7.0 Bumps [maven-remote-resources-plugin](https://github.com/apache/maven-remote-resources-plugin) from 1.5 to 1.7.0. - [Release notes](https://github.com/apache/maven-remote-resources-plugin/releases) - [Commits](https://github.com/apache/maven-remote-resources-plugin/compare/maven-remote-resources-plugin-1.5...maven-remote-resources-plugin-1.7.0) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3b2e335..1a8e01e 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ 1.10.0 3.8.1 3.0.0-M5 - 1.5 + 1.7.0 3.0.0-M5 2.8.1 0.3.1
[camel-k-runtime] branch master updated (a7e96b1 -> bcd012e)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from a7e96b1 build(deps): bump jaeger-client from 1.2.0 to 1.3.2 add bcd012e build(deps): bump exec-maven-plugin from 1.6.0 to 3.0.0 No new revisions were added by this update. Summary of changes: pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[camel-k-runtime] branch master updated (f4878f7 -> a7e96b1)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from f4878f7 build(deps): add junit-pioneer to ease test that require env vars or properties add a7e96b1 build(deps): bump jaeger-client from 1.2.0 to 1.3.2 No new revisions were added by this update. Summary of changes: pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[camel-k-runtime] branch master updated: build(deps): add junit-pioneer to ease test that require env vars or properties
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new f4878f7 build(deps): add junit-pioneer to ease test that require env vars or properties f4878f7 is described below commit f4878f776ae0ce76fa9f45bfa09a017d20096e85 Author: lburgazzoli AuthorDate: Tue Aug 18 17:14:24 2020 +0200 build(deps): add junit-pioneer to ease test that require env vars or properties --- pom.xml | 6 ++ tooling/camel-k-test/pom.xml | 4 2 files changed, 10 insertions(+) diff --git a/pom.xml b/pom.xml index 046b5f1..cf11d63 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,7 @@ 1.0.0 ${camel.version} 5.6.2 +0.9.0 0.9.13 3.11 1.9 @@ -646,6 +647,11 @@ junit-jupiter ${junit.version} + +org.junit-pioneer +junit-pioneer +${junit-pioneer.version} + org.assertj diff --git a/tooling/camel-k-test/pom.xml b/tooling/camel-k-test/pom.xml index f9625df..364c095 100644 --- a/tooling/camel-k-test/pom.xml +++ b/tooling/camel-k-test/pom.xml @@ -33,6 +33,10 @@ org.junit.jupiter junit-jupiter + +org.junit-pioneer +junit-pioneer + org.assertj
[camel-k-runtime] branch master updated (41e6ae8 -> 7504750)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from 41e6ae8 build(deps): bump gmavenplus-plugin from 1.9.0 to 1.10.0 add 7504750 build(ci): build on push and skip build for some paths No new revisions were added by this update. Summary of changes: .github/workflows/{pr-build.yml => ci-build.yml} | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) rename .github/workflows/{pr-build.yml => ci-build.yml} (90%)
[camel-k-runtime] branch master updated: build(deps): bump gmavenplus-plugin from 1.9.0 to 1.10.0
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 41e6ae8 build(deps): bump gmavenplus-plugin from 1.9.0 to 1.10.0 41e6ae8 is described below commit 41e6ae83c6f666c10d1b4b735a658c8500327dff Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> AuthorDate: Tue Aug 18 14:45:22 2020 + build(deps): bump gmavenplus-plugin from 1.9.0 to 1.10.0 Bumps [gmavenplus-plugin](https://github.com/groovy/GMavenPlus) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/groovy/GMavenPlus/releases) - [Commits](https://github.com/groovy/GMavenPlus/compare/1.9.0...1.10.0) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ba47b53..046b5f1 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 1.2.0 2.2.14 -1.9.0 +1.10.0 3.8.1 3.0.0-M5 1.5
[camel-k-runtime] branch master updated (b32ba40 -> 37d081f)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from b32ba40 build(deps): replace code depending on guava with camel's helpers add 37d081f build(deps): bump jaxb-api from 2.3.0 to 2.3.1 No new revisions were added by this update. Summary of changes: pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[camel-k-runtime] branch master updated (37d081f -> 6f91834)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from 37d081f build(deps): bump jaxb-api from 2.3.0 to 2.3.1 add 6f91834 Bump maven-assembly-plugin from 3.2.0 to 3.3.0 No new revisions were added by this update. Summary of changes: pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[camel-k-runtime] branch master updated (cd947f8 -> b32ba40)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from cd947f8 chore(deps): tune dependabot for checkstyle add b32ba40 build(deps): replace code depending on guava with camel's helpers No new revisions were added by this update. Summary of changes: tooling/camel-k-maven-plugin/pom.xml | 5 - .../camel/k/tooling/maven/GenerateYamlLoaderSupportClasses.java | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-)
[camel-k-runtime] branch master updated: chore(deps): tune dependabot for checkstyle
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new cd947f8 chore(deps): tune dependabot for checkstyle cd947f8 is described below commit cd947f8402a82d75604bdc080ccd17a55d926051 Author: lburgazzoli AuthorDate: Tue Aug 18 16:38:10 2020 +0200 chore(deps): tune dependabot for checkstyle --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1e61f5b..9e2c0e2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -31,6 +31,7 @@ updates: - dependency-name: "io.quarkus:*" - dependency-name: "org.graalvm.js:js" - dependency-name: "com.fasterxml.jackson:*" + - dependency-name: "com.puppycrawl.tools:checkstyle" - package-ecosystem: "github-actions" directory: "/" labels:
[camel-k-runtime] branch master updated: chore(deps): tune dependabot for jackson
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 4cc2888 chore(deps): tune dependabot for jackson 4cc2888 is described below commit 4cc2888defb35f3b517de06f4f864f3105da568e Author: lburgazzoli AuthorDate: Tue Aug 18 16:36:27 2020 +0200 chore(deps): tune dependabot for jackson --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 47ec8e2..1e61f5b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -30,7 +30,7 @@ updates: - dependency-name: "org.apache.camel.quarkus:*" - dependency-name: "io.quarkus:*" - dependency-name: "org.graalvm.js:js" - - dependency-name: "com.fasterxml.jackson.*:*" + - dependency-name: "com.fasterxml.jackson:*" - package-ecosystem: "github-actions" directory: "/" labels:
[camel-k-runtime] branch master updated: Add dependabot
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 884c072 Add dependabot 884c072 is described below commit 884c072ddc2e8db574a14a7f3c321a7f2be5c19d Author: lburgazzoli AuthorDate: Tue Aug 18 15:55:10 2020 +0200 Add dependabot --- .github/dependabot.yml | 42 ++ 1 file changed, 42 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000..47ec8e2 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,42 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +version: 2 +updates: + - package-ecosystem: "maven" +directory: "/" +open-pull-requests-limit: 3 +labels: + - dependencies +schedule: + interval: "daily" + time: "21:00" + timezone: Europe/Paris +ignore: + - dependency-name: "org.apache.camel:*" + - dependency-name: "org.apache.camel.quarkus:*" + - dependency-name: "io.quarkus:*" + - dependency-name: "org.graalvm.js:js" + - dependency-name: "com.fasterxml.jackson.*:*" + - package-ecosystem: "github-actions" +directory: "/" +labels: + - dependencies + - ci +schedule: + interval: "daily" + time: "21:00" + timezone: Europe/Paris \ No newline at end of file
[camel-k-runtime] branch master updated: chore(build): tune and enable pmd on sourcecheck profile
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 4bc793e chore(build): tune and enable pmd on sourcecheck profile 4bc793e is described below commit 4bc793efdfda28abca1cac007d2a244593ef3b8e Author: lburgazzoli AuthorDate: Tue Aug 18 14:24:33 2020 +0200 chore(build): tune and enable pmd on sourcecheck profile --- pom.xml | 69 ++--- tooling/pmd-ruleset.xml | 739 +--- 2 files changed, 99 insertions(+), 709 deletions(-) diff --git a/pom.xml b/pom.xml index fec5142..f52fb9d 100644 --- a/pom.xml +++ b/pom.xml @@ -192,30 +192,6 @@ ${maven-checkstyle.version} - - -default-cli -validate - -false - camel-checkstyle.xml -true - ${checkstyle.failOnViolation} -false - camel-checkstyle-suppressions.xml -UTF-8 - - ${basedir}/src - - header-java.txt - **/*.java,**/*.groovy,**/*.scala,**/*.properties,**/*.xml,**/*.xsd - **/MyRoutes*.java,**/routes*.java,**/verify.groovy - - -checkstyle - - - org.jboss.jandex @@ -248,6 +224,13 @@ com.mycila license-maven-plugin ${mycila-license.version} + + +org.apache.camel +camel-buildtools +${camel.version} + + org.apache.maven.plugins @@ -837,13 +820,6 @@ license-properties-headerdefinition.xml - - -org.apache.camel -camel-buildtools -${camel.version} - - @@ -855,14 +831,31 @@ org.apache.maven.plugins maven-checkstyle-plugin + + +default-cli +validate + +false + camel-checkstyle.xml +true + ${checkstyle.failOnViolation} +false + camel-checkstyle-suppressions.xml +UTF-8 + + ${basedir}/src + + header-java.txt + **/*.java,**/*.groovy,**/*.scala,**/*.properties,**/*.xml,**/*.xsd + **/MyRoutes*.java,**/routes*.java,**/verify.groovy + + +checkstyle + + + - - - - -pmd - - org.apache.maven.plugins maven-pmd-plugin diff --git a/tooling/pmd-ruleset.xml b/tooling/pmd-ruleset.xml index a20fd35..cc3ac65 100644 --- a/tooling/pmd-ruleset.xml +++ b/tooling/pmd-ruleset.xml @@ -17,695 +17,92 @@ limitations under the License. --> -http://pmd.sourceforge.net/ruleset/2.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; +http://pmd.sourceforge.net/ruleset/2.0.0"; + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://pmd.sourceforge.net/rul
[camel-k-runtime] branch master updated: chore(deps): update kotlin to v1.4.0
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 5327acb chore(deps): update kotlin to v1.4.0 5327acb is described below commit 5327acb393a73eb13a0464ae4f3ee3d56cda04ec Author: lburgazzoli AuthorDate: Tue Aug 18 11:27:51 2020 +0200 chore(deps): update kotlin to v1.4.0 --- .../camel-k-loader-kotlin/pom.xml | 25 +++--- .../camel-k-quarkus-loader-kotlin/runtime/pom.xml | 12 +++ pom.xml| 2 +- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml b/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml index 976c295..478eeac 100644 --- a/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml +++ b/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml @@ -27,6 +27,18 @@ camel-k-loader-kotlin + + + +org.jetbrains.kotlin +kotlin-bom +${kotlin.version} +pom +import + + + + org.apache.camel.k @@ -43,28 +55,15 @@ org.jetbrains.kotlin -kotlin-stdlib-jdk8 -${kotlin.version} - - -org.jetbrains.kotlin kotlin-script-util -${kotlin.version} org.jetbrains.kotlin kotlin-scripting-jvm -${kotlin.version} org.jetbrains.kotlin kotlin-scripting-jvm-host -${kotlin.version} - - -org.jetbrains.kotlin -kotlin-scripting-compiler -${kotlin.version} diff --git a/camel-k-quarkus/camel-k-quarkus-loader-kotlin/runtime/pom.xml b/camel-k-quarkus/camel-k-quarkus-loader-kotlin/runtime/pom.xml index 8694f8f..c80083a 100644 --- a/camel-k-quarkus/camel-k-quarkus-loader-kotlin/runtime/pom.xml +++ b/camel-k-quarkus/camel-k-quarkus-loader-kotlin/runtime/pom.xml @@ -27,6 +27,18 @@ camel-k-quarkus-loader-kotlin + + + +org.jetbrains.kotlin +kotlin-bom +${kotlin.version} +pom +import + + + + org.apache.camel.k diff --git a/pom.xml b/pom.xml index 1f3d3d0..fec5142 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 2.13.3 1.7.30 3.0.5 -1.3.72 +1.4.0 1.26 2.0-M3-groovy-3.0 2.10.5
[camel-quarkus] branch master updated: chore(build): configure ci to run on release rbanches
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git The following commit(s) were added to refs/heads/master by this push: new b20618d chore(build): configure ci to run on release rbanches b20618d is described below commit b20618d6ee3cd9f2277564dcda2d341b93720dcd Author: lburgazzoli AuthorDate: Tue Aug 18 09:39:13 2020 +0200 chore(build): configure ci to run on release rbanches --- .github/workflows/ci-build.yaml | 2 ++ .github/workflows/pr-validate.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index ee98ab8..d7f4273 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -23,6 +23,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS' @@ -33,6 +34,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS' diff --git a/.github/workflows/pr-validate.yml b/.github/workflows/pr-validate.yml index a3a3667..bc9b847 100644 --- a/.github/workflows/pr-validate.yml +++ b/.github/workflows/pr-validate.yml @@ -23,6 +23,7 @@ on: - master - camel-master - quarkus-master + - "[0-9]+.[0-9]+.x" paths-ignore: - '**.adoc' - 'KEYS'
[camel-quarkus] branch master updated (6f7f29b -> e6a93fd)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git. from 6f7f29b Avoid purging artifacts for builds that may be in progress new ea33d45 Upgarde to camel v3.4.3 new e6a93fd Upgarde to camel v3.4.3 (fix MainShutdownStrategy) 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: .../org/apache/camel/quarkus/main/CamelMain.java | 53 ++ pom.xml| 3 +- 2 files changed, 6 insertions(+), 50 deletions(-)
[camel-quarkus] 01/02: Upgarde to camel v3.4.3
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit ea33d45e98c8d499bbbc6856cd73dbfc1c4357ab Author: lburgazzoli AuthorDate: Wed Aug 12 12:34:17 2020 +0200 Upgarde to camel v3.4.3 --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3634157..549b9a6 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ 1.11.714 1.11.22 2.13.33 -3.4.2 +3.4.3 1.2.0.Final 2.3.30 1.111 @@ -961,4 +961,3 @@ -
[camel-quarkus] 02/02: Upgarde to camel v3.4.3 (fix MainShutdownStrategy)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit e6a93fd88c94096fa447b18e33f90d88a07342a5 Author: lburgazzoli AuthorDate: Wed Aug 12 13:30:41 2020 +0200 Upgarde to camel v3.4.3 (fix MainShutdownStrategy) --- .../org/apache/camel/quarkus/main/CamelMain.java | 53 ++ 1 file changed, 5 insertions(+), 48 deletions(-) diff --git a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java index 7e71a52..ab75ad5 100644 --- a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java +++ b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java @@ -18,8 +18,6 @@ package org.apache.camel.quarkus.main; import java.util.Collection; import java.util.Collections; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import io.quarkus.runtime.Quarkus; @@ -31,6 +29,7 @@ import org.apache.camel.main.MainCommandLineSupport; import org.apache.camel.main.MainConfigurationProperties; import org.apache.camel.main.MainListener; import org.apache.camel.main.MainShutdownStrategy; +import org.apache.camel.main.SimpleMainShutdownStrategy; import org.apache.camel.spi.CamelBeanPostProcessor; import org.apache.camel.spi.HasCamelContext; import org.apache.camel.support.service.ServiceHelper; @@ -59,7 +58,10 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC @Override protected void doInit() throws Exception { -setShutdownStrategy(new ShutdownStrategy()); +MainShutdownStrategy shutdownStrategy = new SimpleMainShutdownStrategy(); +shutdownStrategy.addShutdownListener(() -> Quarkus.asyncExit(getExitCode())); + +setShutdownStrategy(shutdownStrategy); super.doInit(); initCamelContext(); @@ -148,49 +150,4 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC parseArguments(args); runEngine(); } - -/** - * Implementation of a {@link MainShutdownStrategy} based on Quarkus Command Mode. - * - * @see https://quarkus.io/guides/command-mode-reference";>Quarkus Command Mode Applications - */ -private class ShutdownStrategy implements MainShutdownStrategy { -private final AtomicBoolean completed; -private final CountDownLatch latch; - -public ShutdownStrategy() { -this.completed = new AtomicBoolean(false); -this.latch = new CountDownLatch(1); -} - -@Override -public boolean isRunAllowed() { -return !completed.get(); -} - -@Override -public boolean shutdown() { -if (completed.compareAndSet(false, true)) { -latch.countDown(); -Quarkus.asyncExit(getExitCode()); -return true; -} - -return false; -} - -@Override -public void await() throws InterruptedException { -latch.await(); -} - -@Override -public void await(long timeout, TimeUnit unit) throws InterruptedException { -if (!latch.await(timeout, unit)) { -LOGGER.warn( -"Could not await stopping CamelMain within {} {}. You may want to increase camel.main.shutdown.timeout", -timeout, unit); -} -} -} }
[camel-k-runtime] 02/02: chore(build): tweak pr-validate workflow
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git commit def39b9d417b97e1dfebb7864dc97d7e4b26b1a7 Author: lburgazzoli AuthorDate: Mon Aug 17 14:21:56 2020 +0200 chore(build): tweak pr-validate workflow --- .github/workflows/pr-validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-validate.yml b/.github/workflows/pr-validate.yml index 9fc2d43..26673fd 100644 --- a/.github/workflows/pr-validate.yml +++ b/.github/workflows/pr-validate.yml @@ -31,7 +31,7 @@ jobs: version: '11' - name: mvn package run: | -./mvnw -fae -B -ntp clean package \ +./mvnw -fae -B -ntp clean verify \ -Dcheckstyle.failOnViolation=true \ -DskipTests \ -Psourcecheck,license
[camel-k-runtime] branch master updated (64205ee -> def39b9)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from 64205ee Upgrade to camel-quarkus v1.0.0 new 16070e5 [quarkus] add tests for jvm only loaders #215 new def39b9 chore(build): tweak pr-validate workflow 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: .github/workflows/pr-validate.yml | 2 +- .../src/main/resources/application.properties | 8 +- .../src/main/resources/application.properties | 11 +-- .../src/main/resources/application.properties | 11 +-- .../pom.xml| 18 ++--- .../camel/k/loader/yaml/quarkus}/Application.java | 25 +++--- .../src/main/resources/application.properties | 8 +- .../k/loader/yaml/quarkus}/ExtensionTest.java | 10 ++- .../src/test/resources}/routes.groovy | 5 +- .../pom.xml| 18 ++--- .../camel/k/loader/java/quarkus}/Application.java | 25 +++--- .../src/main/resources/application.properties | 8 +- .../camel/k/loader/java/java}/ExtensionTest.java | 12 +-- .../src/test/resources/MyRoutes.java | 5 +- .../camel-k-quarkus-itests-loader-js/pom.xml | 18 + .../camel/k/loader/js/quarkus}/Application.java| 25 +++--- .../loader/js/quarkus/deployment/Application.java | 89 -- .../src/main/resources/application.properties | 11 +-- .../camel/k/loader/js/quarkus}/ExtensionIT.java| 2 +- .../js/quarkus/{deployment => }/ExtensionTest.java | 2 +- .../loader/js/quarkus/deployment/ExtensionIT.java | 23 -- .../camel-k-quarkus-itests-loader-support}/pom.xml | 33 .../camel/k/loader/support/LoaderSupport.java} | 45 +-- .../camel-k-quarkus-itests-loader-xml/pom.xml | 18 + .../camel/k/loader/xml/quarkus}/Application.java | 25 +++--- .../src/main/resources/application.properties | 7 +- .../camel/k/loader/xml/quarkus}/ExtensionIT.java | 2 +- .../quarkus/{deployment => }/ExtensionTest.java| 2 +- .../loader/xml/quarkus/deployment/ExtensionIT.java | 23 -- .../camel-k-quarkus-itests-loader-yaml/pom.xml | 18 + .../camel/k/loader/yaml/quarkus}/Application.java | 25 +++--- .../yaml/quarkus/deployment/Application.java | 87 - .../src/main/resources/application.properties | 11 +-- .../camel/k/loader/yaml/quarkus}/ExtensionIT.java | 2 +- .../quarkus/{deployment => }/ExtensionTest.java| 2 +- .../yaml/quarkus/deployment/ExtensionIT.java | 23 -- .../camel-k-quarkus-itests-polyglot/pom.xml| 14 +--- .../k/itests/polyglot/quarkus/Application.java | 43 +-- .../src/main/resources/application.properties | 12 +-- camel-k-quarkus/camel-k-quarkus-itests/pom.xml | 3 + pom.xml| 10 ++- 41 files changed, 169 insertions(+), 572 deletions(-) copy camel-k-quarkus/camel-k-quarkus-itests/{camel-k-quarkus-itests-core => camel-k-quarkus-itests-loader-groovy}/pom.xml (90%) copy camel-k-quarkus/camel-k-quarkus-itests/{camel-k-quarkus-itests-cron/src/main/java/org/apache/camel/k/quarkus/cron/deployment => camel-k-quarkus-itests-loader-groovy/src/main/java/org/apache/camel/k/loader/yaml/quarkus}/Application.java (68%) copy camel-k-quarkus/camel-k-quarkus-itests/{camel-k-quarkus-itests-loader-xml => camel-k-quarkus-itests-loader-groovy}/src/main/resources/application.properties (89%) copy camel-k-quarkus/camel-k-quarkus-itests/{camel-k-quarkus-itests-loader-xml/src/test/java/org/apache/camel/k/loader/xml/quarkus/deployment => camel-k-quarkus-itests-loader-groovy/src/test/java/org/apache/camel/k/loader/yaml/quarkus}/ExtensionTest.java (90%) copy {examples/camel-k-runtime-example-quarkus-groovy/data => camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-loader-groovy/src/test/resources}/routes.groovy (92%) copy camel-k-quarkus/camel-k-quarkus-itests/{camel-k-quarkus-itests-core => camel-k-quarkus-itests-loader-java}/pom.xml (90%) copy camel-k-quarkus/camel-k-quarkus-itests/{camel-k-quarkus-itests-cron/src/main/java/org/apache/camel/k/quarkus/cron/deployment => camel-k-quarkus-itests-loader-java/src/main/java/org/apache/camel/k/loader/java/quarkus}/Application.java (68%) copy camel-k-quarkus/camel-k-quarkus-itests/{camel-k-quarkus-itests-loader-xml => camel-k-quarkus-itests-loader-java}/src/main/resources/application.properties (89%) copy camel-k-quarkus/camel-k-quarkus-itests/{camel-k-quarkus-itests-loader-xml/src/test/java/org/apache/camel/k/loader/xml/quarkus/deployment =&g
[camel-k-runtime] 01/02: [quarkus] add tests for jvm only loaders #215
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git commit 16070e564ee4aca1e05366f5fad1859f62d4754a Author: lburgazzoli AuthorDate: Mon Aug 17 14:16:12 2020 +0200 [quarkus] add tests for jvm only loaders #215 --- .../src/main/resources/application.properties | 8 +- .../src/main/resources/application.properties | 11 +-- .../src/main/resources/application.properties | 11 +-- .../pom.xml| 22 +- .../camel/k/loader/yaml/quarkus/Application.java | 45 +++ .../src/main/resources/application.properties | 8 +- .../k/loader/yaml/quarkus}/ExtensionTest.java | 10 ++- .../src/test/resources/routes.groovy} | 9 +-- .../pom.xml| 22 +- .../camel/k/loader/java/quarkus/Application.java | 45 +++ .../src/main/resources/application.properties | 8 +- .../camel/k/loader/java/java}/ExtensionTest.java | 12 +-- .../src/test/resources/MyRoutes.java} | 13 ++-- .../camel-k-quarkus-itests-loader-js/pom.xml | 18 + .../camel/k/loader/js/quarkus/Application.java | 45 +++ .../loader/js/quarkus/deployment/Application.java | 89 -- .../src/main/resources/application.properties | 11 +-- .../js/quarkus/{deployment => }/ExtensionIT.java | 2 +- .../js/quarkus/{deployment => }/ExtensionTest.java | 2 +- .../pom.xml| 38 + .../camel/k/loader/support/LoaderSupport.java} | 45 +-- .../camel-k-quarkus-itests-loader-xml/pom.xml | 18 + .../camel/k/loader/xml/quarkus/Application.java| 45 +++ .../src/main/resources/application.properties | 7 +- .../xml/quarkus/{deployment => }/ExtensionIT.java | 2 +- .../quarkus/{deployment => }/ExtensionTest.java| 2 +- .../camel-k-quarkus-itests-loader-yaml/pom.xml | 18 + .../camel/k/loader/yaml/quarkus/Application.java | 45 +++ .../yaml/quarkus/deployment/Application.java | 87 - .../src/main/resources/application.properties | 11 +-- .../yaml/quarkus/{deployment => }/ExtensionIT.java | 2 +- .../quarkus/{deployment => }/ExtensionTest.java| 2 +- .../camel-k-quarkus-itests-polyglot/pom.xml| 14 +--- .../k/itests/polyglot/quarkus/Application.java | 43 +-- .../src/main/resources/application.properties | 12 +-- camel-k-quarkus/camel-k-quarkus-itests/pom.xml | 3 + pom.xml| 10 ++- 37 files changed, 335 insertions(+), 460 deletions(-) diff --git a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/main/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/main/resources/application.properties index d43bc0b..73989eb 100644 --- a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/main/resources/application.properties +++ b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-core/src/main/resources/application.properties @@ -14,14 +14,8 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --- + # # Quarkus # -quarkus.log.file.enable= false -quarkus.log.console.enable = false quarkus.banner.enabled = false - -# -# Camel -# -camel.context.name = camel-k-quarkus-ctx diff --git a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-cron/src/main/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-cron/src/main/resources/application.properties index 2958915..a775e51 100644 --- a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-cron/src/main/resources/application.properties +++ b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-cron/src/main/resources/application.properties @@ -14,11 +14,10 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --- + # # Quarkus # -quarkus.log.file.enable= false -quarkus.log.console.enable = true quarkus.banner.enabled = false # @@ -26,11 +25,3 @@ quarkus.banner.enabled = false # quarkus.camel.main.routes-discovery.enabled = false -# -# Camel -# -camel.context.name = camel-k-quarkus-ctx - -# -# Integration -# diff --git a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-knative/src/main/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-knative/src/main/resources/application.properties index b4cc6d4..a775e51 100644 --- a/camel-k-quark
[camel-k-runtime] branch master updated: Upgrade to camel-quarkus v1.0.0
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 64205ee Upgrade to camel-quarkus v1.0.0 64205ee is described below commit 64205ee3839bdfd1659b7862c119a0c0616d5695 Author: lburgazzoli AuthorDate: Mon Aug 10 13:50:31 2020 +0200 Upgrade to camel-quarkus v1.0.0 --- pom.xml | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 927264e..d3d21b5 100644 --- a/pom.xml +++ b/pom.xml @@ -38,8 +38,8 @@ 11 11 -3.4.0 -1.0.0-CR3 +3.4.2 +1.0.0 ${camel.version} 5.6.2 0.9.13 @@ -61,7 +61,7 @@ 3.1.0 3.9.2 20.1.0 -1.6.0.Final +1.7.0.Final 2.2.1.Final 1.11.1 4.3.1 @@ -271,7 +271,7 @@ false - +
[camel] branch master updated: Inprove PropertyBindingSupport (CAMEL-15396, CAMEL-15397)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli 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 ab54bed Inprove PropertyBindingSupport (CAMEL-15396, CAMEL-15397) ab54bed is described below commit ab54bed173977fa8d386a330002f2119b3441a3b Author: lburgazzoli AuthorDate: Tue Aug 11 17:20:12 2020 +0200 Inprove PropertyBindingSupport (CAMEL-15396, CAMEL-15397) This PR adds support for arrays in PropertyBindingSupport and fix issues when binding to list when properties have gaps. See tests in: - PropertyBindingSupportArrayTest - PropertyBindingSupportListTest --- .../camel/support/IntrospectionSupportTest.java| 30 ++ ...t.java => PropertyBindingSupportArrayTest.java} | 110 +++-- .../support/PropertyBindingSupportListTest.java| 51 +- .../support/PropertyBindingSupportMapTest.java | 2 +- .../apache/camel/support/IntrospectionSupport.java | 55 +-- .../camel/support/PropertyBindingSupport.java | 63 +++- .../camel/support/PropertyConfigurerHelper.java| 70 + 7 files changed, 336 insertions(+), 45 deletions(-) diff --git a/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java b/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java index 07fbe38..18ae51e 100644 --- a/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java @@ -564,4 +564,34 @@ public class IntrospectionSupportTest extends ContextTestSupport { assertEquals(ExampleBean.class, setters.get(0).getParameterTypes()[0]); assertEquals(String.class, setters.get(1).getParameterTypes()[0]); } + + +@Test +public void testArray() throws Exception { +MyBeanWithArray target = new MyBeanWithArray(); +IntrospectionSupport.setProperty(context.getTypeConverter(), target, "names[0]", "James"); +IntrospectionSupport.setProperty(context.getTypeConverter(), target, "names[1]", "Claus"); +assertEquals("James", target.getNames()[0]); +assertEquals("Claus", target.getNames()[1]); + +IntrospectionSupport.setProperty(context.getTypeConverter(), target, "names[0]", "JamesX"); +assertEquals("JamesX", target.getNames()[0]); + +IntrospectionSupport.setProperty(context.getTypeConverter(), target, "names[2]", "Andrea"); +assertEquals("JamesX", target.getNames()[0]); +assertEquals("Claus", target.getNames()[1]); +assertEquals("Andrea", target.getNames()[2]); +} + +public class MyBeanWithArray { +private String[] names = new String[10]; + +public String[] getNames() { +return names; +} + +public void setNames(String[] names) { +this.names = names; +} +} } diff --git a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportListTest.java b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportArrayTest.java similarity index 59% copy from core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportListTest.java copy to core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportArrayTest.java index 83a1acc..88bf95b 100644 --- a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportListTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportArrayTest.java @@ -17,7 +17,6 @@ package org.apache.camel.support; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; import java.util.Properties; @@ -26,12 +25,15 @@ import org.apache.camel.ContextTestSupport; import org.apache.camel.PropertyBindingException; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.apache.camel.util.CollectionHelper.mapOf; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; /** * Unit test for PropertyBindingSupport */ -public class PropertyBindingSupportListTest extends ContextTestSupport { +public class PropertyBindingSupportArrayTest extends ContextTestSupport { @Override protected CamelContext createCamelContext() throws Exception { @@ -55,7 +57,7 @@ public class PropertyBindingSupportListTest extends ContextTestSupport { } @Test -public void testPropertiesList() throws Exception { +public void testP
[camel-k-runtime] branch master updated: Fixed properties test to use correct way of main configurations
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new a6b9283 Fixed properties test to use correct way of main configurations a6b9283 is described below commit a6b9283463a9f4e39afc62d8d595c150c17c5ad6 Author: Claus Ibsen AuthorDate: Thu Jul 30 10:54:54 2020 +0200 Fixed properties test to use correct way of main configurations --- .../src/test/java/org/apache/camel/k/main/PropertiesTest.java | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/camel-k-main/camel-k-runtime-main/src/test/java/org/apache/camel/k/main/PropertiesTest.java b/camel-k-main/camel-k-runtime-main/src/test/java/org/apache/camel/k/main/PropertiesTest.java index 90d5260..7349b84 100644 --- a/camel-k-main/camel-k-runtime-main/src/test/java/org/apache/camel/k/main/PropertiesTest.java +++ b/camel-k-main/camel-k-runtime-main/src/test/java/org/apache/camel/k/main/PropertiesTest.java @@ -122,11 +122,11 @@ public class PropertiesTest { @Test public void testContextConfiguration() throws Exception { Properties properties = new Properties(); -properties.setProperty("camel.context.message-history", "false"); -properties.setProperty("camel.context.load-type-converters", "false"); - properties.setProperty("camel.context.stream-caching-strategy.spool-threshold", "100"); -properties.setProperty("camel.context.rest-configuration.component", "servlet"); - properties.setProperty("camel.context.rest-configuration.context-path", "/my/path"); +properties.setProperty("camel.main.message-history", "false"); +properties.setProperty("camel.main.load-type-converters", "false"); +properties.setProperty("camel.main.stream-caching-spool-threshold", "100"); +properties.setProperty("camel.rest.component", "servlet"); +properties.setProperty("camel.rest.context-path", "/my/path"); ApplicationRuntime runtime = new ApplicationRuntime(); runtime.setProperties(properties);
[camel-k-runtime] branch master updated: Disable merge commits on pull requests
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 46e0b89 Disable merge commits on pull requests 46e0b89 is described below commit 46e0b890a9759a9b9439904eb86b2a8dd48b577b Author: lburgazzoli AuthorDate: Mon Aug 10 10:46:24 2020 +0200 Disable merge commits on pull requests --- .asf.yaml | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.asf.yaml b/.asf.yaml index 8a25305..b49348b 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -8,4 +8,8 @@ github: - serverless - knative - openshift -- operator \ No newline at end of file +- operator + enabled_merge_buttons: +merge: false +rebase: true +squash: true \ No newline at end of file
[camel-k-runtime] branch master updated: chore(test): cleanup yaml unit tests
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new af30d1b chore(test): cleanup yaml unit tests af30d1b is described below commit af30d1bdbfa2979f1fc8e7698647caa1274c0ccd Author: lburgazzoli AuthorDate: Thu Jul 23 14:24:26 2020 +0200 chore(test): cleanup yaml unit tests --- .../camel/k/loader/yaml/DefinitionsTest.groovy | 58 +++--- .../apache/camel/k/loader/yaml/RoutesTest.groovy | 44 .../apache/camel/k/loader/yaml/TestSupport.groovy | 12 +++-- 3 files changed, 59 insertions(+), 55 deletions(-) diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/DefinitionsTest.groovy b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/DefinitionsTest.groovy index 0397437..6db3a3f 100644 --- a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/DefinitionsTest.groovy +++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/DefinitionsTest.groovy @@ -37,11 +37,11 @@ class DefinitionsTest extends TestSupport { steps: - to: uri: "log:info" -'''.stripMargin('|') +''' def camelContext = new DefaultCamelContext() when: -camelContext.addRoutes(new YamlSourceLoader().builder(content)) +load(camelContext, content) then: camelContext.routeDefinitions[0].id == 'my-route-id' camelContext.routeDefinitions[0].group == 'my-route-group' @@ -62,11 +62,11 @@ class DefinitionsTest extends TestSupport { steps: - to: uri: "log:info" -'''.stripMargin('|') +''' def camelContext = new DefaultCamelContext() when: -camelContext.addRoutes(new YamlSourceLoader().builder(content)) +load(camelContext, content) then: camelContext.routeDefinitions[0].id == 'my-route-id' camelContext.routeDefinitions[0].group == 'my-route-group' @@ -100,11 +100,11 @@ class DefinitionsTest extends TestSupport { uri: "log:otherwise" - to: uri: "log:info" -'''.stripMargin('|') +''' def camelContext = new DefaultCamelContext() when: -camelContext.addRoutes(new YamlSourceLoader().builder(content)) +load(camelContext, content) then: camelContext.routeDefinitions[0].input.endpointUri == 'direct:start' @@ -136,20 +136,20 @@ class DefinitionsTest extends TestSupport { def "route with split"() { given: def content = ''' - - from: - uri: "direct:start" - steps: - - split: - tokenize: "," - steps: - - to: "log:split1" - - to: "log:split2" - - to: "log:info" -'''.stripMargin('|') + - from: + uri: "direct:start" + steps: + - split: + tokenize: "," + steps: + - to: "log:split1" + - to: "log:split2" + - to: "log:info" +''' def camelContext = new DefaultCamelContext() when: -camelContext.addRoutes(new YamlSourceLoader().builder(content)) +load(camelContext, content) then: camelContext.routeDefinitions[0].input.endpointUri == 'direct:start' camelContext.routeDefinitions[0].outputs.size() == 2 @@ -177,17 +177,17 @@ class DefinitionsTest extends TestSupport { def "flow style route with split"() { given: def content = ''' - - from: - uri: "direct:start" - steps: - - split: - tokenize: "," - - to: "log:info" -'''.stripMargin('|') +
[camel-k-runtime] branch master updated: Update groovy to v3.0.5
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 9a61431 Update groovy to v3.0.5 9a61431 is described below commit 9a61431ecdcb9a611f614f1c8be58365202844a1 Author: lburgazzoli AuthorDate: Thu Jul 23 09:53:44 2020 +0200 Update groovy to v3.0.5 --- .../apache/camel/k/loader/yaml/RoutesTest.groovy | 14 +-- ...st.groovy => RoutesWithPlaceholdersTest.groovy} | 10 .../apache/camel/k/loader/yaml/TestSupport.groovy | 27 -- ...m.yaml => RoutesWithPlaceholdersTest_from.yaml} | 0 yaml => RoutesWithPlaceholdersTest_route.yaml} | 0 ..._to.yaml => RoutesWithPlaceholdersTest_to.yaml} | 0 ...od.yaml => RoutesWithPlaceholdersTest_tod.yaml} | 0 pom.xml| 2 +- 8 files changed, 22 insertions(+), 31 deletions(-) diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesTest.groovy b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesTest.groovy index 29263cd..5eb5f6d 100644 --- a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesTest.groovy +++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesTest.groovy @@ -25,7 +25,7 @@ class RoutesTest extends TestSupport { def 'split'() { setup: -def context = startContext() +def context = startContextForSpec() mockEndpoint(context,'mock:split') { expectedMessageCount = 3 @@ -52,7 +52,7 @@ class RoutesTest extends TestSupport { def 'filter'() { setup: -def context = startContext() +def context = startContextForSpec() mockEndpoint(context, 'mock:route') { expectedMessageCount 2 @@ -81,7 +81,7 @@ class RoutesTest extends TestSupport { def 'aggregator'() { setup: -def context = startContext { +def context = startContextForSpec { registry.bind('aggregatorStrategy', new UseLatestAggregationStrategy()) } @@ -104,7 +104,7 @@ class RoutesTest extends TestSupport { def 'idempotentConsumer'() { setup: -def context = startContext { +def context = startContextForSpec { registry.bind('myRepo', new MemoryIdempotentRepository()) } @@ -132,7 +132,7 @@ class RoutesTest extends TestSupport { def 'onExceptionHandled'() { setup: -def context = startContext { +def context = startContextForSpec { registry.bind('myFailingProcessor', new MyFailingProcessor()) } when: @@ -145,7 +145,7 @@ class RoutesTest extends TestSupport { def 'errorHandler'() { setup: -def context = startContext { +def context = startContextForSpec { registry.bind('myFailingProcessor', new MyFailingProcessor()) } @@ -162,7 +162,7 @@ class RoutesTest extends TestSupport { def 'bean'() { setup: -def context = startContext() +def context = startContextForSpec() when: def out = context.createProducerTemplate().requestBody('direct:route', 'test'); then: diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RouteWithPlaceholdersTest.groovy b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesWithPlaceholdersTest.groovy similarity index 93% rename from camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RouteWithPlaceholdersTest.groovy rename to camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesWithPlaceholdersTest.groovy index eece082..1e7f2ea 100644 --- a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RouteWithPlaceholdersTest.groovy +++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesWithPlaceholdersTest.groovy @@ -18,7 +18,7 @@ package org.apache.camel.k.loader.yaml import org.apache.camel.component.direct.DirectEndpoint -class RouteWithPlaceholdersTest extends TestSupport { +class RoutesWithPlaceholdersTest extends TestSupport { def 'route'() { setup: def parameters = [ @@ -26,7 +26,7 @@ class RouteWithPlaceholdersTest extends TestSupport { 'direct.ti
[camel-k] branch master updated: Initial architecture documentation
This is an automated email from the ASF dual-hosted git repository. lburgazzoli 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 acf50e8 Initial architecture documentation acf50e8 is described below commit acf50e8a968ec6235859374cb0f1a8f01ac64ff4 Author: lburgazzoli AuthorDate: Wed Jul 8 19:08:54 2020 +0200 Initial architecture documentation --- docs/modules/ROOT/assets/diagrams/README.adoc | 4 ++ .../diagrams/camel-k-operator-control-loop.drawio | 1 + .../diagrams/camel-k-state-machine-basic.drawio| 1 + .../diagrams/camel-k-state-machine-build.drawio| 1 + ...mel-k-state-machine-integration-platform.drawio | 1 + .../camel-k-state-machine-integration.drawio | 1 + .../camel-k-state-machine-integrationkit.drawio| 1 + .../assets/diagrams/operator-control-loop.drawio | 1 + .../architecture/camel-k-operator-control-loop.png | Bin 0 -> 15493 bytes .../images/architecture/camel-k-operator.jpg | Bin 0 -> 116514 bytes .../images/architecture/camel-k-runtimes.jpg | Bin 0 -> 121360 bytes .../architecture/camel-k-state-machine-basic.png | Bin 0 -> 12740 bytes .../architecture/camel-k-state-machine-build.png | Bin 0 -> 21947 bytes .../camel-k-state-machine-integration-platform.png | Bin 0 -> 38794 bytes .../camel-k-state-machine-integration.png | Bin 0 -> 56904 bytes .../camel-k-state-machine-integrationkit.png | Bin 0 -> 28205 bytes .../assets/images/architecture/camel-k-traits.jpg | Bin 0 -> 139978 bytes .../ROOT/assets/images/architecture/camel-k.jpg| Bin 0 -> 129474 bytes .../images/architecture/operator-control-loop.png | Bin 0 -> 4923 bytes docs/modules/ROOT/nav.adoc | 9 .../ROOT/pages/architecture/architecture.adoc | 11 + docs/modules/ROOT/pages/architecture/cr/build.adoc | 27 .../ROOT/pages/architecture/cr/camel-catalog.adoc | 9 .../pages/architecture/cr/integration-kit.adoc | 34 ++ .../architecture/cr/integration-platform.adoc | 35 +++ .../ROOT/pages/architecture/cr/integration.adoc| 36 +++ docs/modules/ROOT/pages/architecture/operator.adoc | 49 + docs/modules/ROOT/pages/architecture/runtime.adoc | 6 +++ docs/modules/ROOT/pages/architecture/traits.adoc | 6 +++ 29 files changed, 233 insertions(+) diff --git a/docs/modules/ROOT/assets/diagrams/README.adoc b/docs/modules/ROOT/assets/diagrams/README.adoc new file mode 100644 index 000..aa50d57 --- /dev/null +++ b/docs/modules/ROOT/assets/diagrams/README.adoc @@ -0,0 +1,4 @@ +Diagrams + + +Files generated by https://app.diagrams.net diff --git a/docs/modules/ROOT/assets/diagrams/camel-k-operator-control-loop.drawio b/docs/modules/ROOT/assets/diagrams/camel-k-operator-control-loop.drawio new file mode 100644 index 000..edc8c7c --- /dev/null +++ b/docs/modules/ROOT/assets/diagrams/camel-k-operator-control-loop.drawio @@ -0,0 +1 @@ +5VnblpowFP0aH+0CIoiPXjtd09uqD50+ZiADaQNxYhixX98Ewk3QwRlHdKprabKTkGSffQ4n0APTIP7I4Mr/Ql1Eeobmxj0w6xnGyNTFrwS2KWACIwU8ht0U0gtgif8iBWoKjbCL1pWOnFLC8aoKOjQMkcMrGGSMbqrdHiipzrqCHqoBSweSOvoTu9xPUdvUCvwGYc/PZtY11RLArLMC1j506aYEgXkPTBmlPC0F8RQRyV3GSzpusac1XxhDIW8zwKN0YC8W4eaxzyYj3B+Hy7ivj9LLPEESqR2r1fJtRg [...] \ No newline at end of file diff --git a/docs/modules/ROOT/assets/diagrams/camel-k-state-machine-basic.drawio b/docs/modules/ROOT/assets/diagrams/camel-k-state-machine-basic.drawio new file mode 100644 index 000..06d5c0a --- /dev/null +++ b/docs/modules/ROOT/assets/diagrams/camel-k-state-machine-basic.drawio @@ -0,0 +1 @@ +7VjbctsgEP0aPzajq2M9JnbSZKadpvV02j4SaS3RYKFByJd8fRcZWUg4sevGM562cR7gsCxwzoIWBv54vnovSJF95Amwgeckq4E/GXieG3jeQP07yXqDjNxwA6SCJtqoBab0GTToaLSiCZQdQ8k5k7TogjHPc4hlByNC8GXXbMZZd9SCpGAB05gwG/1GE5npVYROi98BTbNmZNfRLXPSGGugzEjClwbk3wz8seBcbkrz1RiYIq/hZdPv9oXW7cQE5PKQDpO75x/xPf30/PVnSL7zWRx9/fzO33hZEFbpBV [...] \ No newline at end of file diff --git a/docs/modules/ROOT/assets/diagrams/camel-k-state-machine-build.drawio b/docs/modules/ROOT/assets/diagrams/camel-k-state-machine-build.drawio new file mode 100644 index 000..f14deed --- /dev/null +++ b/docs/modules/ROOT/assets/diagrams/camel-k-state-machine-build.drawio @@ -0,0 +1 @@ +7VtZc+I4EP41PCblS8Y8Bkgme2SWGaYqM09Tii1AFWF5bTmB/fUr2fItAwE7RwWoSqyW1Ja7v+5PhxmYk/XmSwiD1R31EBkYmrcZmNOBYYyAzv8KwTYVANNIBcsQe6lILwRz/B+SQk1KY+yhqNKQUUoYDqpCl/o+cllFBsOQPlebLSip3jWAS9QQzF1ImtJ77LFVKnWAVshvEV6usjvrmqxZw6yxFEQr6NHnksi8HpiTkFKWXq03E0SE7TK7pP1uWmrzgYXIZ4d0uP46C378dXs3iy/+HN9PAme7wRdSyx [...] \ No newline at end of file diff --git a/docs/modules/ROOT/assets/diagrams/camel-k-state-machine-integration-platform.drawio b/docs/modules/ROOT/assets/diagrams/camel-k-state-machine-integration-platform.drawio new file mode 100644 index 000..623ef52
[camel-k-runtime] branch master updated: Upgrade Commons Lang to version 3.11
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 3957573 Upgrade Commons Lang to version 3.11 3957573 is described below commit 395757353dffbdf4132f54cdaf9e7984c657195d Author: Andrea Cosentino AuthorDate: Mon Jul 20 11:30:52 2020 +0200 Upgrade Commons Lang to version 3.11 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 73f3ad0..36c9853 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ ${camel.version} 5.6.2 0.9.13 -3.10 +3.11 1.8 1.14 2.7.0
[camel-k-runtime] branch master updated: chore(deps): update vert.x to v3.9.1
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 7df9456 chore(deps): update vert.x to v3.9.1 7df9456 is described below commit 7df94567835fcd34a21c3840cea90e43e52a159b Author: lburgazzoli AuthorDate: Sat Jul 18 14:22:50 2020 +0200 chore(deps): update vert.x to v3.9.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3408cb9..3318067 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 2.3.0.1 2.8.8 3.1.0 -3.9.0 +3.9.1 20.1.0 1.6.0.Final 2.2.1.Final
[camel-k-runtime] branch master updated (f86dc3a -> 945db96)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from f86dc3a Merge pull request #403 from apache/jandex-2.2.1 add 945db96 [kotlin] compile scripts wit the same target level used to compile the loader No new revisions were added by this update. Summary of changes: camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml | 6 +++--- .../camel/k/loader/kotlin/KotlinCompilationConfiguration.kt | 9 - pom.xml | 1 - 3 files changed, 11 insertions(+), 5 deletions(-)
[camel-k-runtime] branch master updated: camel-knative: don't replace message when the producers completes #399
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new b72dc22 camel-knative: don't replace message when the producers completes #399 b72dc22 is described below commit b72dc22bd925e07c598ea512078b3f492b45534f Author: lburgazzoli AuthorDate: Thu Jul 16 11:17:39 2020 +0200 camel-knative: don't replace message when the producers completes #399 --- .../knative/http/KnativeHttpConsumer.java | 5 + .../knative/http/KnativeHttpProducer.java | 9 +- .../component/knative/http/KnativeHttpSupport.java | 51 +-- .../knative/http/KnativeHttpTransport.java | 8 +- .../component/knative/http/KnativeHttpServer.java | 33 +- .../component/knative/http/KnativeHttpTest.java| 507 +++-- .../knative/http/KnativeHttpTestSupport.java | 4 + .../http/assertions/HttpServerRequestAssert.java | 66 +++ .../component/knative/KnativeConfiguration.java| 6 +- 9 files changed, 405 insertions(+), 284 deletions(-) diff --git a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java index fc83036..fb60431 100644 --- a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java +++ b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java @@ -287,6 +287,11 @@ public class KnativeHttpConsumer extends DefaultConsumer { } } } + + KnativeHttpSupport.remapCloudEventHeaders(configuration.getCloudEvent(), message); +if (configuration.isRemoveCloudEventHeadersInReply()) { + KnativeHttpSupport.removeCloudEventHeaders(configuration.getCloudEvent(), message); +} } return response; diff --git a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java index 67045d1..ca23300 100644 --- a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java +++ b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java @@ -35,7 +35,6 @@ import org.apache.camel.Message; import org.apache.camel.component.knative.spi.KnativeEnvironment; import org.apache.camel.spi.HeaderFilterStrategy; import org.apache.camel.support.DefaultAsyncProducer; -import org.apache.camel.support.DefaultMessage; import org.apache.camel.support.MessageHelper; import org.apache.camel.util.ObjectHelper; import org.apache.camel.util.URISupport; @@ -117,18 +116,20 @@ public class KnativeHttpProducer extends DefaultAsyncProducer { .sendBuffer(Buffer.buffer(payload), response -> { if (response.succeeded()) { HttpResponse result = response.result(); +Message answer = exchange.getMessage(); -Message answer = new DefaultMessage(exchange.getContext()); answer.setHeader(Exchange.HTTP_RESPONSE_CODE, result.statusCode()); for (Map.Entry entry : result.headers().entries()) { if (!headerFilterStrategy.applyFilterToExternalHeaders(entry.getKey(), entry.getValue(), exchange)) { - KnativeHttpSupport.appendHeader(answer.getHeaders(), entry.getKey(), entry.getValue()); +answer.setHeader(entry.getKey(), entry.getValue()); } } if (result.body() != null) { answer.setBody(result.body().getBytes()); +} else { +answer.setBody(null); } if (result.statusCode() < 200 || result.statusCode() >= 300) { @@ -143,8 +144,6 @@ public class KnativeHttpProducer extends DefaultAsyncProducer { } answer.setHeader(Exchange.HTTP_RESPONSE_CODE, result.statusCode()); - -exchange.setMessage(answer); } else if (response.failed()) { String exceptionMessage = "HTTP operation failed invoking " + URISupport.sanitizeUri(this.uri.get()); if (response.result() != null) { diff --git a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpSupport.java b/camel-knative/camel-knative-
[camel-k-examples] branch master updated: Add jettison dependency to correct marshalling
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new 70e5d0a Add jettison dependency to correct marshalling 70e5d0a is described below commit 70e5d0a35564862c413108d61cb5ec697e582e0b Author: mmelko AuthorDate: Fri Jul 17 11:31:49 2020 +0200 Add jettison dependency to correct marshalling --- 05-knative-source-jira/jira-new-issues.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/05-knative-source-jira/jira-new-issues.yaml b/05-knative-source-jira/jira-new-issues.yaml index ad9b476..e42cd09 100644 --- a/05-knative-source-jira/jira-new-issues.yaml +++ b/05-knative-source-jira/jira-new-issues.yaml @@ -16,6 +16,7 @@ spec: - mvn:org.apache.httpcomponents:httpclient:jar:4.5.12 - mvn:com.atlassian.jira:jira-rest-java-client-core:jar:5.2.1 - mvn:com.atlassian.jira:jira-rest-java-client-api:jar:5.2.1 +- mvn:org.codehaus.jettison:jettison:jar:1.4.1 flow: from: uri: jira:newIssues @@ -30,8 +31,7 @@ spec: steps: - to: "log:received?showAll=true&multiline=true" - marshal: - json: -disable-features: "FAIL_ON_EMPTY_BEANS" + json: {} sink: ref:
[camel-k-runtime] branch master updated (2dd373d -> 1264ec2)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from 2dd373d Include a test collecting all *.camelk.yaml files in the repository and validating it against the yaml schema #387 add 1264ec2 Add PR template No new revisions were added by this update. Summary of changes: .github/pull_request_template.md | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 .github/pull_request_template.md
[camel-k-examples] branch master updated: Added an SQS Source basic example
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new e953220 Added an SQS Source basic example e953220 is described below commit e953220bd1cbae92437d6c6b3fd0f420e3f30226 Author: Andrea Cosentino AuthorDate: Fri Jul 17 08:29:21 2020 +0200 Added an SQS Source basic example --- 07-aws-sqs-source-basic/aws-sqs-channel.yaml| 7 + 07-aws-sqs-source-basic/aws-sqs-consumer.groovy | 6 + 07-aws-sqs-source-basic/aws-sqs-producer.groovy | 9 ++ 07-aws-sqs-source-basic/aws-sqs-source.yaml | 37 + 07-aws-sqs-source-basic/aws-sqs.properties | 3 + 07-aws-sqs-source-basic/readme.didact.md| 183 07-aws-sqs-source-basic/readme.md | 1 + 7 files changed, 246 insertions(+) diff --git a/07-aws-sqs-source-basic/aws-sqs-channel.yaml b/07-aws-sqs-source-basic/aws-sqs-channel.yaml new file mode 100644 index 000..4d3 --- /dev/null +++ b/07-aws-sqs-source-basic/aws-sqs-channel.yaml @@ -0,0 +1,7 @@ +# +# Knative Channel +# +apiVersion: messaging.knative.dev/v1alpha1 +kind: InMemoryChannel +metadata: + name: aws-sqs diff --git a/07-aws-sqs-source-basic/aws-sqs-consumer.groovy b/07-aws-sqs-source-basic/aws-sqs-consumer.groovy new file mode 100644 index 000..35dfbc0 --- /dev/null +++ b/07-aws-sqs-source-basic/aws-sqs-consumer.groovy @@ -0,0 +1,6 @@ +// camel-k: dependency=camel-aws2-sqs dependency=camel-base64 +// +// Apache Camel SQS Consumer +// +from('knative:channel/aws-sqs') +.log('Received: ${body}') diff --git a/07-aws-sqs-source-basic/aws-sqs-producer.groovy b/07-aws-sqs-source-basic/aws-sqs-producer.groovy new file mode 100644 index 000..a9e38b6 --- /dev/null +++ b/07-aws-sqs-source-basic/aws-sqs-producer.groovy @@ -0,0 +1,9 @@ +// camel-k: dependency=camel-aws2-sqs +// +// Apache Camel SQS Producer +// +// This is just a sample producer for AWS that creates 100 messages every 3 seconds +from('timer:java?period=3000&repeatCount=30') +.setBody() +.simple('Hello Camel K') + .to('aws2-sqs:eventqueue?accessKey={{aws.sqs.accessKey}}&secretKey={{aws.sqs.secretKey}}®ion={{aws.sqs.region}}') diff --git a/07-aws-sqs-source-basic/aws-sqs-source.yaml b/07-aws-sqs-source-basic/aws-sqs-source.yaml new file mode 100644 index 000..adeea06 --- /dev/null +++ b/07-aws-sqs-source-basic/aws-sqs-source.yaml @@ -0,0 +1,37 @@ +# +# Apache Camel AWS Kinesis Source +# +apiVersion: sources.knative.dev/v1alpha1 +kind: CamelSource +metadata: + name: camel-aws-sqs-source +spec: + source: +integration: + configuration: +- type: secret + value: aws-sqs + dependencies: +# Needed for the json part on the flow/steps below +- camel:jackson +# Needed for the AWS Kinesis component +- camel:camel-aws2-sqs +flow: + from: +# On the URI below, the Kinesis stream named 'stream' can be adjusted +# to any value suitable in your scenario (ie.: aws-sqs:my-stream-name) +uri: aws2-sqs:eventqueue +parameters: + secretKey: "{{aws.sqs.secretKey}}" + accessKey: "{{aws.sqs.accessKey}}" + region: "{{aws.sqs.region}}" + deleteAfterRead: "false" +steps: +- to: "log:received?showAll=true&multiline=true" +- marshal: +json: {} + sink: +ref: + apiVersion: messaging.knative.dev/v1beta1 + kind: InMemoryChannel + name: aws-sqs diff --git a/07-aws-sqs-source-basic/aws-sqs.properties b/07-aws-sqs-source-basic/aws-sqs.properties new file mode 100644 index 000..a072f05 --- /dev/null +++ b/07-aws-sqs-source-basic/aws-sqs.properties @@ -0,0 +1,3 @@ +aws.sqs.accessKey=accesskey +aws.sqs.secretKey=secretkey +aws.sqs.region=region diff --git a/07-aws-sqs-source-basic/readme.didact.md b/07-aws-sqs-source-basic/readme.didact.md new file mode 100644 index 000..7ccfbcd --- /dev/null +++ b/07-aws-sqs-source-basic/readme.didact.md @@ -0,0 +1,183 @@ +# Camel AWS SQS Source Basic Example + +This example demonstrates how to get started with Camel based Knative sources by showing you some of the most important +features that you should know before trying to develop more complex examples. + +You can find more information about Apache Camel and Apache Camel K on the [official Camel website](https://camel.apache.org). + +## Before you begin + +Read the general instructions in the [root README.md file](../README.md) for setting up your environment and the Kubernetes cluster before looking at this example. + +Make sure you've read the [installation instructions](https://camel.apache.org/camel-k/latest/installatio
[camel-quarkus] branch master updated: Reproducer for #1459
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git The following commit(s) were added to refs/heads/master by this push: new 44d1b79 Reproducer for #1459 44d1b79 is described below commit 44d1b7964062db79b762e11b1ec31b231ce11128 Author: lburgazzoli AuthorDate: Wed Jul 8 14:50:47 2020 +0200 Reproducer for #1459 --- .../org/apache/camel/quarkus/component/bean/CamelResource.java | 8 .../org/apache/camel/quarkus/component/bean/CamelRoute.java| 4 .../apache/camel/quarkus/component/bean/WithHandlerBean.java | 5 + .../java/org/apache/camel/quarkus/component/bean/BeanTest.java | 10 ++ 4 files changed, 27 insertions(+) diff --git a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java index 7c52d6d..3c5ce29 100644 --- a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java +++ b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java @@ -71,6 +71,14 @@ public class CamelResource { return template.requestBody("direct:handler", statement, String.class); } +@Path("/handlerOnProxy") +@POST +@Consumes(MediaType.TEXT_PLAIN) +@Produces(MediaType.TEXT_PLAIN) +public String handlerOnProxy(String statement) { +return template.requestBody("direct:handlerOnProxy", statement, String.class); +} + @Path("/increment") @GET @Produces(MediaType.TEXT_PLAIN) diff --git a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelRoute.java b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelRoute.java index acef305..70cf606 100644 --- a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelRoute.java +++ b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelRoute.java @@ -76,6 +76,10 @@ public class CamelRoute extends RouteBuilder { .to("bean:withHandler") .to("log:named"); +from("direct:handlerOnProxy") +.to("bean:withHandlerOnProxy") +.to("log:named"); + } @SuppressWarnings("unchecked") diff --git a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/WithHandlerBean.java b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/WithHandlerBean.java index 806617c..1a38b4d 100644 --- a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/WithHandlerBean.java +++ b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/WithHandlerBean.java @@ -16,10 +16,15 @@ */ package org.apache.camel.quarkus.component.bean; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Named; + import io.quarkus.runtime.annotations.RegisterForReflection; import org.apache.camel.Exchange; import org.apache.camel.Handler; +@ApplicationScoped +@Named("withHandlerOnProxy") @RegisterForReflection public class WithHandlerBean { /** diff --git a/integration-tests/bean/src/test/java/org/apache/camel/quarkus/component/bean/BeanTest.java b/integration-tests/bean/src/test/java/org/apache/camel/quarkus/component/bean/BeanTest.java index 42a50ae..eaaf287 100644 --- a/integration-tests/bean/src/test/java/org/apache/camel/quarkus/component/bean/BeanTest.java +++ b/integration-tests/bean/src/test/java/org/apache/camel/quarkus/component/bean/BeanTest.java @@ -69,6 +69,16 @@ public class BeanTest { } @Test +public void handlerWithProxy() { +RestAssured.given() +.contentType(ContentType.TEXT) +.body("Kermit") +.post("/bean/handlerOnProxy") +.then() +.body(equalTo("Hello Kermit from the WithHandlerBean")); +} + +@Test public void inject() { /* Ensure that @Inject works */
[camel-k-runtime] branch master updated: Include a test collecting all *.camelk.yaml files in the repository and validating it against the yaml schema #387
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 2dd373d Include a test collecting all *.camelk.yaml files in the repository and validating it against the yaml schema #387 2dd373d is described below commit 2dd373d177043d95b143fc0bdc69874261f69177 Author: lburgazzoli AuthorDate: Thu Jul 16 16:46:36 2020 +0200 Include a test collecting all *.camelk.yaml files in the repository and validating it against the yaml schema #387 --- camel-k-loader-yaml/camel-k-loader-yaml/pom.xml| 6 +++ .../k/loader/yaml/RoutesValidationTest.groovy | 53 ++ .../resources/routes/RoutesTest_aggregator.yaml| 2 +- pom.xml| 1 + 4 files changed, 61 insertions(+), 1 deletion(-) diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml b/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml index 63f07ab..d839228 100644 --- a/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml +++ b/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml @@ -100,6 +100,12 @@ camel-bean test + +com.github.java-json-tools +json-schema-validator +${json-schema-validator} +test + org.spockframework diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesValidationTest.groovy b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesValidationTest.groovy new file mode 100644 index 000..2d39b09 --- /dev/null +++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesValidationTest.groovy @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.k.loader.yaml + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory +import com.github.fge.jackson.JsonLoader +import com.github.fge.jsonschema.main.JsonSchemaFactory +import spock.lang.Specification +import spock.lang.Unroll + +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.Paths + +class RoutesValidationTest extends Specification { +static def MAPPER = new ObjectMapper(new YAMLFactory()) +static def SCHEMA_RES = JsonLoader.fromResource('/camel-yaml-dsl.json') +static def SCHEMA = JsonSchemaFactory.byDefault().getJsonSchema(SCHEMA_RES) + +@Unroll +def 'validate'(Path source) { +given: +def target = MAPPER.readTree(source.toFile()) +when: +def report = SCHEMA.validate(target) +then: +report.isSuccess() +where: +source << routes() +} + +def routes() { +def routes = getClass().getResource("/routes").toURI() +def paths = Paths.get(routes) + +return Files.list(paths) +} +} diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/resources/routes/RoutesTest_aggregator.yaml b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/resources/routes/RoutesTest_aggregator.yaml index 1634826..9b6e9d9 100644 --- a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/resources/routes/RoutesTest_aggregator.yaml +++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/resources/routes/RoutesTest_aggregator.yaml @@ -19,7 +19,7 @@ steps: - aggregate: strategy-ref: "aggregatorStrategy" - completion-size: 2 + completion-size: "2" correlation-expression: simple: "${header.StockSymbol}" - to: "mock:route" \ No newline at end of file diff --git a/pom.xml b/pom.xml index 0f38955..732058c 100644 --- a/pom.xml +++ b/pom.xml @@ -68,6 +68,7 @@ 4.3.1 2.2 1.2.0 +2.2.14 1.9.0 3.8.1
[camel-quarkus] branch master updated: Upgrade to Apache Camel 3.4.1
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git The following commit(s) were added to refs/heads/master by this push: new c785c51 Upgrade to Apache Camel 3.4.1 c785c51 is described below commit c785c5145dc84c40e630ad382197fa68eae8a81b Author: lburgazzoli AuthorDate: Thu Jul 16 14:17:33 2020 +0200 Upgrade to Apache Camel 3.4.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5069db3..49b1e41 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ 1.11.714 1.11.22 2.13.33 -3.4.0 +3.4.1 1.2.0.Final 7.6.1 2.3.30
[camel-k-runtime] branch master updated: publish the camel-k catalog as artifact #388
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new d9468dd publish the camel-k catalog as artifact #388 d9468dd is described below commit d9468dd40a3d7440948cefe0ebf78bbd64563bbf Author: lburgazzoli AuthorDate: Thu Jul 16 14:52:27 2020 +0200 publish the camel-k catalog as artifact #388 --- tooling/camel-k-catalog/pom.xml | 94 + tooling/pom.xml | 1 + 2 files changed, 95 insertions(+) diff --git a/tooling/camel-k-catalog/pom.xml b/tooling/camel-k-catalog/pom.xml new file mode 100644 index 000..4626726 --- /dev/null +++ b/tooling/camel-k-catalog/pom.xml @@ -0,0 +1,94 @@ + +http://maven.apache.org/POM/4.0.0"; + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";> + +org.apache.camel.k +camel-k-tooling +1.5.0-SNAPSHOT + + +4.0.0 +camel-k-catalog + + +generate-resources + + +org.codehaus.mojo +build-helper-maven-plugin +${build-helper-maven-plugin.version} + + +attach-artifacts +package + +attach-artifact + + + + + ${project.build.directory}/camel-k-catalog-${project.version}-main.yaml +yaml +main + + + ${project.build.directory}/camel-k-catalog-${project.version}-quarkus.yaml +yaml +quarkus + + + + + + + +org.apache.camel.k +camel-k-maven-plugin +${project.version} + + +generate-catalog-main + +generate-catalog + + +${project.build.directory} + camel-k-catalog-${project.version}-main.yaml +main + + + +generate-catalog-quarkus + +generate-catalog + + +${project.build.directory} + camel-k-catalog-${project.version}-quarkus.yaml +quarkus + + + + + + + + diff --git a/tooling/pom.xml b/tooling/pom.xml index bff89a9..d6f3e7d 100644 --- a/tooling/pom.xml +++ b/tooling/pom.xml @@ -33,6 +33,7 @@ camel-k-apt camel-k-maven-plugin camel-k-test +camel-k-catalog
[camel-k-runtime] branch master updated: publish the camel-k yaml dsl schema as artifact #389
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 426adca publish the camel-k yaml dsl schema as artifact #389 426adca is described below commit 426adca78af6337d467b07129e2b80c5966036ee Author: lburgazzoli AuthorDate: Thu Jul 16 09:11:02 2020 +0200 publish the camel-k yaml dsl schema as artifact #389 --- camel-k-loader-yaml/camel-k-loader-yaml/pom.xml | 16 1 file changed, 16 insertions(+) diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml b/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml index b82ce2c..63f07ab 100644 --- a/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml +++ b/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml @@ -143,6 +143,22 @@ + +attach-artifacts +package + +attach-artifact + + + + + ${project.basedir}/src/generated/resources/camel-yaml-dsl.json +json +json-schema + + + +
[camel-k-examples] 02/02: Renamed the stuff to reflect S3 is the source
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git commit 112fa79df6a616e80b46e9e1b92affdaede814d8 Author: Andrea Cosentino AuthorDate: Thu Jul 16 08:59:30 2020 +0200 Renamed the stuff to reflect S3 is the source --- .../aws-kinesis-firehose-producer.groovy | 0 .../aws-s3-channel.yaml | 0 .../aws-s3-consumer.groovy| 0 .../aws-s3-source.yaml| 0 .../aws-services.properties | 0 .../readme.didact.md | 8 .../readme.md | 0 7 files changed, 4 insertions(+), 4 deletions(-) diff --git a/05-aws-kinesis-firehose-source-basic/aws-kinesis-firehose-producer.groovy b/06-aws-kinesis-firehose-basic/aws-kinesis-firehose-producer.groovy similarity index 100% rename from 05-aws-kinesis-firehose-source-basic/aws-kinesis-firehose-producer.groovy rename to 06-aws-kinesis-firehose-basic/aws-kinesis-firehose-producer.groovy diff --git a/05-aws-kinesis-firehose-source-basic/aws-s3-kinesis-firehose-channel.yaml b/06-aws-kinesis-firehose-basic/aws-s3-channel.yaml similarity index 100% rename from 05-aws-kinesis-firehose-source-basic/aws-s3-kinesis-firehose-channel.yaml rename to 06-aws-kinesis-firehose-basic/aws-s3-channel.yaml diff --git a/05-aws-kinesis-firehose-source-basic/aws-s3-consumer.groovy b/06-aws-kinesis-firehose-basic/aws-s3-consumer.groovy similarity index 100% rename from 05-aws-kinesis-firehose-source-basic/aws-s3-consumer.groovy rename to 06-aws-kinesis-firehose-basic/aws-s3-consumer.groovy diff --git a/05-aws-kinesis-firehose-source-basic/aws-s3-kinesis-firehose-source.yaml b/06-aws-kinesis-firehose-basic/aws-s3-source.yaml similarity index 100% rename from 05-aws-kinesis-firehose-source-basic/aws-s3-kinesis-firehose-source.yaml rename to 06-aws-kinesis-firehose-basic/aws-s3-source.yaml diff --git a/05-aws-kinesis-firehose-source-basic/aws-services.properties b/06-aws-kinesis-firehose-basic/aws-services.properties similarity index 100% rename from 05-aws-kinesis-firehose-source-basic/aws-services.properties rename to 06-aws-kinesis-firehose-basic/aws-services.properties diff --git a/05-aws-kinesis-firehose-source-basic/readme.didact.md b/06-aws-kinesis-firehose-basic/readme.didact.md similarity index 94% rename from 05-aws-kinesis-firehose-source-basic/readme.didact.md rename to 06-aws-kinesis-firehose-basic/readme.didact.md index cd6600c..8264d75 100644 --- a/05-aws-kinesis-firehose-source-basic/readme.didact.md +++ b/06-aws-kinesis-firehose-basic/readme.didact.md @@ -137,9 +137,9 @@ kubectl create secret generic aws-services --from-file=aws-services.properties As the example levareges [Knative Eventing channels](https://knative.dev/v0.15-docs/eventing/channels/), we need to create the one that the example will use: ``` -kubectl apply -f aws-s3-kinesis-firehose-channel.yaml +kubectl apply -f aws-s3-channel.yaml ``` -([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=camelTerm$$kubectl%20apply%20-f%20aws-s3-kinesis-firehose-channel.yaml&completion=inmemorychannel.messaging.knative.dev/aws-s3-kinesis-firehose$20created. "Create a Knative InMemoryChannel named aws-kinesis"){.didact}) +([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=camelTerm$$kubectl%20apply%20-f%20aws-s3-channel.yaml&completion=inmemorychannel.messaging.knative.dev/aws-s3$20created. "Create a Knative InMemoryChannel named aws-kinesis"){.didact}) ## 2. Running a Camel Source @@ -149,9 +149,9 @@ This repository contains a simple Camel Source based on the [AWS Kinesis compone Use the following command to deploy the Camel Source: ``` -kubectl apply -f aws-s3-kinesis-firehose-source.yaml +kubectl apply -f aws-s3-source.yaml ``` -([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=camelTerm$$kubectl%20apply%20-f%20aws-s3-kinesis-firehose-source.yaml&completion=camelsource.sources.knative.dev/camel-aws-s3-kinesis-firehose-source%20created. "Opens a new terminal and sends the command above"){.didact}) +([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=camelTerm$$kubectl%20apply%20-f%20aws-s3-source.yaml&completion=camelsource.sources.knative.dev/camel-aws-s3-source%20created. "Opens a new terminal and sends the command above"){.didact}) ## 2. Running a basic integration to create Kinesis events for consumption by the Camel Source diff --git a/05-aws-kinesis-firehose-source-basic/readme.md b/06-aws-kinesis-firehose-basic/readme.md similarity index 100% rename from 05-aws-kinesis-firehose-source-basic/readme.md rename to 06-aws-kinesis-firehose-basic/readme.md
[camel-k-examples] 01/02: Added an example of Kinesis Firehose with S3 bucket as destination
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git commit 3ea887cab3671fe8e8f1550817cc34625d3beb2f Author: Andrea Cosentino AuthorDate: Thu Jul 16 08:46:27 2020 +0200 Added an example of Kinesis Firehose with S3 bucket as destination --- .../aws-kinesis-firehose-producer.groovy | 9 + .../aws-s3-consumer.groovy | 8 + .../aws-s3-kinesis-firehose-channel.yaml | 7 + .../aws-s3-kinesis-firehose-source.yaml| 35 .../aws-services.properties| 6 + .../readme.didact.md | 184 + 05-aws-kinesis-firehose-source-basic/readme.md | 1 + 7 files changed, 250 insertions(+) diff --git a/05-aws-kinesis-firehose-source-basic/aws-kinesis-firehose-producer.groovy b/05-aws-kinesis-firehose-source-basic/aws-kinesis-firehose-producer.groovy new file mode 100644 index 000..34939ca --- /dev/null +++ b/05-aws-kinesis-firehose-source-basic/aws-kinesis-firehose-producer.groovy @@ -0,0 +1,9 @@ +// camel-k: dependency=camel-aws2-kinesis +// +// Apache Camel Kinesis Consumer +// +// This is just a sample producer for AWS that creates 100 messages every 3 seconds +from('timer:java?period=3000&repeatCount=100') +.setBody() +.simple('Hello Camel K') + .to('aws2-kinesis-firehose:stream?accessKey={{aws.kinesis.accessKey}}&secretKey={{aws.kinesis.secretKey}}®ion={{aws.kinesis.region}}') diff --git a/05-aws-kinesis-firehose-source-basic/aws-s3-consumer.groovy b/05-aws-kinesis-firehose-source-basic/aws-s3-consumer.groovy new file mode 100644 index 000..f58d8e3 --- /dev/null +++ b/05-aws-kinesis-firehose-source-basic/aws-s3-consumer.groovy @@ -0,0 +1,8 @@ +// camel-k: dependency=camel-aws2-s3 dependency=camel-base64 +// +// Apache Camel S3 Consumer +// + +// So we unmarshal it, extract the data element which is in base64 format and decode it +from('knative:channel/aws-s3-kinesis-firehose') +.log('Received: ${body}') diff --git a/05-aws-kinesis-firehose-source-basic/aws-s3-kinesis-firehose-channel.yaml b/05-aws-kinesis-firehose-source-basic/aws-s3-kinesis-firehose-channel.yaml new file mode 100644 index 000..f9f2fa7 --- /dev/null +++ b/05-aws-kinesis-firehose-source-basic/aws-s3-kinesis-firehose-channel.yaml @@ -0,0 +1,7 @@ +# +# Knative Channel +# +apiVersion: messaging.knative.dev/v1alpha1 +kind: InMemoryChannel +metadata: + name: aws-s3-kinesis-firehose diff --git a/05-aws-kinesis-firehose-source-basic/aws-s3-kinesis-firehose-source.yaml b/05-aws-kinesis-firehose-source-basic/aws-s3-kinesis-firehose-source.yaml new file mode 100644 index 000..d0ff2ae --- /dev/null +++ b/05-aws-kinesis-firehose-source-basic/aws-s3-kinesis-firehose-source.yaml @@ -0,0 +1,35 @@ +# +# Apache Camel AWS S3 Source +# +apiVersion: sources.knative.dev/v1alpha1 +kind: CamelSource +metadata: + name: camel-aws-s3-kinesis-firehose-source +spec: + source: +integration: + configuration: +- type: secret + value: aws-services + dependencies: +# Needed for the json part on the flow/steps below +- camel:jackson +# Needed for the AWS S3 component component +- camel:camel-aws2-s3 +flow: + from: +uri: aws2-s3:datalake25 +parameters: + secretKey: "{{aws.s3.secretKey}}" + accessKey: "{{aws.s3.accessKey}}" + region: "{{aws.s3.region}}" + moveAfterRead: "false" + deleteAfterRead: "false" + autocloseBody: "false" +steps: +- to: "log:received?showAll=true&multiline=true" + sink: +ref: + apiVersion: messaging.knative.dev/v1beta1 + kind: InMemoryChannel + name: aws-s3-kinesis-firehose diff --git a/05-aws-kinesis-firehose-source-basic/aws-services.properties b/05-aws-kinesis-firehose-source-basic/aws-services.properties new file mode 100644 index 000..20b72aa --- /dev/null +++ b/05-aws-kinesis-firehose-source-basic/aws-services.properties @@ -0,0 +1,6 @@ +aws.kinesis.accessKey=accessKey +aws.kinesis.secretKey=secretKey +aws.kinesis.region=region +aws.s3.accessKey=accessKey +aws.s3.secretKey=secretKey +aws.s3.region=region diff --git a/05-aws-kinesis-firehose-source-basic/readme.didact.md b/05-aws-kinesis-firehose-source-basic/readme.didact.md new file mode 100644 index 000..cd6600c --- /dev/null +++ b/05-aws-kinesis-firehose-source-basic/readme.didact.md @@ -0,0 +1,184 @@ +# Camel AWS Kinesis Firehose Source Basic Example + +This example demonstrates how to get started with Camel based Knative sources by showing you some of the most important +features that you should know before trying to develop more complex examples. + +You can find
[camel-k-examples] branch master updated (b3fc99b -> 112fa79)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git. from b3fc99b Added a note about the possibility of configuring the stream name new 3ea887c Added an example of Kinesis Firehose with S3 bucket as destination new 112fa79 Renamed the stuff to reflect S3 is the source 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: .../aws-kinesis-firehose-producer.groovy | 9 .../aws-s3-channel.yaml| 2 +- .../aws-s3-consumer.groovy | 8 06-aws-kinesis-firehose-basic/aws-s3-source.yaml | 35 .../aws-services.properties| 3 ++ .../readme.didact.md | 49 +++--- .../readme.md | 0 7 files changed, 80 insertions(+), 26 deletions(-) create mode 100644 06-aws-kinesis-firehose-basic/aws-kinesis-firehose-producer.groovy copy 03-knative-source-basic/telegram-channel.yaml => 06-aws-kinesis-firehose-basic/aws-s3-channel.yaml (75%) create mode 100644 06-aws-kinesis-firehose-basic/aws-s3-consumer.groovy create mode 100644 06-aws-kinesis-firehose-basic/aws-s3-source.yaml copy 04-aws-kinesis-source-basic/aws-kinesis.properties => 06-aws-kinesis-firehose-basic/aws-services.properties (54%) copy {04-aws-kinesis-source-basic => 06-aws-kinesis-firehose-basic}/readme.didact.md (73%) copy {11-knative-source-slack => 06-aws-kinesis-firehose-basic}/readme.md (100%)
[camel-k-examples] branch master updated: Added a note about the possibility of configuring the stream name
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new b3fc99b Added a note about the possibility of configuring the stream name b3fc99b is described below commit b3fc99b5fc071a2e0e64f3153d342eda9e896cd1 Author: Otavio Rodolfo Piske AuthorDate: Wed Jul 15 09:39:21 2020 +0200 Added a note about the possibility of configuring the stream name --- 04-aws-kinesis-source-basic/aws-kinesis-source.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/04-aws-kinesis-source-basic/aws-kinesis-source.yaml b/04-aws-kinesis-source-basic/aws-kinesis-source.yaml index 8bda7a1..cf6549f 100644 --- a/04-aws-kinesis-source-basic/aws-kinesis-source.yaml +++ b/04-aws-kinesis-source-basic/aws-kinesis-source.yaml @@ -19,6 +19,8 @@ spec: - mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/2.10.4 flow: from: +# On the URI below, the Kinesis stream named 'stream' can be adjusted +# to any value suitable in your scenario (ie.: aws-kinesis:my-stream-name) uri: aws-kinesis:stream parameters: secretKey: "{{aws.kinesis.secretKey}}"
[camel-k-runtime] branch master updated: [js] use proxy for global bindings
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 4a3a7b2 [js] use proxy for global bindings 4a3a7b2 is described below commit 4a3a7b291c4490a204b4e74b3c31add0f737bed3 Author: lburgazzoli AuthorDate: Wed Jul 15 19:30:56 2020 +0200 [js] use proxy for global bindings --- .../camel/k/loader/js/JavaScriptSourceLoader.java | 65 +- .../camel/k/loader/kotlin/KotlinSourceLoader.kt| 9 ++- .../src/main/java/org/apache/camel/k/Source.java | 12 .../org/apache/camel/k/support/RouteBuilders.java | 8 +-- 4 files changed, 59 insertions(+), 35 deletions(-) diff --git a/camel-k-loader-js/src/main/java/org/apache/camel/k/loader/js/JavaScriptSourceLoader.java b/camel-k-loader-js/src/main/java/org/apache/camel/k/loader/js/JavaScriptSourceLoader.java index f32ea0e..d8de8e4 100644 --- a/camel-k-loader-js/src/main/java/org/apache/camel/k/loader/js/JavaScriptSourceLoader.java +++ b/camel-k-loader-js/src/main/java/org/apache/camel/k/loader/js/JavaScriptSourceLoader.java @@ -16,8 +16,7 @@ */ package org.apache.camel.k.loader.js; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; +import java.io.Reader; import java.util.Collections; import java.util.List; @@ -29,10 +28,13 @@ import org.apache.camel.k.Source; import org.apache.camel.k.SourceLoader; import org.apache.camel.k.annotation.Loader; import org.apache.camel.k.loader.js.dsl.IntegrationConfiguration; +import org.apache.camel.k.support.RouteBuilders; import org.apache.camel.support.LifecycleStrategySupport; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Value; +import static org.graalvm.polyglot.Source.newBuilder; + @Loader("js") public class JavaScriptSourceLoader implements SourceLoader { private static final String LANGUAGE_ID = "js"; @@ -44,35 +46,46 @@ public class JavaScriptSourceLoader implements SourceLoader { @Override public Result load(Runtime runtime, Source source) throws Exception { -RoutesBuilder builder = new EndpointRouteBuilder() { -@Override -public void configure() throws Exception { -final Context context = Context.newBuilder("js").allowAllAccess(true).build(); +RoutesBuilder builder = RouteBuilders.endpoint(source, JavaScriptSourceLoader::doLoad); + +return SourceLoader.Result.on(builder); +} -try (InputStream is = source.resolveAsInputStream(getContext())) { -Value bindings = context.getBindings(LANGUAGE_ID); +private static void doLoad(Reader reader, EndpointRouteBuilder builder) { +final Context context = Context.newBuilder("js").allowAllAccess(true).build(); +final Value bindings = context.getBindings(LANGUAGE_ID); -// configure bindings -bindings.putMember("__dsl", new IntegrationConfiguration(this)); +// configure bindings +bindings.putMember("__dsl", new IntegrationConfiguration(builder)); -final String script = new String(is.readAllBytes(), StandardCharsets.UTF_8); -final String wrappedScript = "with (__dsl) { " + script + " }"; +// +// Expose IntegrationConfiguration methods to global scope. +// +context.eval(LANGUAGE_ID, "" ++ "Object.setPrototypeOf(globalThis, new Proxy(Object.prototype, {" ++ "has(target, key) {" ++ "return key in __dsl || key in target;" ++ "}," ++ "get(target, key, receiver) {" ++ "return Reflect.get((key in __dsl) ? __dsl : target, key, receiver);" ++ "}" ++ "}));"); -context.eval(LANGUAGE_ID, wrappedScript); +// +// Run the script. +// +context.eval( +newBuilder(LANGUAGE_ID, reader, "Unnamed").buildLiteral() +); -// -// Close the polyglot context when the camel context stops -// -getContext().addLifecycleStrategy(new LifecycleStrategySupport() { -@Override -public void onContextStop(CamelContext camelContext) { -context.close(true); -} -}); -} +// +// Close the polyglot context when the camel context stops +// +builder.getContext().addLifecycleStrategy(new LifecycleStrategySupport() { +
[camel-k-runtime] branch master updated: No type converter warning if final type of body is java.util.Map #390
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 7c7702f No type converter warning if final type of body is java.util.Map #390 7c7702f is described below commit 7c7702f6a5e305c2b0503794d42fd851893b2998 Author: lburgazzoli AuthorDate: Wed Jul 15 18:42:08 2020 +0200 No type converter warning if final type of body is java.util.Map #390 --- .../camel/component/knative/spi/Knative.java | 1 + .../component/knative/spi/KnativeEnvironment.java | 12 +++ .../knative/spi/KnativeTransportConfiguration.java | 8 +- .../knative/http/KnativeHttpConsumer.java | 45 .../knative/http/KnativeHttpProducer.java | 3 - .../knative/http/KnativeHttpTransport.java | 4 +- .../component/knative/http/KnativeHttpTest.java| 114 + .../knative/KnativeEndpointConfigurer.java | 3 + .../apache/camel/component/knative/knative.json| 1 + .../camel/component/knative/KnativeComponent.java | 11 +- .../component/knative/KnativeConfiguration.java| 13 +++ .../camel/component/knative/KnativeEndpoint.java | 20 +++- tooling/camel-k-test/pom.xml | 5 + 13 files changed, 198 insertions(+), 42 deletions(-) diff --git a/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/Knative.java b/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/Knative.java index a9dbbc0..dea93d9 100644 --- a/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/Knative.java +++ b/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/Knative.java @@ -29,6 +29,7 @@ public final class Knative { public static final String KNATIVE_EVENT_TYPE = "knative.event.type"; public static final String KNATIVE_KIND = "knative.kind"; public static final String KNATIVE_API_VERSION = "knative.apiVersion"; +public static final String KNATIVE_REPLY = "knative.reply"; public static final String CONTENT_TYPE = "content.type"; public static final String MIME_STRUCTURED_CONTENT_MODE = "application/cloudevents+json"; public static final String MIME_BATCH_CONTENT_MODE = "application/cloudevents-batch+json"; diff --git a/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/KnativeEnvironment.java b/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/KnativeEnvironment.java index 5c9b7a8..cfca7dc 100644 --- a/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/KnativeEnvironment.java +++ b/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/KnativeEnvironment.java @@ -27,6 +27,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.stream.Stream; import com.fasterxml.jackson.annotation.JsonCreator; @@ -139,6 +140,13 @@ public class KnativeEnvironment { .build(); } +public static KnativeServiceDefinition sourceChannel(String name, Map metadata) { +return serviceBuilder(Knative.Type.channel, name) +.withMeta(metadata) +.withMeta(Knative.CAMEL_ENDPOINT_KIND, Knative.EndpointKind.source) +.build(); +} + public static KnativeServiceDefinition event(Knative.EndpointKind endpointKind, String name, String host, int port) { return serviceBuilder(Knative.Type.event, name) .withHost(host) @@ -330,6 +338,10 @@ public class KnativeEnvironment { return getMetadata().get(key); } +public Optional getOptionalMetadata(String key) { +return Optional.ofNullable(getMetadata(key)); +} + public boolean matches(Knative.Type type, String name) { return Objects.equals(type.name(), getMetadata(Knative.KNATIVE_TYPE)) && Objects.equals(name, getName()); diff --git a/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/KnativeTransportConfiguration.java b/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/KnativeTransportConfiguration.java index fc94034..8ce752f 100644 --- a/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/KnativeTransportConfiguration.java +++ b/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/KnativeTransportConfiguration.java @@ -19,12 +19,13 @@ package org.apache.camel.component.knative.spi; public final class KnativeTransportConfigurat
[camel-k-examples] branch master updated: Create knative source for JIRA
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new b6023ed Create knative source for JIRA b6023ed is described below commit b6023ed5891ba8cf6342894483c5174d0588b47d Author: mmelko AuthorDate: Wed Jul 15 14:17:41 2020 +0200 Create knative source for JIRA --- 05-knative-source-jira/README.md| 180 05-knative-source-jira/jira-channel.yaml| 5 + 05-knative-source-jira/jira-consumer.groovy | 7 ++ 05-knative-source-jira/jira-new-issues.yaml | 40 +++ 05-knative-source-jira/jira.properties | 4 + 05-knative-source-jira/readme.didact.md | 180 6 files changed, 416 insertions(+) diff --git a/05-knative-source-jira/README.md b/05-knative-source-jira/README.md new file mode 100644 index 000..14512e4 --- /dev/null +++ b/05-knative-source-jira/README.md @@ -0,0 +1,180 @@ +# Camel Knative JIRA Source Basic Example + +This example demonstrates how to get started with Camel based Knative sources by showing you some of the most important +features that you should know before trying to develop more complex examples. + +You can find more information about Apache Camel and Apache Camel K on the [official Camel website](https://camel.apache.org). + +## Before you begin + +Read the general instructions in the [root README.md file](../README.md) for setting up your environment and the Kubernetes cluster before looking at this example. + +Make sure you've read the [installation instructions](https://camel.apache.org/camel-k/latest/installation/installation.html) for your specific +cluster before starting the example. + +You should open this file with [Didact](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-didact) if available on your IDE. + +## Requirements + +Validate all Requirements at Once! + +**Kubectl CLI** + +The Kubernetes `kubectl` CLI tool will be used to interact with the Kubernetes cluster. + +[Check if the Kubectl CLI is installed](didact://?commandId=vscode.didact.cliCommandSuccessful&text=kubectl-requirements-status$$kubectl%20help&completion=Checked%20kubectl%20tool%20availability "Tests to see if `kubectl help` returns a 0 return code"){.didact} + +*Status: unknown*{#kubectl-requirements-status} + +**Connection to a Kubernetes cluster** + +You need to connect to a Kubernetes cluster in order to run the example. + +[Check if you're connected to a Kubernetes cluster](didact://?commandId=vscode.didact.cliCommandSuccessful&text=cluster-requirements-status$$kubectl%20get%20pod&completion=Checked%20Kubernetes%20connection "Tests to see if `kubectl get pod` returns a 0 return code"){.didact} + +*Status: unknown*{#cluster-requirements-status} + +**Apache Camel K CLI ("kamel")** + +You need the Apache Camel K CLI ("kamel") in order to access all Camel K features. + +[Check if the Apache Camel K CLI ("kamel") is installed](didact://?commandId=vscode.didact.requirementCheck&text=kamel-requirements-status$$kamel%20version$$Camel%20K%20Client&completion=Checked%20if%20Camel%20K%20CLI%20is%20available%20on%20this%20system. "Tests to see if `kamel version` returns a result"){.didact} + +*Status: unknown*{#kamel-requirements-status} + +**Knative installed on the cluster** + +The cluster also needs to have Knative installed and working. Refer to the [official Knative documentation](https://knative.dev/docs/install/) for information on how to install it in your cluster. + +[Check if the Knative Serving is installed](didact://?commandId=vscode.didact.requirementCheck&text=kserving-project-check$$kubectl%20api-resources%20--api-group=serving.knative.dev$$kservice%2Cksvc&completion=Verified%20Knative%20services%20installation. "Verifies if Knative Serving is installed"){.didact} + +*Status: unknown*{#kserving-project-check} + +[Check if the Knative Eventing is installed](didact://?commandId=vscode.didact.requirementCheck&text=keventing-project-check$$kubectl%20api-resources%20--api-group=messaging.knative.dev$$inmemorychannels&completion=Verified%20Knative%20eventing%20services%20installation. "Verifies if Knative Eventing is installed"){.didact} + +*Status: unknown*{#keventing-project-check} + +**Knative Camel Source installed on the cluster** + +The cluster also needs to have installed the Knative Camel Source from the camel.yaml in the [Eventing Sources release page](https://github.com/knative/eventing-contrib/releases) + +[Check if the Knative Camel Source is installed](didact://?commandId=vscode.didact.requirementCheck&text=kservice-project-check$$kubectl%20api-resources%20--api-group=sources.knative.dev$$camelsources&com
[camel-k-examples] branch master updated: Create knative source for JIRA
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new b6023ed Create knative source for JIRA b6023ed is described below commit b6023ed5891ba8cf6342894483c5174d0588b47d Author: mmelko AuthorDate: Wed Jul 15 14:17:41 2020 +0200 Create knative source for JIRA --- 05-knative-source-jira/README.md| 180 05-knative-source-jira/jira-channel.yaml| 5 + 05-knative-source-jira/jira-consumer.groovy | 7 ++ 05-knative-source-jira/jira-new-issues.yaml | 40 +++ 05-knative-source-jira/jira.properties | 4 + 05-knative-source-jira/readme.didact.md | 180 6 files changed, 416 insertions(+) diff --git a/05-knative-source-jira/README.md b/05-knative-source-jira/README.md new file mode 100644 index 000..14512e4 --- /dev/null +++ b/05-knative-source-jira/README.md @@ -0,0 +1,180 @@ +# Camel Knative JIRA Source Basic Example + +This example demonstrates how to get started with Camel based Knative sources by showing you some of the most important +features that you should know before trying to develop more complex examples. + +You can find more information about Apache Camel and Apache Camel K on the [official Camel website](https://camel.apache.org). + +## Before you begin + +Read the general instructions in the [root README.md file](../README.md) for setting up your environment and the Kubernetes cluster before looking at this example. + +Make sure you've read the [installation instructions](https://camel.apache.org/camel-k/latest/installation/installation.html) for your specific +cluster before starting the example. + +You should open this file with [Didact](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-didact) if available on your IDE. + +## Requirements + +Validate all Requirements at Once! + +**Kubectl CLI** + +The Kubernetes `kubectl` CLI tool will be used to interact with the Kubernetes cluster. + +[Check if the Kubectl CLI is installed](didact://?commandId=vscode.didact.cliCommandSuccessful&text=kubectl-requirements-status$$kubectl%20help&completion=Checked%20kubectl%20tool%20availability "Tests to see if `kubectl help` returns a 0 return code"){.didact} + +*Status: unknown*{#kubectl-requirements-status} + +**Connection to a Kubernetes cluster** + +You need to connect to a Kubernetes cluster in order to run the example. + +[Check if you're connected to a Kubernetes cluster](didact://?commandId=vscode.didact.cliCommandSuccessful&text=cluster-requirements-status$$kubectl%20get%20pod&completion=Checked%20Kubernetes%20connection "Tests to see if `kubectl get pod` returns a 0 return code"){.didact} + +*Status: unknown*{#cluster-requirements-status} + +**Apache Camel K CLI ("kamel")** + +You need the Apache Camel K CLI ("kamel") in order to access all Camel K features. + +[Check if the Apache Camel K CLI ("kamel") is installed](didact://?commandId=vscode.didact.requirementCheck&text=kamel-requirements-status$$kamel%20version$$Camel%20K%20Client&completion=Checked%20if%20Camel%20K%20CLI%20is%20available%20on%20this%20system. "Tests to see if `kamel version` returns a result"){.didact} + +*Status: unknown*{#kamel-requirements-status} + +**Knative installed on the cluster** + +The cluster also needs to have Knative installed and working. Refer to the [official Knative documentation](https://knative.dev/docs/install/) for information on how to install it in your cluster. + +[Check if the Knative Serving is installed](didact://?commandId=vscode.didact.requirementCheck&text=kserving-project-check$$kubectl%20api-resources%20--api-group=serving.knative.dev$$kservice%2Cksvc&completion=Verified%20Knative%20services%20installation. "Verifies if Knative Serving is installed"){.didact} + +*Status: unknown*{#kserving-project-check} + +[Check if the Knative Eventing is installed](didact://?commandId=vscode.didact.requirementCheck&text=keventing-project-check$$kubectl%20api-resources%20--api-group=messaging.knative.dev$$inmemorychannels&completion=Verified%20Knative%20eventing%20services%20installation. "Verifies if Knative Eventing is installed"){.didact} + +*Status: unknown*{#keventing-project-check} + +**Knative Camel Source installed on the cluster** + +The cluster also needs to have installed the Knative Camel Source from the camel.yaml in the [Eventing Sources release page](https://github.com/knative/eventing-contrib/releases) + +[Check if the Knative Camel Source is installed](didact://?commandId=vscode.didact.requirementCheck&text=kservice-project-check$$kubectl%20api-resources%20--api-group=sources.knative.dev$$camelsources&com
[camel-k-runtime] branch master updated: Unable to run kotlin routes with quarkus #394
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 90a38e0 Unable to run kotlin routes with quarkus #394 90a38e0 is described below commit 90a38e0e3fda798c25ab1f78a7580d418ab259ad Author: lburgazzoli AuthorDate: Tue Jul 14 19:19:13 2020 +0200 Unable to run kotlin routes with quarkus #394 --- camel-k-loader-groovy/pom.xml | 4 - camel-k-loader-java/pom.xml| 4 - camel-k-loader-js/pom.xml | 4 - .../camel-k-loader-kotlin-itests}/pom.xml | 43 +++-- .../camel/k/loader/kotlin/itests/LoaderTest.java | 48 ++ .../src/test/resources/log4j2-test.xml | 0 .../src/test/resources/routes.kts | 0 .../{ => camel-k-loader-kotlin}/pom.xml| 14 +- .../kotlin/KotlinCompilationConfiguration.kt | 0 .../camel/k/loader/kotlin/KotlinSourceLoader.kt| 87 ++ .../k/loader/kotlin/dsl/BeansConfiguration.kt | 0 .../k/loader/kotlin/dsl/CamelConfiguration.kt | 0 .../k/loader/kotlin/dsl/ComponentsConfiguration.kt | 0 .../loader/kotlin/dsl/DataFormatsConfiguration.kt | 0 .../loader/kotlin/dsl/IntegrationConfiguration.kt | 0 .../k/loader/kotlin/dsl/LanguagesConfiguration.kt | 0 .../k/loader/kotlin/dsl/RegistryConfiguration.kt | 0 .../camel/k/loader/kotlin/dsl/RestConfiguration.kt | 0 .../k/loader/kotlin/dsl/RestVerbConfiguration.kt | 0 .../apache/camel/k/loader/kotlin/dsl/Support.kt| 0 .../kotlin/extension/LogComponentExtensions.kt | 0 ...r.kotlin.dsl.IntegrationConfiguration.classname | 0 .../services/org/apache/camel/k/loader/kts | 0 .../org/apache/camel/k/loader/kotlin/LoaderTest.kt | 0 .../camel/k/loader/kotlin/dsl/IntegrationTest.kt | 0 .../k/loader/kotlin/extension/LogExtensionTest.kt | 0 .../src/test/resources/log4j2-test.xml | 0 .../src/test/resources/routes-new.kts | 0 .../src/test/resources/routes-with-beans.kts | 0 .../routes-with-components-configuration-error.kts | 0 .../routes-with-components-configuration.kts | 0 .../routes-with-dataformats-configuration.kts | 0 .../test/resources/routes-with-endpoint-dsl.kts| 0 .../test/resources/routes-with-error-handler.kts | 0 .../routes-with-languages-configuration.kts| 0 .../src/test/resources/routes-with-rest.kts| 0 .../src/test/resources/routes.kts | 0 camel-k-loader-kotlin/pom.xml | 191 + .../camel/k/loader/kotlin/KotlinSourceLoader.kt| 104 --- camel-k-main/camel-k-runtime-main/pom.xml | 5 - .../camel-k-quarkus-core/deployment/pom.xml| 4 + .../camel-k-quarkus-core/runtime/pom.xml | 5 + .../camel-k-quarkus-loader-groovy/runtime/pom.xml | 4 - .../camel-k-quarkus-loader-java/runtime/pom.xml| 4 - .../camel-k-quarkus-loader-js/runtime/pom.xml | 4 - .../deployment/pom.xml | 9 +- .../camel-k-quarkus-loader-kotlin/runtime/pom.xml | 9 +- camel-k-runtime-core/pom.xml | 4 + .../org/apache/camel/k/support/RouteBuilders.java | 39 ++--- .../data/application.properties| 34 .../data/routes.kts| 5 +- .../pom.xml| 83 + .../src/main/resources/application.properties | 20 +++ examples/pom.xml | 1 + 54 files changed, 332 insertions(+), 397 deletions(-) diff --git a/camel-k-loader-groovy/pom.xml b/camel-k-loader-groovy/pom.xml index e1a9628..6693faf 100644 --- a/camel-k-loader-groovy/pom.xml +++ b/camel-k-loader-groovy/pom.xml @@ -42,10 +42,6 @@ org.apache.camel -camel-endpointdsl - - -org.apache.camel camel-groovy diff --git a/camel-k-loader-java/pom.xml b/camel-k-loader-java/pom.xml index 884e59d..1e4dd67 100644 --- a/camel-k-loader-java/pom.xml +++ b/camel-k-loader-java/pom.xml @@ -37,10 +37,6 @@ camel-core-engine -org.apache.camel -camel-endpointdsl - - org.jooq joor ${joor.version} diff --git a/camel-k-loader-js/pom.xml b/camel-k-loader-js/pom.xml index a023746..b552896 100644 --- a/camel-k-loader-js/pom.xml +++ b/camel-k-loader-js/pom.xml @@ -36,10 +36,6 @@ org.apache.camel camel-core-engine - -org.apache.camel -camel-endpointdsl - org.graalvm.js diff --git a/camel-k-quar
[camel-k-examples] branch master updated: Add knative source example for Salesforce
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new b9689c9 Add knative source example for Salesforce b9689c9 is described below commit b9689c9f0a26b6016e16ad73a6100186053f0bbe Author: Tomohisa Igarashi AuthorDate: Thu Jul 9 11:03:26 2020 -0400 Add knative source example for Salesforce Note: This example requires Apache Camel 3.4.0 or newer due to a bug in camel-salesforce - https://issues.apache.org/jira/browse/CAMEL-15063 --- .../SalesforceConsumer.java| 13 ++ 10-knative-source-salesforce/readme.didact.md | 216 + 10-knative-source-salesforce/readme.md | 1 + .../salesforce-channel.yaml| 7 + .../salesforce-source.yaml | 32 +++ 10-knative-source-salesforce/salesforce.properties | 5 + README.md | 3 +- 7 files changed, 276 insertions(+), 1 deletion(-) diff --git a/10-knative-source-salesforce/SalesforceConsumer.java b/10-knative-source-salesforce/SalesforceConsumer.java new file mode 100644 index 000..60f27e6 --- /dev/null +++ b/10-knative-source-salesforce/SalesforceConsumer.java @@ -0,0 +1,13 @@ +// camel-k: dependency=camel-jackson +// camel-k: language=java + +import org.apache.camel.builder.RouteBuilder; + +public class SalesforceConsumer extends RouteBuilder { +public void configure() { +from("knative:channel/salesforce") +.unmarshal().json() +.log("New Salesforce contact was created: [ID:${body[Id]}, Name:${body[Name]}, Email:${body[Email]}, Phone: ${body[Phone]}]") +.marshal().json(); // To avoid a WARN - https://github.com/apache/camel-k-runtime/issues/390 +} +} diff --git a/10-knative-source-salesforce/readme.didact.md b/10-knative-source-salesforce/readme.didact.md new file mode 100644 index 000..6032d2d --- /dev/null +++ b/10-knative-source-salesforce/readme.didact.md @@ -0,0 +1,216 @@ +# Camel Knative Source Salesforce Example + +This example demonstrates how to create a Camel based Knative source for Salesforce and a Camel route which consumes it. + +You can find more information about Apache Camel and Apache Camel K on the [official Camel website](https://camel.apache.org). + +## Before you begin + +Read the general instructions in the [root README.md file](../README.md) for setting up your environment and the Kubernetes cluster before looking at this example. + +Make sure you've read the [installation instructions](https://camel.apache.org/camel-k/latest/installation/installation.html) for your specific +cluster before starting the example. + +You should open this file with [Didact](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-didact) if available on your IDE. + +## Requirements + +Validate all Requirements at Once! + +**Kubectl CLI** + +The Kubernetes `kubectl` CLI tool will be used to interact with the Kubernetes cluster. + +[Check if the Kubectl CLI is installed](didact://?commandId=vscode.didact.cliCommandSuccessful&text=kubectl-requirements-status$$kubectl%20help&completion=Checked%20kubectl%20tool%20availability "Tests to see if `kubectl help` returns a 0 return code"){.didact} + +*Status: unknown*{#kubectl-requirements-status} + +**Connection to a Kubernetes cluster** + +You need to connect to a Kubernetes cluster in order to run the example. + +[Check if you're connected to a Kubernetes cluster](didact://?commandId=vscode.didact.cliCommandSuccessful&text=cluster-requirements-status$$kubectl%20get%20pod&completion=Checked%20Kubernetes%20connection "Tests to see if `kubectl get pod` returns a 0 return code"){.didact} + +*Status: unknown*{#cluster-requirements-status} + +**Apache Camel K CLI ("kamel")** + +You need the Apache Camel K CLI ("kamel") in order to access all Camel K features. + +[Check if the Apache Camel K CLI ("kamel") is installed](didact://?commandId=vscode.didact.requirementCheck&text=kamel-requirements-status$$kamel%20version$$Camel%20K%20Client&completion=Checked%20if%20Camel%20K%20CLI%20is%20available%20on%20this%20system. "Tests to see if `kamel version` returns a result"){.didact} + +*Status: unknown*{#kamel-requirements-status} + +**Knative installed on the cluster** + +The cluster also needs to have Knative installed and working. Refer to the [official Knative documentation](https://knative.dev/v0.15-docs/install/) for information on how to install it in your cluster. + +[Check if the Knative Serving is installed](didact://?commandId=vscode.didact.requirementCheck&text=kserving-project-check$$kubectl%20api-resources%20--api-group=serving.knative.de
[camel-k-examples] branch master updated: Camel-AWS-Kinesis example: Fixed signature issue, missing region in the chain and align CBOR version
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new 2031eea Camel-AWS-Kinesis example: Fixed signature issue, missing region in the chain and align CBOR version 2031eea is described below commit 2031eea281995734f72ffdf8737c525eaeec6591 Author: Andrea Cosentino AuthorDate: Tue Jul 14 14:50:37 2020 +0200 Camel-AWS-Kinesis example: Fixed signature issue, missing region in the chain and align CBOR version --- 04-aws-kinesis-source-basic/aws-kinesis-producer.groovy | 2 +- 04-aws-kinesis-source-basic/aws-kinesis-source.yaml | 2 ++ 04-aws-kinesis-source-basic/aws-kinesis.properties | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/04-aws-kinesis-source-basic/aws-kinesis-producer.groovy b/04-aws-kinesis-source-basic/aws-kinesis-producer.groovy index 78f9e20..041a50c 100644 --- a/04-aws-kinesis-source-basic/aws-kinesis-producer.groovy +++ b/04-aws-kinesis-source-basic/aws-kinesis-producer.groovy @@ -10,4 +10,4 @@ from('timer:java?period=3000&repeatCount=100') .constant(1) .setBody() .simple('Hello Camel K') - .to('aws-kinesis:stream?accessKey={{aws.kinesis.accessKey}}&secretKey={{aws.kinesis.accessKey}}') + .to('aws-kinesis:stream?accessKey={{aws.kinesis.accessKey}}&secretKey={{aws.kinesis.secretKey}}®ion=EU_WEST_1') diff --git a/04-aws-kinesis-source-basic/aws-kinesis-source.yaml b/04-aws-kinesis-source-basic/aws-kinesis-source.yaml index a302a1d..655daad 100644 --- a/04-aws-kinesis-source-basic/aws-kinesis-source.yaml +++ b/04-aws-kinesis-source-basic/aws-kinesis-source.yaml @@ -16,12 +16,14 @@ spec: - camel:jackson # Needed for the AWS Kinesis component - camel:camel-aws-kinesis +- mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/2.10.4 flow: from: uri: aws-kinesis:stream parameters: secretKey: "{{aws.kinesis.secretKey}}" accessKey: "{{aws.kinesis.accessKey}}" + region: "EU_WEST_1" steps: - to: "log:received?showAll=true&multiline=true" - marshal: diff --git a/04-aws-kinesis-source-basic/aws-kinesis.properties b/04-aws-kinesis-source-basic/aws-kinesis.properties index 446bf1d..d014874 100644 --- a/04-aws-kinesis-source-basic/aws-kinesis.properties +++ b/04-aws-kinesis-source-basic/aws-kinesis.properties @@ -1,2 +1,2 @@ -aws.kinesis.accessKey=accesskey -aws.kinesis.secretKey=secretkey \ No newline at end of file +aws.kinesis.accessKey=accessKey +aws.kinesis.secretKey=secretKey
[camel-k-runtime] branch master updated: Property substitution doesn't happen in from URI #392
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 00aeba6 Property substitution doesn't happen in from URI #392 00aeba6 is described below commit 00aeba69a861327414df59e4d5c2c249f86d9a2e Author: lburgazzoli AuthorDate: Tue Jul 14 11:13:01 2020 +0200 Property substitution doesn't happen in from URI #392 --- .../k/loader/yaml/parser/ChoiceStepParser.java | 2 +- .../yaml/parser/CircuitBreakerStepParser.java | 2 +- .../k/loader/yaml/parser/DoTryStepParser.java | 2 +- .../loader/yaml/parser/ErrorHandlerStepParser.java | 2 +- .../k/loader/yaml/parser/FilterStepParser.java | 2 +- .../camel/k/loader/yaml/parser/FromStepParser.java | 23 + .../yaml/parser/IdempotentConsumerParser.java | 2 +- .../loader/yaml/parser/LoadBalanceStepParser.java | 2 +- .../camel/k/loader/yaml/parser/LoopStepParser.java | 2 +- .../k/loader/yaml/parser/MulticastStepParser.java | 2 +- .../loader/yaml/parser/OnExceptionStepParser.java | 2 +- .../k/loader/yaml/parser/PipelineStepParser.java | 2 +- .../k/loader/yaml/parser/ResequenceStepParser.java | 2 +- .../camel/k/loader/yaml/parser/RestStepParser.java | 2 +- .../k/loader/yaml/parser/RouteStepParser.java | 23 + .../camel/k/loader/yaml/parser/SagaStepParser.java | 2 +- .../k/loader/yaml/parser/SampleStepParser.java | 2 +- .../k/loader/yaml/parser/SplitStepParser.java | 2 +- .../camel/k/loader/yaml/parser/StepStepParser.java | 2 +- .../k/loader/yaml/parser/ToDynamicStepParser.java | 23 + .../camel/k/loader/yaml/parser/ToStepParser.java | 23 + .../k/loader/yaml/parser/WireTapStepParser.java| 24 +- .../yaml/{spi => support}/StepParserSupport.java | 26 +- .../k/loader/yaml/RouteWithPlaceholdersTest.groovy | 98 ++ .../apache/camel/k/loader/yaml/RoutesTest.groovy | 24 +++--- .../apache/camel/k/loader/yaml/TestSupport.groovy | 39 + .../camel/k/loader/yaml/parser/ToTest.groovy | 4 +- ...ed.yaml => RouteWithPlaceholdersTest_from.yaml} | 15 ++-- ...d.yaml => RouteWithPlaceholdersTest_route.yaml} | 18 ++-- ...dled.yaml => RouteWithPlaceholdersTest_to.yaml} | 20 +++-- ...led.yaml => RouteWithPlaceholdersTest_tod.yaml} | 20 +++-- .../routes/RoutesTest_onExceptionHandled.yaml | 2 +- .../k/knative/yaml/parser/KnativeStepParser.java | 2 +- .../apache/camel/component/knative/knative.json| 2 +- 34 files changed, 229 insertions(+), 191 deletions(-) diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ChoiceStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ChoiceStepParser.java index 96e15d5..c433a78 100644 --- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ChoiceStepParser.java +++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ChoiceStepParser.java @@ -23,7 +23,7 @@ import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition; import org.apache.camel.k.annotation.yaml.YAMLStepParser; import org.apache.camel.k.loader.yaml.model.Step; import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser; -import org.apache.camel.k.loader.yaml.spi.StepParserSupport; +import org.apache.camel.k.loader.yaml.support.StepParserSupport; import org.apache.camel.model.ChoiceDefinition; import org.apache.camel.model.OtherwiseDefinition; import org.apache.camel.model.ProcessorDefinition; diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/CircuitBreakerStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/CircuitBreakerStepParser.java index 685b1ec..94b2238 100644 --- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/CircuitBreakerStepParser.java +++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/CircuitBreakerStepParser.java @@ -24,7 +24,7 @@ import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition; import org.apache.camel.k.annotation.yaml.YAMLStepParser; import org.apache.camel.k.loader.yaml.model.Step; import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser; -import org.apache.camel.k.loader.yaml.spi.StepParserSupport; +import org.apache.camel.k.loader.yaml.support.StepParserSupport; import org.apache.camel.model.CircuitBreakerDefinition; import org.apache.camel.model.HystrixConfigurationDefinition; import org.apache.camel.model.OnFallbackDefinition; diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/mai
[camel-k-examples] branch master updated: Serverless-api example: Should point to 0.15.0 Knative documentation, with 0.16.0, the latest, the spec has been changed pointing to some v1
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new 111a754 Serverless-api example: Should point to 0.15.0 Knative documentation, with 0.16.0, the latest, the spec has been changed pointing to some v1 111a754 is described below commit 111a7540cdaf1b66b4c6390a03a2069610b5fa42 Author: Andrea Cosentino AuthorDate: Tue Jul 14 11:41:41 2020 +0200 Serverless-api example: Should point to 0.15.0 Knative documentation, with 0.16.0, the latest, the spec has been changed pointing to some v1 --- 02-serverless-api/readme.didact.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02-serverless-api/readme.didact.md b/02-serverless-api/readme.didact.md index b40ad94..a5a38fa 100644 --- a/02-serverless-api/readme.didact.md +++ b/02-serverless-api/readme.didact.md @@ -47,7 +47,7 @@ You need the Apache Camel K CLI ("kamel") in order to access all Camel K feature **Knative installed on the cluster** -The cluster also needs to have Knative installed and working. Refer to the [official Knative documentation](https://knative.dev/docs/install/) for information on how to install it in your cluster. +The cluster also needs to have Knative installed and working. Refer to the [official Knative documentation](https://knative.dev/v0.15-docs/install/) for information on how to install it in your cluster. [Check if the Knative is installed](didact://?commandId=vscode.didact.requirementCheck&text=kservice-project-check$$kubectl%20api-resources%20--api-group=serving.knative.dev$$kservice%2Cksvc&completion=Verified%20Knative%20services%20installation. "Verifies if Knative is installed"){.didact}
[camel-quarkus] branch master updated: Fix #1468 Intermittent failure of CamelDevModeTest
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git The following commit(s) were added to refs/heads/master by this push: new 54bed57 Fix #1468 Intermittent failure of CamelDevModeTest 54bed57 is described below commit 54bed57fb7a85f3b1f288f9ffa07e82e19da981b Author: Peter Palaga AuthorDate: Tue Jul 14 10:28:24 2020 +0200 Fix #1468 Intermittent failure of CamelDevModeTest --- .../main/deployment/CamelMainProcessor.java| 26 +- .../org/apache/camel/quarkus/main/CamelMain.java | 10 - .../apache/camel/quarkus/main/CamelMainConfig.java | 23 +++ .../camel/quarkus/main/CamelMainRecorder.java | 7 -- .../camel/quarkus/main/CamelMainRuntime.java | 13 +-- 5 files changed, 64 insertions(+), 15 deletions(-) diff --git a/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainProcessor.java b/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainProcessor.java index 4f76da4..2743e60 100644 --- a/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainProcessor.java +++ b/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainProcessor.java @@ -42,6 +42,7 @@ import org.apache.camel.quarkus.core.deployment.spi.CamelRuntimeTaskBuildItem; import org.apache.camel.quarkus.core.deployment.spi.ContainerBeansBuildItem; import org.apache.camel.quarkus.core.deployment.spi.RuntimeCamelContextCustomizerBuildItem; import org.apache.camel.quarkus.main.CamelMain; +import org.apache.camel.quarkus.main.CamelMainConfig; import org.apache.camel.quarkus.main.CamelMainProducers; import org.apache.camel.quarkus.main.CamelMainRecorder; import org.apache.camel.quarkus.main.deployment.spi.CamelMainBuildItem; @@ -140,14 +141,15 @@ public class CamelMainProcessor { * after having processed a certain number of messages.. * * - * @param index a reference to a {@link IndexView} - * @param beanContainer a reference to a fully initialized CDI bean container - * @param recorder the recorder. - * @param main a reference to a {@link CamelMain}. - * @param customizers a list of {@link org.apache.camel.quarkus.core.CamelContextCustomizer} that will be - * executed before starting the {@link CamelContext} at {@link ExecutionTime#RUNTIME_INIT}. - * @param runtimeTasks a placeholder to ensure all the runtime task are properly are done. - * @return a build item holding a {@link CamelRuntime} instance. + * @param index a reference to a {@link IndexView} + * @param beanContainer a reference to a fully initialized CDI bean container + * @param recorderthe recorder. + * @param maina reference to a {@link CamelMain}. + * @param customizers a list of {@link org.apache.camel.quarkus.core.CamelContextCustomizer} that will be + * executed before starting the {@link CamelContext} at {@link ExecutionTime#RUNTIME_INIT}. + * @param runtimeTasksa placeholder to ensure all the runtime task are properly are done. + * @param camelMainConfig a {@link CamelMainConfig} + * @return a build item holding a {@link CamelRuntime} instance. */ @BuildStep @Record(value = ExecutionTime.RUNTIME_INIT, optional = true) @@ -161,7 +163,8 @@ public class CamelMainProcessor { CamelMainRecorder recorder, CamelMainBuildItem main, List customizers, -List runtimeTasks) { +List runtimeTasks, +CamelMainConfig camelMainConfig) { // Run the customizer before starting the context to give a last chance // to amend the Camel Context setup. @@ -174,7 +177,10 @@ public class CamelMainProcessor { customizers.stream().map(RuntimeCamelContextCustomizerBuildItem::get).collect(Collectors.toList())); return new CamelRuntimeBuildItem( -recorder.createRuntime(beanContainer.getValue(), main.getInstance()), +recorder.createRuntime( +beanContainer.getValue(), +main.getInstance(), +camelMainConfig.shutdown.timeout.toMillis()), index.getIndex().getAnnotations(DotName.createSimple(QuarkusMain.class.getName())).isEmpty()); } } diff --git a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java index a4b70a6..7e71a52 100644 --- a/extensions-core/main/runtime/src/main/java/org/apache/camel
[camel-k-examples] branch master updated: Add new examples to the main readme
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new 9ab8e1f Add new examples to the main readme 9ab8e1f is described below commit 9ab8e1f9ff7ddd02ca45bd7cac1f23579eb9a245 Author: Otavio Rodolfo Piske AuthorDate: Mon Jul 13 16:08:37 2020 +0200 Add new examples to the main readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0206521..6a297b2 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,5 @@ This is the current list of examples: - [01 Basic](./01-basic): Getting started with Camel K by learning the most important features that you should know before trying to develop more complex examples. - [02 Serverless API](./02-serverless-api): Learn how to design an API that manages files in a remote storage location and leverages *Knative* Serving to scale automatically (even to zero instances) based on the current load. - [03 Knative Source Basic](./03-knative-source-basic): Getting started with Knative Camel Source by learning the most important concepts you should know before trying to develop more complex examples. +- [04 AWS Kinesis Source Basic](./04-aws-kinesis-source-basic): Learn how to consume AWS Kinesis events using Knative Camel Source. +- [11 Knative Source Slack](./11-knative-source-slack): Getting started with Slack integration using Knative Camel Source. \ No newline at end of file
[camel-k-examples] branch master updated: Add new basic example for AWS Kinesis
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new 716aa13 Add new basic example for AWS Kinesis 716aa13 is described below commit 716aa13ded409fb6e7182220b7efb8214f54354f Author: Otavio Rodolfo Piske AuthorDate: Wed Jul 8 16:23:02 2020 +0200 Add new basic example for AWS Kinesis --- .../aws-kinesis-channel.yaml | 7 + .../aws-kinesis-consumer.groovy| 13 ++ .../aws-kinesis-producer.groovy| 13 ++ .../aws-kinesis-source.yaml| 33 04-aws-kinesis-source-basic/aws-kinesis.properties | 2 + 04-aws-kinesis-source-basic/readme.didact.md | 185 + 04-aws-kinesis-source-basic/readme.md | 1 + 7 files changed, 254 insertions(+) diff --git a/04-aws-kinesis-source-basic/aws-kinesis-channel.yaml b/04-aws-kinesis-source-basic/aws-kinesis-channel.yaml new file mode 100644 index 000..4381711 --- /dev/null +++ b/04-aws-kinesis-source-basic/aws-kinesis-channel.yaml @@ -0,0 +1,7 @@ +# +# Knative Channel +# +apiVersion: messaging.knative.dev/v1alpha1 +kind: InMemoryChannel +metadata: + name: aws-kinesis \ No newline at end of file diff --git a/04-aws-kinesis-source-basic/aws-kinesis-consumer.groovy b/04-aws-kinesis-source-basic/aws-kinesis-consumer.groovy new file mode 100644 index 000..e1da006 --- /dev/null +++ b/04-aws-kinesis-source-basic/aws-kinesis-consumer.groovy @@ -0,0 +1,13 @@ +// camel-k: dependency=camel-aws-kinesis dependency=camel-base64 +// +// Apache Camel Kinesis Consumer +// + +// So we unmarshal it, extract the data element which is in base64 format and decode it +from('knative:channel/aws-kinesis') +.unmarshal() +.json() +.setBody { it.in.body.data } +.unmarshal() +.base64() +.log('Received: ${body}') diff --git a/04-aws-kinesis-source-basic/aws-kinesis-producer.groovy b/04-aws-kinesis-source-basic/aws-kinesis-producer.groovy new file mode 100644 index 000..78f9e20 --- /dev/null +++ b/04-aws-kinesis-source-basic/aws-kinesis-producer.groovy @@ -0,0 +1,13 @@ +// camel-k: dependency=camel-aws-kinesis +// +// Apache Camel Kinesis Consumer +// +// This is just a sample producer for AWS that creates 100 messages every 3 seconds +from('timer:java?period=3000&repeatCount=100') +.setHeader("CamelAwsKinesisPartitionKey") +.constant("p-01123") +.setHeader("CamelAwsKinesisSequenceNumber") +.constant(1) +.setBody() +.simple('Hello Camel K') + .to('aws-kinesis:stream?accessKey={{aws.kinesis.accessKey}}&secretKey={{aws.kinesis.accessKey}}') diff --git a/04-aws-kinesis-source-basic/aws-kinesis-source.yaml b/04-aws-kinesis-source-basic/aws-kinesis-source.yaml new file mode 100644 index 000..a302a1d --- /dev/null +++ b/04-aws-kinesis-source-basic/aws-kinesis-source.yaml @@ -0,0 +1,33 @@ +# +# Apache Camel AWS Kinesis Source +# +apiVersion: sources.knative.dev/v1alpha1 +kind: CamelSource +metadata: + name: camel-aws-kinesis-source +spec: + source: +integration: + configuration: +- type: secret + value: aws-kinesis + dependencies: +# Needed for the json part on the flow/steps below +- camel:jackson +# Needed for the AWS Kinesis component +- camel:camel-aws-kinesis +flow: + from: +uri: aws-kinesis:stream +parameters: + secretKey: "{{aws.kinesis.secretKey}}" + accessKey: "{{aws.kinesis.accessKey}}" +steps: +- to: "log:received?showAll=true&multiline=true" +- marshal: +json: {} + sink: +ref: + apiVersion: messaging.knative.dev/v1beta1 + kind: InMemoryChannel + name: aws-kinesis diff --git a/04-aws-kinesis-source-basic/aws-kinesis.properties b/04-aws-kinesis-source-basic/aws-kinesis.properties new file mode 100644 index 000..446bf1d --- /dev/null +++ b/04-aws-kinesis-source-basic/aws-kinesis.properties @@ -0,0 +1,2 @@ +aws.kinesis.accessKey=accesskey +aws.kinesis.secretKey=secretkey \ No newline at end of file diff --git a/04-aws-kinesis-source-basic/readme.didact.md b/04-aws-kinesis-source-basic/readme.didact.md new file mode 100644 index 000..1970ab4 --- /dev/null +++ b/04-aws-kinesis-source-basic/readme.didact.md @@ -0,0 +1,185 @@ +# Camel AWS Kinesis Source Basic Example + +This example demonstrates how to get started with Camel based Knative sources by showing you some of the most important +features that you should know before trying to develop more complex examples. + +You can find more information about Apache Camel and Apache Camel K on the [official Camel website](https:/
[camel-k-examples] branch master updated: Slack Service: Event source design & implementation
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new ffd5e58 Slack Service: Event source design & implementation ffd5e58 is described below commit ffd5e58445a7d73a1df557b0222e6c3dda1204a5 Author: Alexandre Kieling AuthorDate: Fri Jul 10 15:03:23 2020 -0300 Slack Service: Event source design & implementation --- 11-knative-source-slack/readme.didact.md | 177 ++ 11-knative-source-slack/readme.md | 1 + 11-knative-source-slack/slack-channel.yaml| 7 + 11-knative-source-slack/slack-consumer.groovy | 9 ++ 11-knative-source-slack/slack-source.yaml | 31 + 11-knative-source-slack/slack.properties | 4 + 6 files changed, 229 insertions(+) diff --git a/11-knative-source-slack/readme.didact.md b/11-knative-source-slack/readme.didact.md new file mode 100644 index 000..44e0b17 --- /dev/null +++ b/11-knative-source-slack/readme.didact.md @@ -0,0 +1,177 @@ +# Camel Knative Source Slack Example + +This example demonstrates how to use a Camel based Knative source to receive messages written to a Slack channel. + +You can find more information about Apache Camel and Apache Camel K on the [official Camel website](https://camel.apache.org). + +## Before you begin + +Read the general instructions in the root [README.md](../README.md) file for setting up your environment and the Kubernetes cluster before looking at this example. + +Make sure you've read the Camel K [installation instructions](https://camel.apache.org/camel-k/latest/installation/installation.html) for your specific +cluster before starting the example. + +You should open this file with [Didact](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-didact) if available on your IDE. + +## Requirements + +Validate all Requirements at Once! + +**Kubectl CLI** + +The Kubernetes `kubectl` CLI tool will be used to interact with the Kubernetes cluster. + +[Check if the Kubectl CLI is installed](didact://?commandId=vscode.didact.cliCommandSuccessful&text=kubectl-requirements-status$$kubectl%20help "Tests to see if `kubectl help` returns a 0 return code"){.didact} + +*Status: unknown*{#kubectl-requirements-status} + +**Connection to a Kubernetes cluster** + +You need to connect to a Kubernetes cluster in order to run the example. + +[Check if you're connected to a Kubernetes cluster](didact://?commandId=vscode.didact.cliCommandSuccessful&text=cluster-requirements-status$$kubectl%20get%20pod "Tests to see if `kubectl get pod` returns a 0 return code"){.didact} + +*Status: unknown*{#cluster-requirements-status} + +**Apache Camel K CLI ("kamel")** + +You need the Apache Camel K CLI ("kamel") in order to access all Camel K features. + +[Check if the Apache Camel K CLI ("kamel") is installed](didact://?commandId=vscode.didact.requirementCheck&text=kamel-requirements-status$$kamel%20version$$Camel%20K%20Client "Tests to see if `kamel version` returns a result"){.didact} + +*Status: unknown*{#kamel-requirements-status} + +**Knative installed on the cluster** + +The cluster also needs to have Knative installed and working. Refer to the [official Knative documentation](https://knative.dev/docs/install/) for information on how to install it in your cluster. + +[Check if the Knative Serving is installed](didact://?commandId=vscode.didact.requirementCheck&text=kserving-project-check$$kubectl%20api-resources%20--api-group=serving.knative.dev$$kservice%2Cksvc "Verifies if Knative Serving is installed"){.didact} + +*Status: unknown*{#kserving-project-check} + +[Check if the Knative Eventing is installed](didact://?commandId=vscode.didact.requirementCheck&text=keventing-project-check$$kubectl%20api-resources%20--api-group=messaging.knative.dev$$inmemorychannels "Verifies if Knative Eventing is installed"){.didact} + +*Status: unknown*{#keventing-project-check} + +**Knative Camel Source installed on the cluster** + +The cluster also needs to have installed the Knative Camel Source from the camel.yaml in the [Eventing Sources release page](https://github.com/knative/eventing-contrib/releases). + +[Check if the Knative Camel Source is installed](didact://?commandId=vscode.didact.requirementCheck&text=kservice-project-check$$kubectl%20api-resources%20--api-group=sources.knative.dev$$camelsources "Verifies if Knative Camel Source is installed"){.didact} + +*Status: unknown*{#kservice-project-check} + +### Optional Requirements + +The following requirements are optional. They don't prevent the execution of the demo, but may make it easier to follow. + +**VS Code Extension Pack for Apache Camel** + +The VS Code Extension Pack
[camel-k-examples] branch master updated: Fixed the commands to open the telegram.properties file in the tutorial
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new e6a1160 Fixed the commands to open the telegram.properties file in the tutorial e6a1160 is described below commit e6a11607f134e6b060fc72506c7ebecad8f43807 Author: Otavio Rodolfo Piske AuthorDate: Mon Jul 13 09:57:51 2020 +0200 Fixed the commands to open the telegram.properties file in the tutorial --- 03-knative-source-basic/readme.didact.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/03-knative-source-basic/readme.didact.md b/03-knative-source-basic/readme.didact.md index bfb03e2..f030de0 100644 --- a/03-knative-source-basic/readme.didact.md +++ b/03-knative-source-basic/readme.didact.md @@ -126,7 +126,7 @@ You can now proceed to the next section. ## 2. Preparing the environment -This repository contains a simple [telegram.properties](didact://?commandId=vscode.openFolder&projectFilePath=01-basic/telegram.properties&completion=Opened%20the%telegram.properties%20file "Opens the telegram.properties file"){.didact} that can be used to generate a Kubernetes Secret with the Telegram Bot Token obtained with the [@BotFather](https://telegram.me/botfather) by replacing ` +This repository contains a simple [telegram.properties](didact://?commandId=vscode.openFolder&projectFilePath=03-knative-source-basic/telegram.properties&completion=Opened%20the%20telegram.properties%20file "Opens the telegram.properties file"){.didact} that can be used to generate a Kubernetes Secret with the Telegram Bot Token obtained with the [@BotFather](https://telegram.me/botfather) by replacing ` ` with the actual token. ```
[camel] branch master updated: camel-reactive-stream: cleanup
This is an automated email from the ASF dual-hosted git repository. lburgazzoli 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 b8d6fae camel-reactive-stream: cleanup b8d6fae is described below commit b8d6faeb09ffe6ba9f5c02d930833bfecc89bc0a Author: lburgazzoli AuthorDate: Fri Jul 10 17:56:50 2020 +0200 camel-reactive-stream: cleanup --- .../reactive/streams/ReactiveStreamsCamelSubscriber.java | 4 ++-- .../component/reactive/streams/ReactiveStreamsHelper.java | 1 - .../reactive/streams/api/CamelReactiveStreamsService.java | 3 ++- .../component/reactive/streams/engine/CamelPublisher.java | 8 .../reactive/streams/engine/CamelSubscription.java | 12 ++-- .../streams/engine/DefaultCamelReactiveStreamsService.java | 5 + .../reactive/streams/engine/DelayedMonoPublisher.java | 12 ++-- .../reactive/streams/engine/UnwrappingPublisher.java | 2 +- .../component/reactive/streams/util/BodyConverter.java | 11 ++- .../reactive/streams/util/ConvertingPublisher.java | 6 +++--- .../reactive/streams/util/ConvertingSubscriber.java| 6 +++--- .../component/reactive/streams/util/MonoPublisher.java | 2 +- .../streams/support/ReactiveStreamsTestService.java| 6 ++ .../component/reactor/engine/ReactorStreamsService.java| 5 + .../engine/ReactorStreamsServiceBackpressureTest.java | 4 ++-- .../reactor/engine/ReactorStreamsServiceTest.java | 14 +++--- .../component/rxjava/engine/RxJavaCamelProcessor.java | 2 +- .../component/rxjava/engine/RxJavaStreamsService.java | 5 + .../component/rxjava/engine/RxJavaStreamsServiceTest.java | 10 ++ 19 files changed, 67 insertions(+), 51 deletions(-) diff --git a/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/ReactiveStreamsCamelSubscriber.java b/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/ReactiveStreamsCamelSubscriber.java index 0d0ffe7..875df93 100644 --- a/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/ReactiveStreamsCamelSubscriber.java +++ b/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/ReactiveStreamsCamelSubscriber.java @@ -37,12 +37,12 @@ public class ReactiveStreamsCamelSubscriber implements Subscriber, Clo */ private static final long UNBOUNDED_REQUESTS = Long.MAX_VALUE; +private final String name; + private ReactiveStreamsConsumer consumer; private Subscription subscription; -private String name; - private long requested; private long inflightCount; diff --git a/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/ReactiveStreamsHelper.java b/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/ReactiveStreamsHelper.java index a380934..a9752c4 100644 --- a/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/ReactiveStreamsHelper.java +++ b/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/ReactiveStreamsHelper.java @@ -110,7 +110,6 @@ public final class ReactiveStreamsHelper { } } -@SuppressWarnings("unchecked") public static CamelReactiveStreamsServiceFactory resolveServiceFactory(CamelContext context, String serviceType) { try { FactoryFinder finder = context.adapt(ExtendedCamelContext.class).getFactoryFinder(ReactiveStreamsConstants.SERVICE_PATH); diff --git a/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/api/CamelReactiveStreamsService.java b/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/api/CamelReactiveStreamsService.java index baea25f..c0d31f0 100644 --- a/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/api/CamelReactiveStreamsService.java +++ b/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/api/CamelReactiveStreamsService.java @@ -23,6 +23,7 @@ import org.apache.camel.Service; import org.apache.camel.component.reactive.streams.ReactiveStreamsCamelSubscriber; import org.apache.camel.component.reactive.streams.ReactiveStreamsConsumer; import org.apache.camel.component.reactive.streams.ReactiveStreamsProducer; +import org.apache.camel.spi.HasCamelContext; import org.apache.camel.spi.HasId; import org.reactivestreams.Publisher; import org.reactivestreams.Subscriber; @@ -30,7 +31,7 @@ import org.reactivestreams.Subscriber; /** * The interface to which any implementation of the reactive-streams engine should comply. */ -public
[camel] branch master updated (d8ef1f9 -> 99074d3)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel.git. from d8ef1f9 [CAMEL-11807] Fix checkstyle for camel-kafka add 99074d3 Move FastUuidGenerator from camel-quarkus No new revisions were added by this update. Summary of changes: ...atorTest.java => VanillaUuidGeneratorTest.java} | 20 + ...uidGenerator.java => VanillaUuidGenerator.java} | 26 +- 2 files changed, 31 insertions(+), 15 deletions(-) copy core/camel-core/src/test/java/org/apache/camel/impl/{SimpleUuidGeneratorTest.java => VanillaUuidGeneratorTest.java} (71%) copy core/camel-support/src/main/java/org/apache/camel/support/{SimpleUuidGenerator.java => VanillaUuidGenerator.java} (50%)
[camel-k-runtime] branch master updated: [yaml] cleanup schema generator leftovers
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new 4702f78 [yaml] cleanup schema generator leftovers 4702f78 is described below commit 4702f78b6028031134dc745a20a273ff3569e38d Author: lburgazzoli AuthorDate: Fri Jul 10 14:30:38 2020 +0200 [yaml] cleanup schema generator leftovers --- .../k/loader/yaml/parser/AggregateStepParser.java | 2 +- .../k/loader/yaml/parser/ChoiceStepParser.java | 2 +- .../yaml/parser/CircuitBreakerStepParser.java | 2 +- .../k/loader/yaml/parser/DelayStepParser.java | 2 +- .../k/loader/yaml/parser/DoTryStepParser.java | 2 +- .../yaml/parser/DynamicRouterStepParser.java | 2 +- .../k/loader/yaml/parser/EnrichStepParser.java | 2 +- .../loader/yaml/parser/ErrorHandlerStepParser.java | 4 +-- .../k/loader/yaml/parser/FilterStepParser.java | 2 +- .../camel/k/loader/yaml/parser/FromStepParser.java | 5 ++- .../yaml/parser/IdempotentConsumerParser.java | 2 +- .../loader/yaml/parser/LoadBalanceStepParser.java | 2 +- .../camel/k/loader/yaml/parser/LoopStepParser.java | 2 +- .../k/loader/yaml/parser/MarshalStepParser.java| 2 +- .../k/loader/yaml/parser/MulticastStepParser.java | 2 +- .../loader/yaml/parser/OnExceptionStepParser.java | 4 +-- .../k/loader/yaml/parser/PipelineStepParser.java | 2 +- .../k/loader/yaml/parser/PollEnrichStepParser.java | 2 +- .../k/loader/yaml/parser/ProcessStepParser.java| 2 +- .../yaml/parser/RecipientListStepParser.java | 2 +- .../k/loader/yaml/parser/ResequenceStepParser.java | 2 +- .../camel/k/loader/yaml/parser/RestStepParser.java | 5 ++- .../k/loader/yaml/parser/RouteStepParser.java | 5 ++- .../loader/yaml/parser/RoutingSlipStepParser.java | 2 +- .../camel/k/loader/yaml/parser/SagaStepParser.java | 2 +- .../k/loader/yaml/parser/SampleStepParser.java | 2 +- .../k/loader/yaml/parser/ScriptStepParser.java | 2 +- .../loader/yaml/parser/ServiceCallStepParser.java | 2 +- .../k/loader/yaml/parser/SetBodyStepParser.java| 2 +- .../yaml/parser/SetExchangePatternStepParser.java | 2 +- .../k/loader/yaml/parser/SetHeaderStepParser.java | 2 +- .../loader/yaml/parser/SetPropertyStepParser.java | 2 +- .../camel/k/loader/yaml/parser/SortStepParser.java | 2 +- .../k/loader/yaml/parser/SplitStepParser.java | 2 +- .../camel/k/loader/yaml/parser/StepStepParser.java | 2 +- .../k/loader/yaml/parser/ThrottleStepParser.java | 2 +- .../yaml/parser/ThrowExceptionStepParser.java | 2 +- .../k/loader/yaml/parser/ToDynamicStepParser.java | 2 +- .../camel/k/loader/yaml/parser/ToStepParser.java | 2 +- .../k/loader/yaml/parser/TransactedStepParser.java | 2 +- .../k/loader/yaml/parser/TransformStepParser.java | 2 +- .../k/loader/yaml/parser/UnmarshalStepParser.java | 2 +- .../k/loader/yaml/parser/ValidateStepParser.java | 2 +- .../k/loader/yaml/parser/WireTapStepParser.java| 2 +- .../camel/k/loader/yaml/spi/StartStepParser.java | 9 +++-- .../apache/camel/k/loader/yaml/spi/StepParser.java | 24 + .../apache/camel/k/loader/yaml/TestSupport.groovy | 4 +-- .../k/loader/yaml/parser/ErrorHandlerTest.groovy | 8 ++--- .../camel/k/loader/yaml/parser/FromTest.groovy | 4 +-- .../k/loader/yaml/parser/OnExceptionTest.groovy| 2 +- .../camel/k/loader/yaml/parser/RestTest.groovy | 8 ++--- .../camel/k/loader/yaml/support/MyBean.groovy} | 25 + .../quarkus/deployment/DeploymentProcessor.java| 2 -- .../k/knative/yaml/parser/KnativeStepParser.java | 2 +- .../camel/k/annotation/yaml/YAMLStepParser.java| 3 +- .../camel/k/tooling/maven/GenerateYamlSchema.java | 42 -- 56 files changed, 125 insertions(+), 109 deletions(-) diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/AggregateStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/AggregateStepParser.java index 92dfbd5..6955a93 100644 --- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/AggregateStepParser.java +++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/AggregateStepParser.java @@ -28,7 +28,7 @@ import org.apache.camel.model.ProcessorDefinition; import org.apache.camel.model.language.ExpressionDefinition; import org.apache.camel.reifier.AggregateReifier; -@YAMLStepParser(id = "aggregate", definitions = AggregateStepParser.Definition.class) +@YAMLStepParser(id = "aggregate", definition = AggregateStepParser.Definition.class) public class AggregateStepParser implements ProcessorStepParser { @
[camel-k-runtime] branch master updated (892702c -> f5b06d3)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from 892702c Generate schema for YAML DSL #358 add f5b06d3 Generate schema for YAML DSL #358 (change schema file name) No new revisions were added by this update. Summary of changes: camel-k-loader-yaml/camel-k-loader-yaml/pom.xml | 2 +- .../src/generated/resources/{yaml-schema.json => camel-yaml-dsl.json} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename camel-k-loader-yaml/camel-k-loader-yaml/src/generated/resources/{yaml-schema.json => camel-yaml-dsl.json} (99%)
[camel-k-runtime] branch master updated (9802e7b -> 0f996a0)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git. from 9802e7b Merge pull request #382 from apache/ra-4.3.1 new b83af3c Upgrade to Camel 3.4 #361 new 0f996a0 Event-loop blocked when using http component starting from knative #383 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: .../k/loader/groovy/GroovySourceLoader.groovy | 3 +- .../apache/camel/k/loader/groovy/LoaderTest.groovy | 4 +- .../k/loader/groovy/dsl/IntegrationTest.groovy | 6 +- camel-k-main/camel-k-runtime-health/pom.xml| 4 ++ .../camel/k/health/HealthContextCustomizer.java| 2 +- .../camel-k-quarkus-core/deployment/pom.xml| 12 .../quarkus/deployment/DeploymentProcessor.java| 31 +--- .../camel/k/core/quarkus/RuntimeRecorder.java | 8 --- .../camel-k-quarkus-cron/deployment/pom.xml| 12 .../camel-k-quarkus-knative/deployment/pom.xml | 12 .../deployment/pom.xml | 12 .../camel-k-quarkus-loader-java/deployment/pom.xml | 12 .../camel-k-quarkus-loader-js/deployment/pom.xml | 12 .../deployment/pom.xml | 12 .../camel-k-quarkus-loader-xml/deployment/pom.xml | 12 .../camel-k-quarkus-loader-yaml/deployment/pom.xml | 12 .../quarkus/deployment/DeploymentProcessor.java| 3 +- .../camel-k-runtime-quarkus/deployment/pom.xml | 16 ++--- .../k/quarkus/deployment/DeploymentProcessor.java | 41 +-- .../camel-k-runtime-quarkus/runtime/pom.xml| 4 ++ .../k/quarkus/ApplicationListenerAdapter.java} | 10 +-- .../camel/k/quarkus/ApplicationRecorder.java | 20 +++--- camel-knative/camel-knative-http/pom.xml | 4 ++ .../knative/http/KnativeHttpConsumer.java | 82 +++--- .../component/knative/http/KnativeHttpTest.java| 64 + .../data/application.properties| 4 +- .../pom.xml| 1 + .../camel-k-runtime-example-quarkus-xml/pom.xml| 1 + .../data/application.properties| 2 +- .../camel-k-runtime-example-quarkus-yaml/pom.xml | 1 + .../src/main/resources/conf/application.properties | 5 +- pom.xml| 10 +-- 32 files changed, 212 insertions(+), 222 deletions(-) rename camel-k-quarkus/{camel-k-quarkus-core/runtime/src/main/java/org/apache/camel/k/core/quarkus/RuntimeListenerAdapter.java => camel-k-runtime-quarkus/runtime/src/main/java/org/apache/camel/k/quarkus/ApplicationListenerAdapter.java} (94%) copy camel-k-runtime-core/src/main/java/org/apache/camel/k/Source.java => camel-k-quarkus/camel-k-runtime-quarkus/runtime/src/main/java/org/apache/camel/k/quarkus/ApplicationRecorder.java (66%)
[camel-k-runtime] 01/02: Upgrade to Camel 3.4 #361
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git commit b83af3cfe9e73ee1c724c57c1d74dc997a0bb3b8 Author: lburgazzoli AuthorDate: Fri Jul 3 18:16:45 2020 +0200 Upgrade to Camel 3.4 #361 --- .../k/loader/groovy/GroovySourceLoader.groovy | 3 +- .../apache/camel/k/loader/groovy/LoaderTest.groovy | 4 +-- .../k/loader/groovy/dsl/IntegrationTest.groovy | 6 ++-- camel-k-main/camel-k-runtime-health/pom.xml| 4 +++ .../camel/k/health/HealthContextCustomizer.java| 2 +- .../camel-k-quarkus-core/deployment/pom.xml| 12 --- .../quarkus/deployment/DeploymentProcessor.java| 31 ++-- .../camel/k/core/quarkus/RuntimeRecorder.java | 8 - .../camel-k-quarkus-cron/deployment/pom.xml| 12 --- .../camel-k-quarkus-knative/deployment/pom.xml | 12 --- .../deployment/pom.xml | 12 --- .../camel-k-quarkus-loader-java/deployment/pom.xml | 12 --- .../camel-k-quarkus-loader-js/deployment/pom.xml | 12 --- .../deployment/pom.xml | 12 --- .../camel-k-quarkus-loader-xml/deployment/pom.xml | 12 --- .../camel-k-quarkus-loader-yaml/deployment/pom.xml | 12 --- .../quarkus/deployment/DeploymentProcessor.java| 3 +- .../camel-k-runtime-quarkus/deployment/pom.xml | 16 +++-- .../k/quarkus/deployment/DeploymentProcessor.java | 41 ++ .../camel-k-runtime-quarkus/runtime/pom.xml| 4 +++ .../k/quarkus/ApplicationListenerAdapter.java} | 10 +++--- .../camel/k/quarkus/ApplicationRecorder.java} | 21 +-- .../data/application.properties| 4 +-- .../pom.xml| 1 + .../camel-k-runtime-example-quarkus-xml/pom.xml| 1 + .../data/application.properties| 2 +- .../camel-k-runtime-example-quarkus-yaml/pom.xml | 1 + .../src/main/resources/conf/application.properties | 5 +-- pom.xml| 10 +++--- 29 files changed, 86 insertions(+), 199 deletions(-) diff --git a/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/GroovySourceLoader.groovy b/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/GroovySourceLoader.groovy index 03db32b..f0e2fc8 100644 --- a/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/GroovySourceLoader.groovy +++ b/camel-k-loader-groovy/src/main/groovy/org/apache/camel/k/loader/groovy/GroovySourceLoader.groovy @@ -44,8 +44,7 @@ class GroovySourceLoader implements SourceLoader { cc.addCompilationCustomizers(ic) cc.setScriptBaseClass(DelegatingScript.class.getName()) -def cl = Thread.currentThread().getContextClassLoader() -def sh = new GroovyShell(cl, new Binding(), cc) +def sh = new GroovyShell(new Binding(), cc) def is = source.resolveAsInputStream(getContext()) is.withCloseable { diff --git a/camel-k-loader-groovy/src/test/groovy/org/apache/camel/k/loader/groovy/LoaderTest.groovy b/camel-k-loader-groovy/src/test/groovy/org/apache/camel/k/loader/groovy/LoaderTest.groovy index 4fa9e24..c637fda 100644 --- a/camel-k-loader-groovy/src/test/groovy/org/apache/camel/k/loader/groovy/LoaderTest.groovy +++ b/camel-k-loader-groovy/src/test/groovy/org/apache/camel/k/loader/groovy/LoaderTest.groovy @@ -74,10 +74,10 @@ class LoaderTest extends Specification { routes.size() == 1 with(routes[0].input, FromDefinition) { -it.endpointUri == 'timer:tick?period=1s' +it.endpointUri == 'timer://tick?period=1s' } with(routes[0].outputs[0], ToDefinition) { -it.endpointUri == 'log:info' +it.endpointUri == 'log://info' } } } diff --git a/camel-k-loader-groovy/src/test/groovy/org/apache/camel/k/loader/groovy/dsl/IntegrationTest.groovy b/camel-k-loader-groovy/src/test/groovy/org/apache/camel/k/loader/groovy/dsl/IntegrationTest.groovy index 409705e..11f29ac 100644 --- a/camel-k-loader-groovy/src/test/groovy/org/apache/camel/k/loader/groovy/dsl/IntegrationTest.groovy +++ b/camel-k-loader-groovy/src/test/groovy/org/apache/camel/k/loader/groovy/dsl/IntegrationTest.groovy @@ -181,10 +181,10 @@ class IntegrationTest extends Specification { context.start() then: context.routes?.size() == 1 -context.routes[0].routeContext.getOnException('my-on-exception') != null -context.routes[0].routeContext.getOnException('my-on-exception') instanceof FatalFallbackErrorHandler +
[camel-k-runtime] 02/02: Event-loop blocked when using http component starting from knative #383
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git commit 0f996a03f8a8904ec7dfc84f79aae4de68e641a2 Author: lburgazzoli AuthorDate: Thu Jul 9 12:14:40 2020 +0200 Event-loop blocked when using http component starting from knative #383 --- camel-knative/camel-knative-http/pom.xml | 4 ++ .../knative/http/KnativeHttpConsumer.java | 82 +++--- .../component/knative/http/KnativeHttpTest.java| 64 + 3 files changed, 125 insertions(+), 25 deletions(-) diff --git a/camel-knative/camel-knative-http/pom.xml b/camel-knative/camel-knative-http/pom.xml index c6d2c85..3ee7d3e 100644 --- a/camel-knative/camel-knative-http/pom.xml +++ b/camel-knative/camel-knative-http/pom.xml @@ -43,6 +43,10 @@ org.apache.camel camel-cloud + +org.apache.camel +camel-http + org.apache.camel.k diff --git a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java index 4764e40..4ce46b1 100644 --- a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java +++ b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java @@ -163,42 +163,74 @@ public class KnativeHttpConsumer extends DefaultConsumer { try { createUoW(exchange); -getAsyncProcessor().process(exchange, doneSync -> { -try { -HttpServerResponse response = toHttpResponse(request, exchange.getMessage()); -Buffer body = null; - -if (request.response().getStatusCode() != 204) { -body = computeResponseBody(exchange.getMessage()); - -// set the content type in the response. -String contentType = MessageHelper.getContentType(exchange.getMessage()); -if (contentType != null) { -// set content-type -response.putHeader(Exchange.CONTENT_TYPE, contentType); -} + +// We do not know if any of the processing logic of the route is synchronous or not so we +// need to process the request on a thread on the Vert.x worker pool. +// +// As example the following route may block the Vert.x event loop as the camel-http component +// is not async so if the service is scaled-down, the it may take a while to become ready and +// the camel-http component blocks until the service becomes available. +// +// from("knative:event/my.event") +// .to("http://{{env:PROJECT}}.{{env:NAMESPACE}}.svc.cluster.local/service";); +// +router.vertx().executeBlocking( +promise -> { +try { +// no need to use an async processor as the processing happen in +// a dedicated thread ans it won't block the Vert.x event loop +getProcessor().process(exchange); +promise.complete(); +} catch (Exception e) { +promise.fail(e); } +}, +false, +result -> { +if (result.succeeded()) { +try { +HttpServerResponse response = toHttpResponse(request, exchange.getMessage()); +Buffer body = null; + +if (request.response().getStatusCode() != 204) { +body = computeResponseBody(exchange.getMessage()); + +// set the content type in the response. +String contentType = MessageHelper.getContentType(exchange.getMessage()); +if (contentType != null) { +// set content-type +response.putHeader(Exchange.CONTENT_TYPE, contentType); +} +} + +if (body != null) { +request.response().end(body); +} else { +request.response().setStatusCode(204); +request.response().end(); +} +
[camel-k-examples] branch master updated: Fix a small typo in the telegram-consumer example
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git The following commit(s) were added to refs/heads/master by this push: new fa81a56 Fix a small typo in the telegram-consumer example fa81a56 is described below commit fa81a562321b0745d157355e57869242e8001d5f Author: Otavio Rodolfo Piske AuthorDate: Thu Jul 9 11:24:55 2020 +0200 Fix a small typo in the telegram-consumer example --- 03-knative-source-basic/telegram-consumer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/03-knative-source-basic/telegram-consumer.groovy b/03-knative-source-basic/telegram-consumer.groovy index 644fb61..b078279 100644 --- a/03-knative-source-basic/telegram-consumer.groovy +++ b/03-knative-source-basic/telegram-consumer.groovy @@ -6,4 +6,4 @@ from('knative:channel/telegram') .unmarshal() .json() .setBody { it.in.body.text } -.log('Recieved: ${body}') +.log('Received: ${body}')
[camel-quarkus] branch master updated: Add example about how to use @Handler with beans registered to the Camel Context
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git The following commit(s) were added to refs/heads/master by this push: new ab24056 Add example about how to use @Handler with beans registered to the Camel Context ab24056 is described below commit ab24056238f15d687a891e74ad6c08cfdf317f5e Author: lburgazzoli AuthorDate: Tue Jul 7 15:49:06 2020 +0200 Add example about how to use @Handler with beans registered to the Camel Context --- .../quarkus/component/bean/CamelResource.java | 8 + .../camel/quarkus/component/bean/CamelRoute.java | 11 ++ .../quarkus/component/bean/WithHandlerBean.java| 40 ++ .../camel/quarkus/component/bean/BeanTest.java | 10 ++ 4 files changed, 69 insertions(+) diff --git a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java index 666a5a0..7c52d6d 100644 --- a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java +++ b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java @@ -63,6 +63,14 @@ public class CamelResource { return template.requestBody("direct:method", statement, String.class); } +@Path("/handler") +@POST +@Consumes(MediaType.TEXT_PLAIN) +@Produces(MediaType.TEXT_PLAIN) +public String handler(String statement) { +return template.requestBody("direct:handler", statement, String.class); +} + @Path("/increment") @GET @Produces(MediaType.TEXT_PLAIN) diff --git a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelRoute.java b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelRoute.java index 54787a0..acef305 100644 --- a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelRoute.java +++ b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelRoute.java @@ -26,6 +26,7 @@ import java.util.concurrent.atomic.AtomicInteger; import io.quarkus.runtime.annotations.RegisterForReflection; import org.apache.camel.AsyncCallback; import org.apache.camel.AsyncProcessor; +import org.apache.camel.BindToRegistry; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.Processor; @@ -71,6 +72,10 @@ public class CamelRoute extends RouteBuilder { .bean(MyBean.class, "sayHello") .to("log:named"); +from("direct:handler") +.to("bean:withHandler") +.to("log:named"); + } @SuppressWarnings("unchecked") @@ -158,4 +163,10 @@ public class CamelRoute extends RouteBuilder { return "Hello " + body + " from the MyBean"; } } + +@BindToRegistry +public static WithHandlerBean withHandler() { +return new WithHandlerBean(); +} + } diff --git a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/WithHandlerBean.java b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/WithHandlerBean.java new file mode 100644 index 000..806617c --- /dev/null +++ b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/WithHandlerBean.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.bean; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import org.apache.camel.Exchange; +import org.apache.camel.Handler; + +@RegisterForReflection +public class WithHandlerBean { +/** + * Just set an hello message. + */ +@Handler +public void sayHello1(Exchange exchange) { +String body = exchange.getMessage().getBody(String.class); +exchange.getMessage().setBody("Hello &qu
[camel-quarkus] branch master updated: org.apache.camel.quarkus.main.CamelMainApplication should be registered for reflection #1453
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git The following commit(s) were added to refs/heads/master by this push: new 52f5641 org.apache.camel.quarkus.main.CamelMainApplication should be registered for reflection #1453 52f5641 is described below commit 52f56419d779d56c22423ca096772ae9d5b717ef Author: lburgazzoli AuthorDate: Fri Jul 3 18:44:59 2020 +0200 org.apache.camel.quarkus.main.CamelMainApplication should be registered for reflection #1453 --- .../camel/quarkus/main/deployment/CamelMainNativeImageProcessor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainNativeImageProcessor.java b/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainNativeImageProcessor.java index dd048ff..2ea03b5 100644 --- a/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainNativeImageProcessor.java +++ b/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainNativeImageProcessor.java @@ -30,6 +30,7 @@ public class CamelMainNativeImageProcessor { org.apache.camel.main.Resilience4jConfigurationProperties.class, org.apache.camel.model.Resilience4jConfigurationDefinition.class, org.apache.camel.model.Resilience4jConfigurationCommon.class, -org.apache.camel.spi.RestConfiguration.class); +org.apache.camel.spi.RestConfiguration.class, +org.apache.camel.quarkus.main.CamelMainApplication.class); } }
[camel-k-runtime] branch master updated: chore(ci): replace joschi/setup-jdk with AdoptOpenJDK/install-jdk
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git The following commit(s) were added to refs/heads/master by this push: new a92259f chore(ci): replace joschi/setup-jdk with AdoptOpenJDK/install-jdk a92259f is described below commit a92259f4497a9674535e6177e465414b5c30f112 Author: lburgazzoli AuthorDate: Fri Jul 3 18:39:27 2020 +0200 chore(ci): replace joschi/setup-jdk with AdoptOpenJDK/install-jdk --- .github/workflows/pr-build.yml| 18 +- .github/workflows/pr-validate.yml | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 12982e5..ac17e2c 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -25,10 +25,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 -- name: Set up JDK 11 - uses: joschi/setup-jdk@v1 +- name: Set up JDK 11 + uses: AdoptOpenJDK/install-jdk@v1 with: -java-version: 11 +version: '11' - name: mvn install run: ./mvnw -V -B -ntp clean install - name: Tar Maven Repo @@ -44,13 +44,13 @@ jobs: strategy: matrix: java: - - 14 + - '14' steps: - uses: actions/checkout@v2 - - name: Set up JDK - ${{ matrix.java }} -uses: joschi/setup-jdk@v1 + - name: Set up JDK - ${{ matrix.java }} +uses: AdoptOpenJDK/install-jdk@v1 with: - java-version: ${{ matrix.java }} + version: ${{ matrix.java }} - name: Build on ${{ matrix.java }} run: | ./mvnw -V -B -ntp clean install @@ -74,9 +74,9 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Set up JDK 11 -uses: joschi/setup-jdk@v1 +uses: AdoptOpenJDK/install-jdk@v1 with: - java-version: 11 + version: '11' - name: Download Maven Repo uses: actions/download-artifact@v1 with: diff --git a/.github/workflows/pr-validate.yml b/.github/workflows/pr-validate.yml index 1d2bda7..9fc2d43 100644 --- a/.github/workflows/pr-validate.yml +++ b/.github/workflows/pr-validate.yml @@ -26,9 +26,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 11 - uses: joschi/setup-jdk@v1 + uses: AdoptOpenJDK/install-jdk@v1 with: -java-version: 11 +version: '11' - name: mvn package run: | ./mvnw -fae -B -ntp clean package \
[camel-quarkus] 01/02: Ensure Quarkus Vertx instance is set on the camel component when not using camel-quarkus-main
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit 7ca801a652f411dadb4fd07bfd5fb96639da1bc0 Author: James Netherton AuthorDate: Thu Jun 25 14:53:09 2020 +0100 Ensure Quarkus Vertx instance is set on the camel component when not using camel-quarkus-main --- .../component/vertx/deployment/VertxProcessor.java | 11 +--- .../component/vertx/CamelVertxRecorder.java| 30 -- .../quarkus/component/vertx/it/VertxResource.java | 18 + .../quarkus/component/vertx/it/VertxTest.java | 8 ++ 4 files changed, 45 insertions(+), 22 deletions(-) diff --git a/extensions/vertx/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/deployment/VertxProcessor.java b/extensions/vertx/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/deployment/VertxProcessor.java index ef8971f..4ad69b7 100644 --- a/extensions/vertx/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/deployment/VertxProcessor.java +++ b/extensions/vertx/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/deployment/VertxProcessor.java @@ -17,9 +17,12 @@ package org.apache.camel.quarkus.component.vertx.deployment; import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.annotations.ExecutionTime; +import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.vertx.deployment.VertxBuildItem; -import io.vertx.core.Vertx; +import org.apache.camel.component.vertx.VertxComponent; +import org.apache.camel.quarkus.component.vertx.CamelVertxRecorder; import org.apache.camel.quarkus.core.deployment.spi.CamelRuntimeBeanBuildItem; class VertxProcessor { @@ -31,8 +34,10 @@ class VertxProcessor { return new FeatureBuildItem(FEATURE); } +@Record(ExecutionTime.RUNTIME_INIT) @BuildStep -CamelRuntimeBeanBuildItem configureVertxRegistryBean(VertxBuildItem vertx) { -return new CamelRuntimeBeanBuildItem("vertx", Vertx.class.getName(), vertx.getVertx()); +CamelRuntimeBeanBuildItem configureVertxRegistryBean(CamelVertxRecorder recorder, VertxBuildItem vertx) { +return new CamelRuntimeBeanBuildItem("vertx", VertxComponent.class.getName(), +recorder.createVertxComponent(vertx.getVertx())); } } diff --git a/integration-tests/vertx/src/test/java/org/apache/camel/quarkus/component/vertx/it/VertxTest.java b/extensions/vertx/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/CamelVertxRecorder.java similarity index 56% copy from integration-tests/vertx/src/test/java/org/apache/camel/quarkus/component/vertx/it/VertxTest.java copy to extensions/vertx/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/CamelVertxRecorder.java index ea284e8..d9f2c36 100644 --- a/integration-tests/vertx/src/test/java/org/apache/camel/quarkus/component/vertx/it/VertxTest.java +++ b/extensions/vertx/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/CamelVertxRecorder.java @@ -14,27 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.quarkus.component.vertx.it; +package org.apache.camel.quarkus.component.vertx; -import io.quarkus.test.junit.QuarkusTest; -import io.restassured.RestAssured; -import io.restassured.http.ContentType; -import org.junit.jupiter.api.Test; +import io.quarkus.runtime.RuntimeValue; +import io.quarkus.runtime.annotations.Recorder; +import io.vertx.core.Vertx; +import org.apache.camel.component.vertx.VertxComponent; -import static org.hamcrest.Matchers.is; +@Recorder +public class CamelVertxRecorder { -@QuarkusTest -class VertxTest { - -@Test -public void testVertxComponent() { -String message = "Camel Quarkus Vert.x"; -RestAssured.given() -.contentType(ContentType.TEXT) -.body(message) -.post("/vertx/post") -.then() -.statusCode(201) -.body(is("Hello " + message)); +public RuntimeValue createVertxComponent(RuntimeValue vertx) { +VertxComponent component = new VertxComponent(); +component.setVertx(vertx.getValue()); +return new RuntimeValue<>(component); } } diff --git a/integration-tests/vertx/src/main/java/org/apache/camel/quarkus/component/vertx/it/VertxResource.java b/integration-tests/vertx/src/main/java/org/apache/camel/quarkus/component/vertx/it/VertxResource.java index 33507a8..4045ef3 100644 --- a/integration-tests/vertx/src/main/java/org/apache/camel/quarkus/component/vertx/it/VertxResource.java +++ b/integration-tests/vertx/src/main/java/org/apache/camel/quarkus/component/vertx/it/VertxResource
[camel-quarkus] branch master updated (4aab307 -> cbbce7e)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git. from 4aab307 Make the local Antora build produce .htaccess file with redirects based on :page-aliases: attributes in the AsciiDoc pages the content of that file can by copied to https://github.com/apache/camel-website/blob/master/static/.htaccess new 7ca801a Ensure Quarkus Vertx instance is set on the camel component when not using camel-quarkus-main new cbbce7e Add documentation for vertx configuration 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: docs/modules/ROOT/pages/extensions/vertx.adoc | 6 ++ .../component/vertx/deployment/VertxProcessor.java | 11 --- .../vertx/runtime/src/main/doc/configuration.adoc | 2 ++ .../quarkus/component/vertx/CamelVertxRecorder.java| 14 -- .../quarkus/component/vertx/it/VertxResource.java | 18 ++ .../camel/quarkus/component/vertx/it/VertxTest.java| 8 6 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 extensions/vertx/runtime/src/main/doc/configuration.adoc copy extensions-core/xml-io/runtime/src/main/java/org/apache/camel/quarkus/component/xml/io/XmlIoRecorder.java => extensions/vertx/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/CamelVertxRecorder.java (69%)
[camel-quarkus] 02/02: Add documentation for vertx configuration
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git commit cbbce7ee6dbf12c5d8ef0da73c0fe90b8ebf Author: James Netherton AuthorDate: Fri Jun 26 07:39:23 2020 +0100 Add documentation for vertx configuration --- docs/modules/ROOT/pages/extensions/vertx.adoc| 6 ++ extensions/vertx/runtime/src/main/doc/configuration.adoc | 2 ++ 2 files changed, 8 insertions(+) diff --git a/docs/modules/ROOT/pages/extensions/vertx.adoc b/docs/modules/ROOT/pages/extensions/vertx.adoc index 54cc1e1..c3f0089 100644 --- a/docs/modules/ROOT/pages/extensions/vertx.adoc +++ b/docs/modules/ROOT/pages/extensions/vertx.adoc @@ -26,3 +26,9 @@ Please refer to the above link for usage and configuration details. Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications. + +== Additional Camel Quarkus configuration + +The extension leverages https://quarkus.io/guides/vertx[Quarkus Vert.x]. Various aspects of the Vert.x runtime can be configured +via the options outlined in the https://quarkus.io/guides/all-config#quarkus-vertx-core_quarkus-vertx-core[configuration guide]. + diff --git a/extensions/vertx/runtime/src/main/doc/configuration.adoc b/extensions/vertx/runtime/src/main/doc/configuration.adoc new file mode 100644 index 000..be07a03 --- /dev/null +++ b/extensions/vertx/runtime/src/main/doc/configuration.adoc @@ -0,0 +1,2 @@ +The extension leverages https://quarkus.io/guides/vertx[Quarkus Vert.x]. Various aspects of the Vert.x runtime can be configured +via the options outlined in the https://quarkus.io/guides/all-config#quarkus-vertx-core_quarkus-vertx-core[configuration guide].