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 10, 2020
1 parent 9ae95f2 commit 60bbebc
Show file tree
Hide file tree
Showing 15 changed files with 405 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/extensions/aws-s3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[.badges]
[.badge-key]##Since Camel Quarkus##[.badge-version]##0.2.0## [.badge-key]##JVM##[.badge-supported]##supported## [.badge-key]##Native##[.badge-supported]##supported##

Store and retrie objects from AWS S3 Storage Service.
Store and retrieve objects from AWS S3 Storage Service.

== What's inside

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/extensions/aws2-s3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[.badges]
[.badge-key]##Since Camel Quarkus##[.badge-version]##1.0.0-M7## [.badge-key]##JVM##[.badge-supported]##supported## [.badge-key]##Native##[.badge-supported]##supported##

Store and retrie objects from AWS S3 Storage Service using AWS SDK version 2.x.
Store and retrieve objects from AWS S3 Storage Service using AWS SDK version 2.x.

== What's inside

Expand Down
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.
8 changes: 5 additions & 3 deletions docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Number of Camel components: 154 in 119 JAR artifacts (0 deprecated)

| xref:extensions/aws2-mq.adoc[AWS 2 MQ] | camel-quarkus-aws2-mq | Native + Stable | 1.0.0-M6 | Manage AWS MQ instances using AWS SDK version 2.x.

| xref:extensions/aws2-s3.adoc[AWS 2 S3 Storage Service] | camel-quarkus-aws2-s3 | Native + Stable | 1.0.0-M7 | Store and retrie objects from AWS S3 Storage Service using AWS SDK version 2.x.
| xref:extensions/aws2-s3.adoc[AWS 2 S3 Storage Service] | camel-quarkus-aws2-s3 | Native + Stable | 1.0.0-M7 | Store and retrieve objects from AWS S3 Storage Service using AWS SDK version 2.x.

| xref:extensions/aws2-ses.adoc[AWS 2 Simple Email Service (SES)] | camel-quarkus-aws2-ses | Native + Stable | 1.0.0-M6 | Send e-mails through AWS SES service using AWS SDK version 2.x.

Expand All @@ -82,7 +82,7 @@ Number of Camel components: 154 in 119 JAR artifacts (0 deprecated)

| xref:extensions/aws-lambda.adoc[AWS Lambda] | camel-quarkus-aws-lambda | Native + Stable | 1.0.0-M3 | Manage and invoke AWS Lambda functions.

| xref:extensions/aws-s3.adoc[AWS S3 Storage Service] | camel-quarkus-aws-s3 | Native + Stable | 0.2.0 | Store and retrie objects from AWS S3 Storage Service.
| xref:extensions/aws-s3.adoc[AWS S3 Storage Service] | camel-quarkus-aws-s3 | Native + Stable | 0.2.0 | Store and retrieve objects from AWS S3 Storage Service.

| xref:extensions/aws-sns.adoc[AWS Simple Notification System (SNS)] | camel-quarkus-aws-sns | Native + Stable | 0.2.0 | Send messages to an AWS Simple Notification Topic.

Expand Down Expand Up @@ -437,7 +437,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 @@ -473,6 +473,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);
}
});
}
}

0 comments on commit 60bbebc

Please sign in to comment.