You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2022/10/18 06:40:45 UTC

[camel-quarkus] branch quarkus-main updated (4da31f5af3 -> 5b4e800f14)

This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a change to branch quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


 discard 4da31f5af3 Disable OptaPlanner tests due to #4116
 discard 5ddcd8134e Fix handling of quartz autowired scheduler
 discard 4623eb5f26 Upgrade Quarkus to 2.14.0.CR1
     new bda0fdadd4 Upgrade Quarkus to 2.14.0.CR1
     new ae8b9a8f68 Fix handling of quartz autowired scheduler
     new 5b4e800f14 Disable OptaPlanner tests due to #4116

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (4da31f5af3)
            \
             N -- N -- N   refs/heads/quarkus-main (5b4e800f14)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 extensions/opentelemetry/runtime/pom.xml | 6 ++++++
 1 file changed, 6 insertions(+)


[camel-quarkus] 01/03: Upgrade Quarkus to 2.14.0.CR1

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit bda0fdadd4dfa9d6f98f22b7a0092252604fae0c
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Sep 15 13:34:36 2022 +0100

    Upgrade Quarkus to 2.14.0.CR1
---
 docs/antora.yml                                    |  2 +-
 .../quarkus/core/deployment/ConsumeProcessor.java  |  2 +-
 .../core/deployment/InjectionPointsProcessor.java  |  2 +-
 .../component/grpc/deployment/GrpcProcessor.java   | 11 +++--
 extensions/opentelemetry/runtime/pom.xml           |  6 +++
 integration-tests/kubernetes/pom.xml               | 55 +++++++++++-----------
 integration-tests/master-openshift/pom.xml         |  3 --
 pom.xml                                            | 10 ++--
 poms/bom/src/main/generated/flattened-full-pom.xml |  4 +-
 .../src/main/generated/flattened-reduced-pom.xml   |  4 +-
 .../generated/flattened-reduced-verbose-pom.xml    |  4 +-
 11 files changed, 54 insertions(+), 49 deletions(-)

diff --git a/docs/antora.yml b/docs/antora.yml
index 32159412e3..66590918f5 100644
--- a/docs/antora.yml
+++ b/docs/antora.yml
@@ -30,7 +30,7 @@ asciidoc:
     # Project versions
     camel-version: 3.18.2 # replace ${camel.version}
     camel-docs-version: 3.18.x # replace ${camel.docs.components.version}
-    quarkus-version: 2.13.2.Final # replace ${quarkus.version}
+    quarkus-version: 999-SNAPSHOT # replace ${quarkus.version}
     graalvm-version: 22.2.0 # replace ${graalvm.version}
     graalvm-docs-version: 22.2
     min-maven-version: 3.8.2 # replace ${min-maven-version}
diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/ConsumeProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/ConsumeProcessor.java
index caa397c872..13f14d584c 100644
--- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/ConsumeProcessor.java
+++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/ConsumeProcessor.java
@@ -101,7 +101,7 @@ public class ConsumeProcessor {
                     /* If there is @Consume on a method, make the declaring class a named injectable bean */
                     String beanName = namedValue(classInfo);
                     final Transformation transform = ctx.transform();
-                    if (!classInfo.annotations().keySet().stream().anyMatch(BEAN_DEFINING_ANNOTATIONS::contains)) {
+                    if (!classInfo.annotationsMap().keySet().stream().anyMatch(BEAN_DEFINING_ANNOTATIONS::contains)) {
                         /* Only add @Singleton if there is no other bean defining annotation yet */
                         transform.add(Singleton.class);
                     }
diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/InjectionPointsProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/InjectionPointsProcessor.java
index e37c6a9399..5e4b471dd1 100644
--- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/InjectionPointsProcessor.java
+++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/InjectionPointsProcessor.java
@@ -124,7 +124,7 @@ public class InjectionPointsProcessor {
 
             if (injectionPoint.getTarget().kind() == AnnotationTarget.Kind.METHOD) {
                 final MethodInfo target = injectionPoint.getTarget().asMethod();
-                final List<Type> types = target.parameters();
+                final List<Type> types = target.parameterTypes();
 
                 for (int i = 0; i < types.size(); i++) {
                     Type type = types.get(0);
diff --git a/extensions/grpc/deployment/src/main/java/org/apache/camel/quarkus/component/grpc/deployment/GrpcProcessor.java b/extensions/grpc/deployment/src/main/java/org/apache/camel/quarkus/component/grpc/deployment/GrpcProcessor.java
index ec0efa729e..10a0d20e0c 100644
--- a/extensions/grpc/deployment/src/main/java/org/apache/camel/quarkus/component/grpc/deployment/GrpcProcessor.java
+++ b/extensions/grpc/deployment/src/main/java/org/apache/camel/quarkus/component/grpc/deployment/GrpcProcessor.java
@@ -48,6 +48,7 @@ import org.jboss.jandex.ClassInfo;
 import org.jboss.jandex.DotName;
 import org.jboss.jandex.IndexView;
 import org.jboss.jandex.MethodInfo;
+import org.jboss.jandex.MethodParameterInfo;
 import org.jboss.jandex.Type;
 
 class GrpcProcessor {
@@ -157,7 +158,9 @@ class GrpcProcessor {
                     if (isCandidateServiceMethod(method)) {
                         String[] params = method.parameters()
                                 .stream()
-                                .map(type -> type.name().toString())
+                                .map(MethodParameterInfo::type)
+                                .map(Type::name)
+                                .map(DotName::toString)
                                 .toArray(String[]::new);
 
                         ClassInfo classInfo = index
@@ -188,11 +191,11 @@ class GrpcProcessor {
     }
 
     private boolean isCandidateServiceMethod(MethodInfo method) {
-        List<Type> parameters = method.parameters();
+        List<MethodParameterInfo> parameters = method.parameters();
         if (parameters.size() == 1) {
-            return parameters.get(0).name().toString().equals(StreamObserver.class.getName());
+            return parameters.get(0).type().name().toString().equals(StreamObserver.class.getName());
         } else if (parameters.size() == 2) {
-            return parameters.get(1).name().toString().equals(StreamObserver.class.getName());
+            return parameters.get(1).type().name().toString().equals(StreamObserver.class.getName());
         }
         return false;
     }
diff --git a/extensions/opentelemetry/runtime/pom.xml b/extensions/opentelemetry/runtime/pom.xml
index 6e4401f2bc..5de3658802 100644
--- a/extensions/opentelemetry/runtime/pom.xml
+++ b/extensions/opentelemetry/runtime/pom.xml
@@ -39,6 +39,12 @@
         <dependency>
             <groupId>io.quarkus</groupId>
             <artifactId>quarkus-opentelemetry</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.google.code.findbugs</groupId>
+                    <artifactId>jsr305</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>io.grpc</groupId>
diff --git a/integration-tests/kubernetes/pom.xml b/integration-tests/kubernetes/pom.xml
index ebc7a72b68..42d0a59cc1 100644
--- a/integration-tests/kubernetes/pom.xml
+++ b/integration-tests/kubernetes/pom.xml
@@ -71,34 +71,33 @@
 
 
     <profiles>
-<!--        Disabled because of https://github.com/apache/camel-quarkus/issues/4095-->
-<!--        <profile>-->
-<!--            <id>native</id>-->
-<!--            <activation>-->
-<!--                <property>-->
-<!--                    <name>native</name>-->
-<!--                </property>-->
-<!--            </activation>-->
-<!--            <properties>-->
-<!--                <quarkus.package.type>native</quarkus.package.type>-->
-<!--            </properties>-->
-<!--            <build>-->
-<!--                <plugins>-->
-<!--                    <plugin>-->
-<!--                        <groupId>org.apache.maven.plugins</groupId>-->
-<!--                        <artifactId>maven-failsafe-plugin</artifactId>-->
-<!--                        <executions>-->
-<!--                            <execution>-->
-<!--                                <goals>-->
-<!--                                    <goal>integration-test</goal>-->
-<!--                                    <goal>verify</goal>-->
-<!--                                </goals>-->
-<!--                            </execution>-->
-<!--                        </executions>-->
-<!--                    </plugin>-->
-<!--                </plugins>-->
-<!--            </build>-->
-<!--        </profile>-->
+        <profile>
+            <id>native</id>
+            <activation>
+                <property>
+                    <name>native</name>
+                </property>
+            </activation>
+            <properties>
+                <quarkus.package.type>native</quarkus.package.type>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
         <profile>
             <id>virtualDependencies</id>
             <activation>
diff --git a/integration-tests/master-openshift/pom.xml b/integration-tests/master-openshift/pom.xml
index 6c4b36439a..0ba05a8f6c 100644
--- a/integration-tests/master-openshift/pom.xml
+++ b/integration-tests/master-openshift/pom.xml
@@ -145,8 +145,6 @@
                 </plugins>
             </build>
         </profile>
-
-        <!-- TODO: https://github.com/apache/camel-quarkus/issues/4095
         <profile>
             <id>native</id>
             <activation>
@@ -184,7 +182,6 @@
                 </plugins>
             </build>
         </profile>
-        -->
         <profile>
             <id>virtualDependencies</id>
             <activation>
diff --git a/pom.xml b/pom.xml
index fe9e537a71..981435bf03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,7 +58,7 @@
         <quarkiverse-minio.version>2.9.2</quarkiverse-minio.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/minio/quarkus-minio-parent/ -->
         <quarkiverse-mybatis.version>1.0.4</quarkiverse-mybatis.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/mybatis/quarkus-mybatis-parent/ -->
         <quarkiverse-tika.version>1.0.3</quarkiverse-tika.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/tika/quarkus-tika-parent/ -->
-        <quarkus.version>2.13.2.Final</quarkus.version><!-- https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/ -->
+        <quarkus.version>999-SNAPSHOT</quarkus.version><!-- https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/ -->
         <quarkus-hazelcast-client.version>3.0.0</quarkus-hazelcast-client.version><!-- https://repo1.maven.org/maven2/com/hazelcast/quarkus-hazelcast-client-bom/ -->
         <quarkus-qpid-jms.version>0.38.0</quarkus-qpid-jms.version><!-- https://repo1.maven.org/maven2/org/amqphub/quarkus/quarkus-qpid-jms-bom/ -->
 
@@ -94,12 +94,12 @@
         <google-auth-library-credentials.version>1.7.0</google-auth-library-credentials.version><!-- TODO: Revert back to using Camel's version when gRPC versions are in sync -->
         <google-oauth-client.version>${google-oauth-client-version}</google-oauth-client.version><!-- TODO: Fix this in Camel https://github.com/apache/camel-quarkus/issues/4139 -->
         <graalvm.version>22.2.0</graalvm.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.graalvm.sdk:graal-sdk -->
-        <grpc.version>1.49.0</grpc.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:io.grpc:grpc-core -->
+        <grpc.version>1.50.0</grpc.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:io.grpc:grpc-core -->
         <hapi.version>${hapi-version}</hapi.version>
         <hapi-fhir.version>${hapi-fhir-version}</hapi-fhir.version>
         <hbase.version>${hbase-version}</hbase.version>
         <htrace.version>4.2.0-incubating</htrace.version><!-- Mess in hbase transitive deps -->
-        <infinispan.version>13.0.11.Final</infinispan.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.infinispan:infinispan-core -->
+        <infinispan.version>14.0.0.Final</infinispan.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.infinispan:infinispan-core -->
         <influxdb.version>${influx-java-driver-version}</influxdb.version>
         <jackson1.version>1.9.13</jackson1.version><!-- Mess in the transitive dependencies of hbase-testing-util -->
         <jackson-asl.version>${jackson1.version}</jackson-asl.version><!-- Can be different from jackson1.version on some occasions -->
@@ -117,7 +117,7 @@
         <jna-platform.version>5.6.0</jna-platform.version><!-- @sync com.azure:azure-identity:${azure-identity.version} dep:net.java.dev.jna:jna-platform -->
         <jnr-ffi.version>2.1.2</jnr-ffi.version><!-- Mess in web3j transitive deps -->
         <json-smart.version>2.4.7</json-smart.version>
-        <kafka.version>3.2.3</kafka.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.apache.kafka:kafka-clients -->
+        <kafka.version>3.3.1</kafka.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.apache.kafka:kafka-clients -->
         <kudu.version>${kudu-version}</kudu.version>
         <kotlin.version>1.7.20</kotlin.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.jetbrains.kotlin:kotlin-stdlib -->
         <kryo.version>2.24.0</kryo.version><!-- @sync org.apache.flink:flink-core:${flink-version} dep:com.esotericsoftware.kryo:kryo -->
@@ -131,7 +131,7 @@
         <reactor-core.version>3.4.22</reactor-core.version><!-- @sync com.azure:azure-core:${azure-core.version} dep:io.projectreactor:reactor-core -->
         <reactor-netty.version>${reactor-netty-version}</reactor-netty.version>
         <retrofit.version>2.5.0</retrofit.version>
-        <smallrye.reactive.messaging.camel.version>3.20.0</smallrye.reactive.messaging.camel.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:io.smallrye.reactive:smallrye-reactive-messaging-provider -->
+        <smallrye.reactive.messaging.camel.version>3.21.0</smallrye.reactive.messaging.camel.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:io.smallrye.reactive:smallrye-reactive-messaging-provider -->
         <spring.version>${spring5-version}</spring.version>
         <snakeyaml.version>1.33</snakeyaml.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.yaml:snakeyaml -->
         <tablesaw.version>0.43.1</tablesaw.version>
diff --git a/poms/bom/src/main/generated/flattened-full-pom.xml b/poms/bom/src/main/generated/flattened-full-pom.xml
index 8399023b56..153b4f8b84 100644
--- a/poms/bom/src/main/generated/flattened-full-pom.xml
+++ b/poms/bom/src/main/generated/flattened-full-pom.xml
@@ -10040,7 +10040,7 @@
       <dependency>
         <groupId>io.smallrye.reactive</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <artifactId>smallrye-reactive-messaging-camel</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
-        <version>3.20.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <version>3.21.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <exclusions>
           <exclusion>
             <groupId>jakarta.activation</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
@@ -10175,7 +10175,7 @@
       <dependency>
         <groupId>org.apache.kafka</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <artifactId>connect-runtime</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
-        <version>3.2.3</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <version>3.3.1</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <exclusions>
           <exclusion>
             <groupId>jakarta.activation</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
diff --git a/poms/bom/src/main/generated/flattened-reduced-pom.xml b/poms/bom/src/main/generated/flattened-reduced-pom.xml
index 741a8f9b05..022899e90e 100644
--- a/poms/bom/src/main/generated/flattened-reduced-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-pom.xml
@@ -10040,7 +10040,7 @@
       <dependency>
         <groupId>io.smallrye.reactive</groupId>
         <artifactId>smallrye-reactive-messaging-camel</artifactId>
-        <version>3.20.0</version>
+        <version>3.21.0</version>
         <exclusions>
           <exclusion>
             <groupId>jakarta.activation</groupId>
@@ -10170,7 +10170,7 @@
       <dependency>
         <groupId>org.apache.kafka</groupId>
         <artifactId>connect-runtime</artifactId>
-        <version>3.2.3</version>
+        <version>3.3.1</version>
         <exclusions>
           <exclusion>
             <groupId>jakarta.activation</groupId>
diff --git a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
index d51f8d1039..ea0c960577 100644
--- a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
@@ -10040,7 +10040,7 @@
       <dependency>
         <groupId>io.smallrye.reactive</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <artifactId>smallrye-reactive-messaging-camel</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
-        <version>3.20.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <version>3.21.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <exclusions>
           <exclusion>
             <groupId>jakarta.activation</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
@@ -10170,7 +10170,7 @@
       <dependency>
         <groupId>org.apache.kafka</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <artifactId>connect-runtime</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
-        <version>3.2.3</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <version>3.3.1</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <exclusions>
           <exclusion>
             <groupId>jakarta.activation</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->


[camel-quarkus] 03/03: Disable OptaPlanner tests due to #4116

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 5b4e800f14a957a5c9ef1eb852050663e3e79140
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Sep 21 09:40:20 2022 +0100

    Disable OptaPlanner tests due to #4116
---
 integration-tests/optaplanner/pom.xml                  | 18 ++++++++++++++++++
 .../component/optaplanner/it/OptaplannerIT.java        |  2 ++
 .../component/optaplanner/it/OptaplannerTest.java      |  2 ++
 3 files changed, 22 insertions(+)

diff --git a/integration-tests/optaplanner/pom.xml b/integration-tests/optaplanner/pom.xml
index 2719048892..98d629bdcf 100644
--- a/integration-tests/optaplanner/pom.xml
+++ b/integration-tests/optaplanner/pom.xml
@@ -70,7 +70,24 @@
         </dependency>
     </dependencies>
 
+    <!-- TODO: Remove this: https://github.com/apache/camel-quarkus/issues/4116 -->
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>io.quarkus</groupId>
+                <artifactId>quarkus-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>quarkus-maven-plugin-disabled</id>
+                        <phase>none</phase>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
     <profiles>
+        <!-- TODO: https://github.com/apache/camel-quarkus/issues/4116
         <profile>
             <id>native</id>
             <activation>
@@ -98,6 +115,7 @@
                 </plugins>
             </build>
         </profile>
+        -->
         <profile>
             <id>virtualDependencies</id>
             <activation>
diff --git a/integration-tests/optaplanner/src/test/java/org/apache/camel/quarkus/component/optaplanner/it/OptaplannerIT.java b/integration-tests/optaplanner/src/test/java/org/apache/camel/quarkus/component/optaplanner/it/OptaplannerIT.java
index ccb592c74e..ea74452cda 100644
--- a/integration-tests/optaplanner/src/test/java/org/apache/camel/quarkus/component/optaplanner/it/OptaplannerIT.java
+++ b/integration-tests/optaplanner/src/test/java/org/apache/camel/quarkus/component/optaplanner/it/OptaplannerIT.java
@@ -17,7 +17,9 @@
 package org.apache.camel.quarkus.component.optaplanner.it;
 
 import io.quarkus.test.junit.QuarkusIntegrationTest;
+import org.junit.jupiter.api.Disabled;
 
+@Disabled("https://github.com/apache/camel-quarkus/issues/4116")
 @QuarkusIntegrationTest
 class OptaplannerIT extends OptaplannerTest {
 
diff --git a/integration-tests/optaplanner/src/test/java/org/apache/camel/quarkus/component/optaplanner/it/OptaplannerTest.java b/integration-tests/optaplanner/src/test/java/org/apache/camel/quarkus/component/optaplanner/it/OptaplannerTest.java
index 70ca5d0b1d..6e890febf8 100644
--- a/integration-tests/optaplanner/src/test/java/org/apache/camel/quarkus/component/optaplanner/it/OptaplannerTest.java
+++ b/integration-tests/optaplanner/src/test/java/org/apache/camel/quarkus/component/optaplanner/it/OptaplannerTest.java
@@ -21,10 +21,12 @@ import java.util.concurrent.TimeUnit;
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
 import io.restassured.path.json.JsonPath;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 import static org.awaitility.Awaitility.await;
 
+@Disabled("https://github.com/apache/camel-quarkus/issues/4116")
 @QuarkusTest
 class OptaplannerTest {
 


[camel-quarkus] 02/03: Fix handling of quartz autowired scheduler

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit ae8b9a8f6861da782ef2b6633519c5969655aed8
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Thu Sep 29 11:41:37 2022 +0200

    Fix handling of quartz autowired scheduler
    
    Fixes #4076
---
 extensions/quartz/deployment/pom.xml               |   6 ++
 .../quartz/deployment/QuartzProcessor.java         |  14 +++
 .../QuartzNoQuarkusSchedulerAutowiredTest.java     |  45 ++++++++++
 .../quartz/deployment/QuartzNotAutowiredTest.java  |  46 ++++++++++
 .../QuartzQuarkusCustomSchedulerAutowiredTest.java |  59 ++++++++++++
 ...artzQuarkusSchedulerAmbiguousAutowiredTest.java |  54 +++++++++++
 .../QuartzQuarkusSchedulerAutowiredTest.java       |  46 ++++++++++
 .../QuartzQuarkusSchedulerNotAutowiredTest.java    |  46 ++++++++++
 ...lication-configuration-not-autowired.properties |   8 +-
 ...tion-quarkus-scheduler-not-autowired.properties |   7 +-
 ...ation-configuration-quartz-scheduler.properties |   8 +-
 .../component/quartz/CamelQuartzRecorder.java      | 100 +++++++++++++++++++++
 .../src/main/resources/application.properties      |   2 -
 13 files changed, 419 insertions(+), 22 deletions(-)

diff --git a/extensions/quartz/deployment/pom.xml b/extensions/quartz/deployment/pom.xml
index d07381cc88..0925b7fcf2 100644
--- a/extensions/quartz/deployment/pom.xml
+++ b/extensions/quartz/deployment/pom.xml
@@ -48,6 +48,12 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-quartz</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-junit5-internal</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java b/extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
index 2271ea570d..fe02409a4b 100644
--- a/extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
+++ b/extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
@@ -19,6 +19,8 @@ package org.apache.camel.quarkus.component.quartz.deployment;
 import io.quarkus.bootstrap.model.ApplicationModel;
 import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.annotations.ExecutionTime;
+import io.quarkus.deployment.annotations.Record;
 import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
 import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
@@ -26,6 +28,9 @@ import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.NativeImageSystemPropertyBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
 import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem;
+import org.apache.camel.component.quartz.QuartzComponent;
+import org.apache.camel.quarkus.component.quartz.CamelQuartzRecorder;
+import org.apache.camel.quarkus.core.deployment.spi.CamelBeanBuildItem;
 import org.jboss.jandex.DotName;
 import org.jboss.jandex.IndexView;
 import org.quartz.impl.jdbcjobstore.StdJDBCDelegate;
@@ -97,4 +102,13 @@ class QuartzProcessor {
                 "com.mchange.v2.c3p0.management.NullManagementCoordinator");
     }
 
+    @Record(ExecutionTime.STATIC_INIT)
+    @BuildStep
+    CamelBeanBuildItem quartzComponent(CamelQuartzRecorder recorder) {
+        return new CamelBeanBuildItem(
+                "quartz",
+                QuartzComponent.class.getName(),
+                recorder.createQuartzComponent());
+    }
+
 }
diff --git a/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzNoQuarkusSchedulerAutowiredTest.java b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzNoQuarkusSchedulerAutowiredTest.java
new file mode 100644
index 0000000000..d772112331
--- /dev/null
+++ b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzNoQuarkusSchedulerAutowiredTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.quartz.deployment;
+
+import javax.inject.Inject;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.quartz.QuartzComponent;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class QuartzNoQuarkusSchedulerAutowiredTest {
+
+    @RegisterExtension
+    static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
+            .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
+
+    @Inject
+    CamelContext context;
+
+    @Test
+    public void test() throws Exception {
+        QuartzComponent component = context.getComponent("quartz", QuartzComponent.class);
+        assertEquals("DefaultQuartzScheduler-camel-1", component.getScheduler().getSchedulerName());
+    }
+}
diff --git a/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzNotAutowiredTest.java b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzNotAutowiredTest.java
new file mode 100644
index 0000000000..a27f35727c
--- /dev/null
+++ b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzNotAutowiredTest.java
@@ -0,0 +1,46 @@
+/*
+ * 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.quartz.deployment;
+
+import javax.inject.Inject;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.quartz.QuartzComponent;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class QuartzNotAutowiredTest {
+
+    @RegisterExtension
+    static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
+            .withConfigurationResource("application-configuration-not-autowired.properties")
+            .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
+
+    @Inject
+    CamelContext context;
+
+    @Test
+    public void test() throws Exception {
+        QuartzComponent component = context.getComponent("quartz", QuartzComponent.class);
+        assertEquals("DefaultQuartzScheduler-camel-1", component.getScheduler().getSchedulerName());
+    }
+}
diff --git a/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusCustomSchedulerAutowiredTest.java b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusCustomSchedulerAutowiredTest.java
new file mode 100644
index 0000000000..218790aee4
--- /dev/null
+++ b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusCustomSchedulerAutowiredTest.java
@@ -0,0 +1,59 @@
+/*
+ * 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.quartz.deployment;
+
+import java.util.Properties;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.quartz.QuartzComponent;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.quartz.impl.StdSchedulerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class QuartzQuarkusCustomSchedulerAutowiredTest {
+
+    @RegisterExtension
+    static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
+            .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
+
+    @Inject
+    CamelContext context;
+
+    @Test
+    public void test() throws Exception {
+        QuartzComponent component = context.getComponent("quartz", QuartzComponent.class);
+        assertEquals("customScheduler", component.getScheduler().getSchedulerName());
+    }
+
+    @Produces
+    public Scheduler produceScheduler() throws SchedulerException {
+        Properties prop = new Properties();
+        prop.setProperty("org.quartz.scheduler.instanceName", "customScheduler");
+        prop.setProperty("org.quartz.threadPool.threadCount", "2");
+        return new StdSchedulerFactory(prop).getScheduler();
+    }
+}
diff --git a/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerAmbiguousAutowiredTest.java b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerAmbiguousAutowiredTest.java
new file mode 100644
index 0000000000..a6771425ba
--- /dev/null
+++ b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerAmbiguousAutowiredTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.quartz.deployment;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.quartz.QuartzComponent;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.quartz.impl.StdSchedulerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+public class QuartzQuarkusSchedulerAmbiguousAutowiredTest {
+
+    @RegisterExtension
+    static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
+            .withConfigurationResource("application-configuration-quartz-scheduler.properties")
+            .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
+
+    @Inject
+    CamelContext context;
+
+    @Test
+    public void test() {
+        assertThrows(RuntimeException.class, () -> context.getComponent("quartz", QuartzComponent.class));
+    }
+
+    @Produces
+    public Scheduler produceScheduler() throws SchedulerException {
+        return new StdSchedulerFactory().getScheduler();
+    }
+}
diff --git a/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerAutowiredTest.java b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerAutowiredTest.java
new file mode 100644
index 0000000000..82584425cf
--- /dev/null
+++ b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerAutowiredTest.java
@@ -0,0 +1,46 @@
+/*
+ * 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.quartz.deployment;
+
+import javax.inject.Inject;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.quartz.QuartzComponent;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class QuartzQuarkusSchedulerAutowiredTest {
+
+    @RegisterExtension
+    static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
+            .withConfigurationResource("application-configuration-quartz-scheduler.properties")
+            .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
+
+    @Inject
+    CamelContext context;
+
+    @Test
+    public void test() throws Exception {
+        QuartzComponent component = context.getComponent("quartz", QuartzComponent.class);
+        assertEquals("QuarkusQuartzScheduler", component.getScheduler().getSchedulerName());
+    }
+}
diff --git a/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerNotAutowiredTest.java b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerNotAutowiredTest.java
new file mode 100644
index 0000000000..d402b91a6f
--- /dev/null
+++ b/extensions/quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerNotAutowiredTest.java
@@ -0,0 +1,46 @@
+/*
+ * 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.quartz.deployment;
+
+import javax.inject.Inject;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.quartz.QuartzComponent;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class QuartzQuarkusSchedulerNotAutowiredTest {
+
+    @RegisterExtension
+    static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
+            .withConfigurationResource("application-configuration-quarkus-scheduler-not-autowired.properties")
+            .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
+
+    @Inject
+    CamelContext context;
+
+    @Test
+    public void test() throws Exception {
+        QuartzComponent component = context.getComponent("quartz", QuartzComponent.class);
+        assertEquals("DefaultQuartzScheduler-camel-1", component.getScheduler().getSchedulerName());
+    }
+}
diff --git a/integration-tests/quartz/src/main/resources/application.properties b/extensions/quartz/deployment/src/test/resources/application-configuration-not-autowired.properties
similarity index 78%
copy from integration-tests/quartz/src/main/resources/application.properties
copy to extensions/quartz/deployment/src/test/resources/application-configuration-not-autowired.properties
index 5f4f4eae05..54cddcf948 100644
--- a/integration-tests/quartz/src/main/resources/application.properties
+++ b/extensions/quartz/deployment/src/test/resources/application-configuration-not-autowired.properties
@@ -14,10 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-
-camel.component.quartzFromProperties.propertiesFile = quartz.properties
-
-quarkus.native.resources.includes = quartz.properties
-
-#quick workaround caused by https://issues.apache.org/jira/browse/CAMEL-18143
-camel.component.quartz.autowired-enabled = false
+camel.component.quartz.autowired-enabled = false
\ No newline at end of file
diff --git a/integration-tests/quartz/src/main/resources/application.properties b/extensions/quartz/deployment/src/test/resources/application-configuration-quarkus-scheduler-not-autowired.properties
similarity index 82%
copy from integration-tests/quartz/src/main/resources/application.properties
copy to extensions/quartz/deployment/src/test/resources/application-configuration-quarkus-scheduler-not-autowired.properties
index 5f4f4eae05..f581e04595 100644
--- a/integration-tests/quartz/src/main/resources/application.properties
+++ b/extensions/quartz/deployment/src/test/resources/application-configuration-quarkus-scheduler-not-autowired.properties
@@ -14,10 +14,5 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-
-camel.component.quartzFromProperties.propertiesFile = quartz.properties
-
-quarkus.native.resources.includes = quartz.properties
-
-#quick workaround caused by https://issues.apache.org/jira/browse/CAMEL-18143
 camel.component.quartz.autowired-enabled = false
+quarkus.quartz.start-mode=forced
\ No newline at end of file
diff --git a/integration-tests/quartz/src/main/resources/application.properties b/extensions/quartz/deployment/src/test/resources/application-configuration-quartz-scheduler.properties
similarity index 78%
copy from integration-tests/quartz/src/main/resources/application.properties
copy to extensions/quartz/deployment/src/test/resources/application-configuration-quartz-scheduler.properties
index 5f4f4eae05..2473026451 100644
--- a/integration-tests/quartz/src/main/resources/application.properties
+++ b/extensions/quartz/deployment/src/test/resources/application-configuration-quartz-scheduler.properties
@@ -14,10 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-
-camel.component.quartzFromProperties.propertiesFile = quartz.properties
-
-quarkus.native.resources.includes = quartz.properties
-
-#quick workaround caused by https://issues.apache.org/jira/browse/CAMEL-18143
-camel.component.quartz.autowired-enabled = false
+quarkus.quartz.start-mode=forced
\ No newline at end of file
diff --git a/extensions/quartz/runtime/src/main/java/org/apache/camel/quarkus/component/quartz/CamelQuartzRecorder.java b/extensions/quartz/runtime/src/main/java/org/apache/camel/quarkus/component/quartz/CamelQuartzRecorder.java
new file mode 100644
index 0000000000..19920e9027
--- /dev/null
+++ b/extensions/quartz/runtime/src/main/java/org/apache/camel/quarkus/component/quartz/CamelQuartzRecorder.java
@@ -0,0 +1,100 @@
+/*
+ * 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.quartz;
+
+import java.util.LinkedList;
+import java.util.stream.Collectors;
+
+import javax.enterprise.inject.AmbiguousResolutionException;
+
+import io.quarkus.arc.Arc;
+import io.quarkus.arc.InjectableInstance;
+import io.quarkus.arc.InstanceHandle;
+import io.quarkus.quartz.QuartzScheduler;
+import io.quarkus.quartz.runtime.QuartzSchedulerImpl;
+import io.quarkus.runtime.RuntimeValue;
+import io.quarkus.runtime.annotations.Recorder;
+import org.apache.camel.component.quartz.QuartzComponent;
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Recorder
+public class CamelQuartzRecorder {
+
+    public RuntimeValue<QuartzComponent> createQuartzComponent() {
+        return new RuntimeValue<>(new QuarkusQuartzComponent());
+    }
+
+    @org.apache.camel.spi.annotations.Component("quartz")
+    static class QuarkusQuartzComponent extends QuartzComponent {
+        private static final Logger LOG = LoggerFactory.getLogger(QuarkusQuartzComponent.class);
+
+        @Override
+        public boolean isAutowiredEnabled() {
+            //autowiring is executed via custom code in doStart method
+            return false;
+        }
+
+        @Override
+        protected void doStartScheduler() throws Exception {
+            //autowire scheduler before the start
+
+            //if autowiring is enabled, execute it here, because special approach because of Quarkus has to be applied
+            if (super.isAutowiredEnabled() && getCamelContext().isAutowiredEnabled()) {
+                InjectableInstance<Scheduler> schedulers = Arc.container().select(Scheduler.class);
+
+                LinkedList<Scheduler> foundSchedulers = new LinkedList<>();
+
+                for (InstanceHandle<Scheduler> handle : schedulers.handles()) {
+                    //Scheduler may be null in several cases, which would cause an exception in traditional autowiring
+                    //see https://github.com/quarkusio/quarkus/issues/27929 for more details
+                    if (handle.getBean().getBeanClass().equals(QuartzSchedulerImpl.class)) {
+                        Scheduler scheduler = Arc.container().select(QuartzScheduler.class).getHandle().get().getScheduler();
+                        if (scheduler != null) {
+                            //scheduler is added only if is not null
+                            foundSchedulers.add(scheduler);
+                        }
+                        continue;
+                    }
+                    foundSchedulers.add(handle.get());
+                }
+
+                if (foundSchedulers.size() > 1) {
+                    throw new AmbiguousResolutionException(String.format("Found %d org.quartz.Scheduler beans (%s).",
+                            foundSchedulers.size(), foundSchedulers.stream().map(s -> {
+                                try {
+                                    return s.getSchedulerName();
+                                } catch (SchedulerException e) {
+                                    return "Scheduler name retrieval failed.";
+                                }
+                            }).collect(Collectors.joining(", "))));
+                } else if (!foundSchedulers.isEmpty()) {
+                    if (LOG.isInfoEnabled()) {
+                        LOG.info(
+                                "Autowired property: scheduler on component: quartz as exactly one instance of type: {} found in the registry",
+                                Scheduler.class.getName());
+                    }
+                    setScheduler(foundSchedulers.getFirst());
+                }
+            }
+
+            super.doStartScheduler();
+        }
+    }
+}
diff --git a/integration-tests/quartz/src/main/resources/application.properties b/integration-tests/quartz/src/main/resources/application.properties
index 5f4f4eae05..dfc162983b 100644
--- a/integration-tests/quartz/src/main/resources/application.properties
+++ b/integration-tests/quartz/src/main/resources/application.properties
@@ -19,5 +19,3 @@ camel.component.quartzFromProperties.propertiesFile = quartz.properties
 
 quarkus.native.resources.includes = quartz.properties
 
-#quick workaround caused by https://issues.apache.org/jira/browse/CAMEL-18143
-camel.component.quartz.autowired-enabled = false