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 authored and ppalaga committed Sep 2, 2020
1 parent eb2701a commit 952d2b0
Show file tree
Hide file tree
Showing 17 changed files with 420 additions and 1 deletion.
1 change: 1 addition & 0 deletions catalog/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 3 additions & 0 deletions docs/modules/ROOT/pages/reference/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 3 additions & 0 deletions docs/modules/ROOT/pages/reference/others.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

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,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"

0 comments on commit 952d2b0

Please sign in to comment.