This is an automated email from the ASF dual-hosted git repository. ppalaga pushed a commit to branch camel-master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit a0bd928254b74728f24b0f1d34d38964546d6e28 Author: JiriOndrusek <ondrusek.j...@gmail.com> AuthorDate: Tue Jul 7 15:34:29 2020 +0200 Extension for camel-threadpoolfactory-vertx #1430 --- catalog/pom.xml | 1 + docs/modules/ROOT/nav.adoc | 1 + .../extensions/threadpoolfactory-vertx.adoc | 29 ++++++ docs/modules/ROOT/pages/reference/index.adoc | 3 + docs/modules/ROOT/pages/reference/others.adoc | 3 + extensions-core/pom.xml | 1 + .../threadpoolfactory-vertx/deployment/pom.xml | 67 ++++++++++++++ .../ThreadpoolfactoryVertxProcessor.java | 42 +++++++++ .../{ => threadpoolfactory-vertx}/pom.xml | 25 ++---- .../threadpoolfactory-vertx/runtime/pom.xml | 100 +++++++++++++++++++++ .../vertx/ThreadPoolFactoryVertxRecorder.java | 40 +++++++++ .../main/resources/META-INF/quarkus-extension.yaml | 31 +++++++ .../cassandraql/integration-test/pom.xml | 10 +++ integration-tests/main/pom.xml | 6 +- .../camel/quarkus/main/CoreMainResource.java | 19 ++++ .../apache/camel/quarkus/main/CoreMainTest.java | 14 +++ poms/bom/pom.xml | 15 ++++ 17 files changed, 390 insertions(+), 17 deletions(-) diff --git a/catalog/pom.xml b/catalog/pom.xml index 9fc53e8..d286eda 100644 --- a/catalog/pom.xml +++ b/catalog/pom.xml @@ -265,6 +265,7 @@ camel-quarkus-tagsoup camel-quarkus-tarfile camel-quarkus-telegram + camel-quarkus-threadpoolfactory-vertx camel-quarkus-thrift camel-quarkus-tika camel-quarkus-timer diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index f52a6bf..68830af 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -216,6 +216,7 @@ *** xref:reference/extensions/stub.adoc[Stub] *** xref:reference/extensions/tarfile.adoc[Tar File] *** xref:reference/extensions/telegram.adoc[Telegram] +*** xref:reference/extensions/threadpoolfactory-vertx.adoc[ThreadPoolFactory Vert.x] *** xref:reference/extensions/thrift.adoc[Thrift] *** xref:reference/extensions/tagsoup.adoc[TidyMarkup] *** xref:reference/extensions/tika.adoc[Tika] diff --git a/docs/modules/ROOT/pages/reference/extensions/threadpoolfactory-vertx.adoc b/docs/modules/ROOT/pages/reference/extensions/threadpoolfactory-vertx.adoc new file mode 100644 index 0000000..315f5e5 --- /dev/null +++ b/docs/modules/ROOT/pages/reference/extensions/threadpoolfactory-vertx.adoc @@ -0,0 +1,29 @@ +// Do not edit directly! +// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page + +[[threadpoolfactory-vertx]] += ThreadPoolFactory Vert.x +:page-aliases: extensions/threadpoolfactory-vertx.adoc + +[.badges] +[.badge-key]##Since Camel Quarkus##[.badge-version]##1.0.0-CR4## [.badge-key]##JVM##[.badge-supported]##supported## [.badge-key]##Native##[.badge-supported]##supported## + +ThreadPoolFactory for camel-core using Vert.x + +== What's inside + +* https://camel.apache.org/components/latest/others/threadpoolfactory-vertx.html[ThreadPoolFactory Vert.x] + +Please refer to the above link for usage and configuration details. + +== Maven coordinates + +[source,xml] +---- +<dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-threadpoolfactory-vertx</artifactId> +</dependency> +---- + +Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications. diff --git a/docs/modules/ROOT/pages/reference/index.adoc b/docs/modules/ROOT/pages/reference/index.adoc index 76a338c..76670d0 100644 --- a/docs/modules/ROOT/pages/reference/index.adoc +++ b/docs/modules/ROOT/pages/reference/index.adoc @@ -626,6 +626,9 @@ Stable | 0.3.0 | Archive files into tarballs or extract files from tarballs. | xref:reference/extensions/telegram.adoc[Telegram] | camel-quarkus-telegram | [.camel-element-Native]##Native## + Stable | 1.0.0 | Send and receive messages acting as a Telegram Bot Telegram Bot API. +| xref:reference/extensions/threadpoolfactory-vertx.adoc[ThreadPoolFactory Vert.x] | camel-quarkus-threadpoolfactory-vertx | [.camel-element-Native]##Native## + +Stable | 1.0.0-CR4 | ThreadPoolFactory for camel-core using Vert.x + | xref:reference/extensions/thrift.adoc[Thrift] | camel-quarkus-thrift | [.camel-element-JVM]##JVM## + Preview | 1.1.0 | Call and expose remote procedures (RPC) with Apache Thrift data format and serialization mechanism. diff --git a/docs/modules/ROOT/pages/reference/others.adoc b/docs/modules/ROOT/pages/reference/others.adoc index 731fd42..57a79bf 100644 --- a/docs/modules/ROOT/pages/reference/others.adoc +++ b/docs/modules/ROOT/pages/reference/others.adoc @@ -58,6 +58,9 @@ Stable | 0.3.0 | Reactive Executor for camel-core using Vert.x | xref:reference/extensions/smallrye-reactive-messaging.adoc[SmallRye Reactive Messaging] | [.camel-element-artifact]##camel-quarkus-smallrye-reactive-messaging## | [.camel-element-Native]##Native## + Stable | 1.0.0 | Camel integration with SmallRye Reactive Messaging +| xref:reference/extensions/threadpoolfactory-vertx.adoc[ThreadPoolFactory Vert.x] | [.camel-element-artifact]##camel-quarkus-threadpoolfactory-vertx## | [.camel-element-Native]##Native## + +Stable | 1.0.0-CR4 | ThreadPoolFactory for camel-core using Vert.x + | xref:reference/extensions/xml-io.adoc[XML IO] | [.camel-element-artifact]##camel-quarkus-xml-io## | [.camel-element-Native]##Native## + Stable | 1.0.0 | An XML stack for parsing XML route definitions. A fast an light weight alternative to camel-quarkus-xml-jaxp diff --git a/extensions-core/pom.xml b/extensions-core/pom.xml index 8d687ce..12a4aa0 100644 --- a/extensions-core/pom.xml +++ b/extensions-core/pom.xml @@ -36,6 +36,7 @@ <module>core-cloud</module> <module>http-common</module> <module>reactive-executor</module> + <module>threadpoolfactory-vertx</module> <module>xml-io</module> <module>xml-jaxb</module> <module>xml-jaxp</module> diff --git a/extensions-core/threadpoolfactory-vertx/deployment/pom.xml b/extensions-core/threadpoolfactory-vertx/deployment/pom.xml new file mode 100644 index 0000000..df8bca0 --- /dev/null +++ b/extensions-core/threadpoolfactory-vertx/deployment/pom.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="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"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-threadpoolfactory-vertx-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-threadpoolfactory-vertx-deployment</artifactId> + <name>Camel Quarkus :: ThreadPoolFactory Vert.x :: Deployment</name> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-core-deployment</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-threadpoolfactory-vertx</artifactId> + </dependency> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-vertx-deployment</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/extensions-core/threadpoolfactory-vertx/deployment/src/main/java/org/apache/camel/quarkus/component/threadpoolfactory/vertx/deployment/ThreadpoolfactoryVertxProcessor.java b/extensions-core/threadpoolfactory-vertx/deployment/src/main/java/org/apache/camel/quarkus/component/threadpoolfactory/vertx/deployment/ThreadpoolfactoryVertxProcessor.java new file mode 100644 index 0000000..669245d --- /dev/null +++ b/extensions-core/threadpoolfactory-vertx/deployment/src/main/java/org/apache/camel/quarkus/component/threadpoolfactory/vertx/deployment/ThreadpoolfactoryVertxProcessor.java @@ -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. + */ +package org.apache.camel.quarkus.component.threadpoolfactory.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 org.apache.camel.quarkus.component.threadpoolfactory.vertx.ThreadPoolFactoryVertxRecorder; +import org.apache.camel.quarkus.core.deployment.spi.RuntimeCamelContextCustomizerBuildItem; + +class ThreadpoolfactoryVertxProcessor { + + private static final String FEATURE = "camel-threadpoolfactory-vertx"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + + @Record(value = ExecutionTime.RUNTIME_INIT, optional = true) + @BuildStep + public RuntimeCamelContextCustomizerBuildItem threadPoolFactoryCustomizer(ThreadPoolFactoryVertxRecorder recorder, + VertxBuildItem vertx) { + return new RuntimeCamelContextCustomizerBuildItem(recorder.createThreadPoolFactoryCustomizer(vertx.getVertx())); + } +} diff --git a/extensions-core/pom.xml b/extensions-core/threadpoolfactory-vertx/pom.xml similarity index 61% copy from extensions-core/pom.xml copy to extensions-core/threadpoolfactory-vertx/pom.xml index 8d687ce..01581ff 100644 --- a/extensions-core/pom.xml +++ b/extensions-core/threadpoolfactory-vertx/pom.xml @@ -17,30 +17,23 @@ limitations under the License. --> -<project xmlns="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"> - +<project xmlns="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"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus</artifactId> + <artifactId>camel-quarkus-build-parent</artifactId> <version>1.1.0-SNAPSHOT</version> + <relativePath>../../poms/build-parent/pom.xml</relativePath> </parent> - <artifactId>camel-quarkus-extensions-core</artifactId> + <artifactId>camel-quarkus-threadpoolfactory-vertx-parent</artifactId> + <name>Camel Quarkus :: ThreadPoolFactory Vert.x</name> <packaging>pom</packaging> - <name>Camel Quarkus :: Extensions :: Core</name> - <modules> - <module>core</module> - <module>core-cloud</module> - <module>http-common</module> - <module>reactive-executor</module> - <module>xml-io</module> - <module>xml-jaxb</module> - <module>xml-jaxp</module> - <module>caffeine-lrucache</module> - <module>main</module> + <module>deployment</module> + <module>runtime</module> </modules> - </project> diff --git a/extensions-core/threadpoolfactory-vertx/runtime/pom.xml b/extensions-core/threadpoolfactory-vertx/runtime/pom.xml new file mode 100644 index 0000000..168d891 --- /dev/null +++ b/extensions-core/threadpoolfactory-vertx/runtime/pom.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="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"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-threadpoolfactory-vertx-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-threadpoolfactory-vertx</artifactId> + <name>Camel Quarkus :: ThreadPoolFactory Vert.x :: Runtime</name> + <description>ThreadPoolFactory for camel-core using Vert.x</description> + + <properties> + <firstVersion>1.0.0-CR4</firstVersion> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bom</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-threadpoolfactory-vertx</artifactId> + </dependency> + + <!-- quarkus --> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-vertx</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-maven-plugin</artifactId> + <executions> + <execution> + <id>update-extension-doc-page</id> + <goals><goal>update-extension-doc-page</goal></goals> + <phase>process-classes</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-bootstrap-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/extensions-core/threadpoolfactory-vertx/runtime/src/main/java/org/apache/camel/quarkus/component/threadpoolfactory/vertx/ThreadPoolFactoryVertxRecorder.java b/extensions-core/threadpoolfactory-vertx/runtime/src/main/java/org/apache/camel/quarkus/component/threadpoolfactory/vertx/ThreadPoolFactoryVertxRecorder.java new file mode 100644 index 0000000..833bd0d --- /dev/null +++ b/extensions-core/threadpoolfactory-vertx/runtime/src/main/java/org/apache/camel/quarkus/component/threadpoolfactory/vertx/ThreadPoolFactoryVertxRecorder.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.threadpoolfactory.vertx; + +import io.quarkus.runtime.RuntimeValue; +import io.quarkus.runtime.annotations.Recorder; +import io.vertx.core.Vertx; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.quarkus.core.CamelContextCustomizer; +import org.apache.camel.reactive.vertx.VertXThreadPoolFactory; + +@Recorder +public class ThreadPoolFactoryVertxRecorder { + public RuntimeValue<CamelContextCustomizer> createThreadPoolFactoryCustomizer(RuntimeValue<Vertx> vertx) { + return new RuntimeValue<>(new CamelContextCustomizer() { + @Override + public void customize(CamelContext context) { + VertXThreadPoolFactory threadPoolFactory = new VertXThreadPoolFactory(); + threadPoolFactory.setVertx(vertx.getValue()); + + context.adapt(ExtendedCamelContext.class).getExecutorServiceManager().setThreadPoolFactory(threadPoolFactory); + } + }); + } +} diff --git a/extensions-core/threadpoolfactory-vertx/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions-core/threadpoolfactory-vertx/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000..9b28950 --- /dev/null +++ b/extensions-core/threadpoolfactory-vertx/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,31 @@ +# +# 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. +# + +# This is a generated file. Do not edit directly! +# To re-generate, run the following command from the top level directory: +# +# mvn -N cq:update-quarkus-metadata +# +--- +name: "Camel ThreadPoolFactory Vert.x" +description: "ThreadPoolFactory for camel-core using Vert.x" +metadata: + guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/threadpoolfactory-vertx.html" + categories: + - "integration" + status: + - "stable" diff --git a/extensions-jvm/cassandraql/integration-test/pom.xml b/extensions-jvm/cassandraql/integration-test/pom.xml index f0649da..e474676 100644 --- a/extensions-jvm/cassandraql/integration-test/pom.xml +++ b/extensions-jvm/cassandraql/integration-test/pom.xml @@ -44,6 +44,16 @@ <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-cassandraql</artifactId> + <exclusions> + <exclusion> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy</artifactId> + </exclusion> + <exclusion> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy-json</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>io.quarkus</groupId> diff --git a/integration-tests/main/pom.xml b/integration-tests/main/pom.xml index 1be9480..f16bc56 100644 --- a/integration-tests/main/pom.xml +++ b/integration-tests/main/pom.xml @@ -36,7 +36,7 @@ <!-- explicit dependencies of this module in the Maven sense, although they are required by the Quarkus Maven plugin. --> <!-- Please update the rule whenever you change the dependencies of this module by running --> <!-- mvn process-resources -Pformat from the root directory --> - <mvnd.builder.rule>camel-quarkus-componentdsl-deployment,camel-quarkus-direct-deployment,camel-quarkus-endpointdsl-deployment,camel-quarkus-log-deployment,camel-quarkus-main-deployment,camel-quarkus-reactive-executor-deployment,camel-quarkus-support-policy-deployment,camel-quarkus-timer-deployment</mvnd.builder.rule> + <mvnd.builder.rule>camel-quarkus-componentdsl-deployment,camel-quarkus-direct-deployment,camel-quarkus-endpointdsl-deployment,camel-quarkus-log-deployment,camel-quarkus-main-deployment,camel-quarkus-reactive-executor-deployment,camel-quarkus-support-policy-deployment,camel-quarkus-threadpoolfactory-vertx-deployment,camel-quarkus-timer-deployment</mvnd.builder.rule> </properties> <dependencies> @@ -58,6 +58,10 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-threadpoolfactory-vertx</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-direct</artifactId> </dependency> <dependency> diff --git a/integration-tests/main/src/main/java/org/apache/camel/quarkus/main/CoreMainResource.java b/integration-tests/main/src/main/java/org/apache/camel/quarkus/main/CoreMainResource.java index 4985754..df1a819 100644 --- a/integration-tests/main/src/main/java/org/apache/camel/quarkus/main/CoreMainResource.java +++ b/integration-tests/main/src/main/java/org/apache/camel/quarkus/main/CoreMainResource.java @@ -41,11 +41,13 @@ import org.apache.camel.model.ModelCamelContext; import org.apache.camel.quarkus.core.FastFactoryFinderResolver; import org.apache.camel.quarkus.it.support.typeconverter.MyPair; import org.apache.camel.reactive.vertx.VertXReactiveExecutor; +import org.apache.camel.reactive.vertx.VertXThreadPoolFactory; import org.apache.camel.spi.BeanRepository; import org.apache.camel.spi.DataFormat; import org.apache.camel.spi.FactoryFinderResolver; import org.apache.camel.spi.Language; import org.apache.camel.spi.ReactiveExecutor; +import org.apache.camel.spi.ThreadPoolFactory; import org.apache.camel.support.DefaultRegistry; import org.apache.camel.support.LRUCacheFactory; import org.apache.camel.support.processor.DefaultExchangeFormatter; @@ -185,6 +187,23 @@ public class CoreMainResource { return builder.build(); } + @Path("/context/thread-pool-factory") + @GET + @Produces(MediaType.TEXT_PLAIN) + public JsonObject threadPoolFactory() { + ThreadPoolFactory threadPoolFactory = main.getCamelContext().adapt(ExtendedCamelContext.class) + .getExecutorServiceManager().getThreadPoolFactory(); + + JsonObjectBuilder builder = Json.createObjectBuilder(); + builder.add("class", threadPoolFactory.getClass().getName()); + + if (threadPoolFactory instanceof VertXThreadPoolFactory) { + builder.add("configured", ((VertXThreadPoolFactory) threadPoolFactory).getVertx() != null); + } + + return builder.build(); + } + @Path("/converter/my-pair") @POST @Produces(MediaType.APPLICATION_JSON) diff --git a/integration-tests/main/src/test/java/org/apache/camel/quarkus/main/CoreMainTest.java b/integration-tests/main/src/test/java/org/apache/camel/quarkus/main/CoreMainTest.java index 448b22e..1e2aeb0 100644 --- a/integration-tests/main/src/test/java/org/apache/camel/quarkus/main/CoreMainTest.java +++ b/integration-tests/main/src/test/java/org/apache/camel/quarkus/main/CoreMainTest.java @@ -32,6 +32,7 @@ import org.apache.camel.quarkus.core.DisabledXMLRoutesDefinitionLoader; import org.apache.camel.quarkus.core.RegistryRoutesLoaders; import org.apache.camel.quarkus.it.support.mainlistener.CustomMainListener; import org.apache.camel.reactive.vertx.VertXReactiveExecutor; +import org.apache.camel.reactive.vertx.VertXThreadPoolFactory; import org.apache.camel.support.DefaultLRUCacheFactory; import org.junit.jupiter.api.Test; @@ -167,6 +168,19 @@ public class CoreMainTest { } @Test + public void testThreadPoolFactory() { + JsonPath executor = RestAssured.when().get("/test/context/thread-pool-factory") + .then() + .statusCode(200) + .extract() + .body() + .jsonPath(); + + assertThat(executor.getString("class")).isEqualTo(VertXThreadPoolFactory.class.getName()); + assertThat(executor.getBoolean("configured")).isTrue(); + } + + @Test public void testCustomTypeConverter() { RestAssured.given() .contentType(ContentType.TEXT).body("a:b") diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml index 8212a0e..293293c 100644 --- a/poms/bom/pom.xml +++ b/poms/bom/pom.xml @@ -1453,6 +1453,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-threadpoolfactory-vertx</artifactId> + <version>${camel.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-thrift</artifactId> <version>${camel.version}</version> </dependency> @@ -3850,6 +3855,16 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-threadpoolfactory-vertx</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-threadpoolfactory-vertx-deployment</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-thrift</artifactId> <version>${camel-quarkus.version}</version> </dependency>