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/27 12:36:09 UTC

[camel-quarkus] branch main updated (6afadaba4c -> 37dbb06cc4)

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

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


    from 6afadaba4c Updated CHANGELOG.md
     new 9240f55c1d Upgrade Quarkus to 2.14.0.CR1
     new 72b730c207 Fix handling of quartz autowired scheduler
     new 37dbb06cc4 Disable failing tests that manually run quarkus-run.jar due to #4218

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:
 docs/antora.yml                                    |   2 +-
 .../quarkus/core/deployment/ConsumeProcessor.java  |   2 +-
 .../core/deployment/InjectionPointsProcessor.java  |   2 +-
 .../component/grpc/deployment/GrpcProcessor.java   |  11 ++-
 extensions/opentelemetry/deployment/pom.xml        |   6 ++
 extensions/opentelemetry/runtime/pom.xml           |   6 ++
 extensions/quartz/deployment/pom.xml               |   6 ++
 .../quartz/deployment/QuartzProcessor.java         |  14 +++
 .../QuartzNoQuarkusSchedulerAutowiredTest.java}    |  14 ++-
 .../quartz/deployment/QuartzNotAutowiredTest.java} |  15 ++--
 ...QuartzQuarkusCustomSchedulerAutowiredTest.java} |  29 +++---
 ...rtzQuarkusSchedulerAmbiguousAutowiredTest.java} |  27 +++---
 .../QuartzQuarkusSchedulerAutowiredTest.java}      |  17 ++--
 .../QuartzQuarkusSchedulerNotAutowiredTest.java}   |  15 ++--
 ...lication-configuration-not-autowired.properties |   4 +-
 ...tion-quarkus-scheduler-not-autowired.properties |   3 +-
 ...ation-configuration-quartz-scheduler.properties |   2 +-
 .../component/quartz/CamelQuartzRecorder.java      | 100 +++++++++++++++++++++
 integration-tests/kubernetes/pom.xml               |  55 ++++++------
 .../camel/quarkus/main/cmd/it/CommandModeTest.java |   2 +
 .../args/fail/MainUnknownArgumentFailTest.java     |   2 +
 .../args/ignore/MainUnknownArgumentIgnoreTest.java |   2 +
 integration-tests/master-openshift/pom.xml         |   3 -
 .../src/main/resources/application.properties      |   2 -
 pom.xml                                            |  10 +--
 poms/bom/src/main/generated/flattened-full-pom.xml |   2 +-
 .../src/main/generated/flattened-reduced-pom.xml   |   2 +-
 .../generated/flattened-reduced-verbose-pom.xml    |   2 +-
 28 files changed, 247 insertions(+), 110 deletions(-)
 copy extensions/{opentracing/deployment/src/test/java/org/apache/camel/quarkus/component/opentracing/deployment/OpenTracingEnabledTest.java => quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzNoQuarkusSchedulerAutowiredTest.java} (77%)
 copy extensions/{opentracing/deployment/src/test/java/org/apache/camel/quarkus/component/opentracing/deployment/OpenTracingEnabledTest.java => quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzNotAutowiredTest.java} (74%)
 copy extensions/{opentelemetry/deployment/src/test/java/org/apache/camel/quarkus/component/opentelemetry/deployment/OpenTelemetryEnabledTest.java => quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusCustomSchedulerAutowiredTest.java} (60%)
 copy extensions/{kafka/deployment/src/test/java/org/apache/camel/quarkus/component/kafka/deployment/KafkaDevServicesDisabledTest.java => quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerAmbiguousAutowiredTest.java} (66%)
 copy extensions/{kafka/deployment/src/test/java/org/apache/camel/quarkus/component/kafka/deployment/KafkaDevServicesDisabledTest.java => quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerAutowiredTest.java} (71%)
 copy extensions/{opentracing/deployment/src/test/java/org/apache/camel/quarkus/component/opentracing/deployment/OpenTracingEnabledTest.java => quartz/deployment/src/test/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzQuarkusSchedulerNotAutowiredTest.java} (72%)
 copy integration-test-groups/foundation/bean/src/main/resources/application.properties => extensions/quartz/deployment/src/test/resources/application-configuration-not-autowired.properties (95%)
 copy integration-tests/file/src/main/resources/application.properties => extensions/quartz/deployment/src/test/resources/application-configuration-quarkus-scheduler-not-autowired.properties (92%)
 copy integration-test-groups/foundation/timer/src/main/resources/application.properties => extensions/quartz/deployment/src/test/resources/application-configuration-quartz-scheduler.properties (96%)
 create mode 100644 extensions/quartz/runtime/src/main/java/org/apache/camel/quarkus/component/quartz/CamelQuartzRecorder.java


[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 main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 9240f55c1d8921583d35a39ec80397380cb62370
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/deployment/pom.xml        |  6 +++
 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 |  2 +-
 .../src/main/generated/flattened-reduced-pom.xml   |  2 +-
 .../generated/flattened-reduced-verbose-pom.xml    |  2 +-
 12 files changed, 57 insertions(+), 46 deletions(-)

diff --git a/docs/antora.yml b/docs/antora.yml
index 32159412e3..67b29c866e 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: 2.14.0.CR1 # 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/deployment/pom.xml b/extensions/opentelemetry/deployment/pom.xml
index 36f4223651..6781c5e02e 100644
--- a/extensions/opentelemetry/deployment/pom.xml
+++ b/extensions/opentelemetry/deployment/pom.xml
@@ -33,6 +33,12 @@
         <dependency>
             <groupId>io.quarkus</groupId>
             <artifactId>quarkus-opentelemetry-deployment</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.google.code.findbugs</groupId>
+                    <artifactId>jsr305</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
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 df9e6e58ab..0c8372f6ff 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.3.Final</quarkus.version><!-- https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/ -->
+        <quarkus.version>2.14.0.CR1</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/ -->
 
@@ -78,7 +78,7 @@
         <azure-core-http-vertx.version>1.0.0-beta.1</azure-core-http-vertx.version> <!-- TODO: https://github.com/apache/camel-quarkus/issues/4181 -->
         <cassandra-driver-test.version>3.7.1</cassandra-driver-test.version><!-- Keep in sync with testcontainers instead of Debezium bom -->
         <bouncycastle.version>1.70</bouncycastle.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.bouncycastle:bcprov-jdk15on -->
-        <caffeine.version>2.9.3</caffeine.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:com.github.ben-manes.caffeine:caffeine -->
+        <caffeine.version>3.1.1</caffeine.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:com.github.ben-manes.caffeine:caffeine -->
         <commons-beanutils.version>${commons-beanutils-version}</commons-beanutils.version>
         <commons-cli.version>1.4</commons-cli.version><!-- keep in sync with Quarkus, via quarkus-bootstrap-core -->
         <commons-collections.version>3.2.2</commons-collections.version><!-- used by hbase, should be pretty stable as commons-collections are not developed actively anymore -->
@@ -95,12 +95,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.2</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.1.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 -->
@@ -119,7 +119,7 @@
         <jnr-ffi.version>2.1.2</jnr-ffi.version><!-- Mess in web3j transitive deps -->
         <json-path.version>${json-path-version}</json-path.version>
         <json-smart.version>2.4.7</json-smart.version><!-- @sync com.jayway.jsonpath:json-path:${json-path.version} dep:net.minidev:json-smart -->
-        <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 -->
diff --git a/poms/bom/src/main/generated/flattened-full-pom.xml b/poms/bom/src/main/generated/flattened-full-pom.xml
index 748116d65e..f110c19233 100644
--- a/poms/bom/src/main/generated/flattened-full-pom.xml
+++ b/poms/bom/src/main/generated/flattened-full-pom.xml
@@ -10185,7 +10185,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 f8da06c25a..a1925dc0f9 100644
--- a/poms/bom/src/main/generated/flattened-reduced-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-pom.xml
@@ -10180,7 +10180,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 b3ee254696..2e6e4c4514 100644
--- a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
@@ -10180,7 +10180,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 failing tests that manually run quarkus-run.jar due to #4218

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

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

commit 37dbb06cc40a9fa41a86b1c0d1e28156ffa9d55c
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Oct 27 09:56:56 2022 +0100

    Disable failing tests that manually run quarkus-run.jar due to #4218
---
 .../test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java | 2 ++
 .../quarkus/main/unknown/args/fail/MainUnknownArgumentFailTest.java     | 2 ++
 .../quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreTest.java | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java b/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
index f723e4cf2a..0d7b9e2ecf 100644
--- a/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
+++ b/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
@@ -24,6 +24,7 @@ import java.util.concurrent.TimeoutException;
 import org.apache.camel.quarkus.test.support.process.QuarkusProcessExecutor;
 import org.apache.camel.util.StringHelper;
 import org.assertj.core.api.Assertions;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.zeroturnaround.exec.InvalidExitValueException;
 import org.zeroturnaround.exec.ProcessResult;
@@ -31,6 +32,7 @@ import org.zeroturnaround.exec.StartedProcess;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+@Disabled("https://github.com/apache/camel-quarkus/issues/4218")
 public class CommandModeTest {
 
     @Test
diff --git a/integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailTest.java b/integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailTest.java
index e113e0716e..6298b84050 100644
--- a/integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailTest.java
+++ b/integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailTest.java
@@ -21,12 +21,14 @@ import java.util.concurrent.TimeoutException;
 
 import io.quarkus.test.junit.QuarkusTest;
 import org.apache.camel.quarkus.test.support.process.QuarkusProcessExecutor;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.zeroturnaround.exec.ProcessResult;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
 @QuarkusTest
+@Disabled("https://github.com/apache/camel-quarkus/issues/4218")
 public class MainUnknownArgumentFailTest {
 
     @Test
diff --git a/integration-tests/main-unknown-args-ignore/src/test/java/org/apache/camel/quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreTest.java b/integration-tests/main-unknown-args-ignore/src/test/java/org/apache/camel/quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreTest.java
index b205bce7e9..3db467f8ce 100644
--- a/integration-tests/main-unknown-args-ignore/src/test/java/org/apache/camel/quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreTest.java
+++ b/integration-tests/main-unknown-args-ignore/src/test/java/org/apache/camel/quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreTest.java
@@ -21,12 +21,14 @@ import java.util.concurrent.TimeoutException;
 
 import io.quarkus.test.junit.QuarkusTest;
 import org.apache.camel.quarkus.test.support.process.QuarkusProcessExecutor;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.zeroturnaround.exec.ProcessResult;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
 @QuarkusTest
+@Disabled("https://github.com/apache/camel-quarkus/issues/4218")
 public class MainUnknownArgumentIgnoreTest {
 
     @Test


[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 main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 72b730c2078960da43030af3df39742e9e75c856
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