Skip to content

Commit

Permalink
Extension for camel-threadpoolfactory-vertx apache#1430
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriOndrusek committed Jul 28, 2020
1 parent f63b185 commit d913ac9
Show file tree
Hide file tree
Showing 13 changed files with 401 additions and 1 deletion.
28 changes: 28 additions & 0 deletions docs/modules/ROOT/pages/extensions/threadpoolfactory-vertx.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page

[[threadpoolfactory-vertx]]
= ThreadPoolFactory Vert.x

[.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.
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ Number of Camel languages: 13 in 7 JAR artifacts (0 deprecated)
== Miscellaneous Extensions

// others: START
Number of miscellaneous extensions: 17 in 17 JAR artifacts (1 deprecated)
Number of miscellaneous extensions: 18 in 18 JAR artifacts (1 deprecated)

[width="100%",cols="4,1,1,1,5",options="header"]
|===
Expand Down Expand Up @@ -475,6 +475,8 @@ Number of miscellaneous extensions: 17 in 17 JAR artifacts (1 deprecated)

| xref:extensions/reactive-executor.adoc[Reactive Executor Vert.x] | camel-quarkus-reactive-executor | Native + Stable | 0.3.0 | Reactive Executor for camel-core using Vert.x

| xref:extensions/threadpoolfactory-vertx.adoc[ThreadPoolFactory Vert.x] | camel-quarkus-threadpoolfactory-vertx | Native + Stable | 1.0.0-CR4 | ThreadPoolFactory for camel-core using Vert.x

| xref:extensions/xml-io.adoc[XML IO] | camel-quarkus-xml-io | Native + Stable | 1.0.0-M5 | An XML stack for parsing XML route definitions. A fast an light weight alternative to camel-quarkus-xml-jaxp

| xref:extensions/xml-jaxb.adoc[XML JAXB] | camel-quarkus-xml-jaxb | Native + Stable | 1.0.0-M5 | An XML stack for parsing XML route definitions. A legacy alternative to the fast an light weight camel-quarkus-xml-io
Expand Down
1 change: 1 addition & 0 deletions extensions-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
67 changes: 67 additions & 0 deletions extensions-core/threadpoolfactory-vertx/deployment/pom.xml
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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()));
}
}
39 changes: 39 additions & 0 deletions extensions-core/threadpoolfactory-vertx/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?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-build-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../../poms/build-parent/pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-threadpoolfactory-vertx-parent</artifactId>
<name>Camel Quarkus :: ThreadPoolFactory Vert.x</name>
<packaging>pom</packaging>

<modules>
<module>deployment</module>
<module>runtime</module>
</modules>
</project>
100 changes: 100 additions & 0 deletions extensions-core/threadpoolfactory-vertx/runtime/pom.xml
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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);
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# 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/components/latest/others/reactive-threadpoolfactory-vertx.html"
categories:
- "integration"
4 changes: 4 additions & 0 deletions integration-tests/main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-reactive-executor</artifactId>
</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>
Expand Down

0 comments on commit d913ac9

Please sign in to comment.