Skip to content

Commit

Permalink
Extension for camel-threadpoolfactory-vertx #1430
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriOndrusek authored and ppalaga committed Aug 19, 2020
1 parent d99374c commit 9d2b2e0
Show file tree
Hide file tree
Showing 16 changed files with 418 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
*** xref:reference/extensions/stream.adoc[Stream]
*** 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/tagsoup.adoc[TidyMarkup]
*** xref:reference/extensions/tika.adoc[Tika]
*** xref:reference/extensions/timer.adoc[Timer]
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.
5 changes: 4 additions & 1 deletion docs/modules/ROOT/pages/reference/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In case you are missing some extension in the list:
https://github.com/apache/camel-quarkus/issues[report] any issues you encounter.
====

166 extensions (2 deprecated, 14 JVM only)
167 extensions (2 deprecated, 14 JVM only)

[width="100%",cols="4,1,1,1,5",options="header"]
|===
Expand Down Expand Up @@ -473,6 +473,9 @@ Stable | 0.3.0 | Archive files into tarballs or extract files from tarballs.
| xref:reference/extensions/telegram.adoc[Telegram] | camel-quarkus-telegram | 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 | Native +
Stable | 1.0.0-CR4 | ThreadPoolFactory for camel-core using Vert.x

| xref:reference/extensions/tagsoup.adoc[TidyMarkup] | camel-quarkus-tagsoup | Native +
Stable | 1.0.0 | Parse (potentially invalid) HTML into valid HTML or DOM.

Expand Down
5 changes: 4 additions & 1 deletion docs/modules/ROOT/pages/reference/others.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[camel-quarkus-others]
= Camel misc. components supported on Quarkus

18 misc. components in 18 JAR artifacts (1 deprecated)
19 misc. components in 19 JAR artifacts (1 deprecated)

[width="100%",cols="4,1,1,1,5",options="header"]
|===
Expand Down 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-quarkus-smallrye-reactive-messaging | Native +
Stable | 1.0.0 | Camel integration with SmallRye Reactive Messaging

| xref:reference/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:reference/extensions/xml-io.adoc[XML IO] | camel-quarkus-xml-io | 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);
}
});
}
}

0 comments on commit 9d2b2e0

Please sign in to comment.