You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/03/10 10:04:33 UTC
[GitHub] [camel-quarkus] JiriOndrusek opened a new pull request #3609: 3579 Improve quartz test coverage
JiriOndrusek opened a new pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609
fixes https://github.com/apache/camel-quarkus/issues/3579
replaces https://github.com/apache/camel-quarkus/pull/3602
I used `ConnectionProvider` to avoid configuration of the datasource in `quartz.properties` (thanks @jamesnetherton for suggestion)
Go through `usage.adoc` and `limitations.adoc` to see changes introduced for the users.
This PR fixes all the unfinished (or limited) features from https://github.com/apache/camel-quarkus/pull/3602
I had to keep postgresql with fixed port number, because port number has to be used in quartz.properties for one kind of configuration.
Follow-up work:
1. This implementation requires c3p0 (which is not needed when quarku's quartz is used). Without this ependency, I'm getting `Discovered unresolved type during parsing: com.mchange.v2.c3p0.C3P0ProxyConnection`. I'll create a ticket to investigate a possible removal of c3p0. (c3p0 is called from `JobStoreSupport.storeTrigger`)
2. There is a substitution of `LoadingLoaderClassLoadHelper.loadClass` which is eeded for the native support. I'll create a ticket for quartz project and reminder ticket to remove the substitution once it is resolved on Quartz.
There is no need to add a paragraph into migration guide. All that worked before works in the same way. The new introduced configuration (using `quarz.properties` + agroal DS) did not work before. Camel standard behavior is only fixed here.
Do we need to mention a new featre of an old extension somewhere? (like changelog)
<!-- Uncomment and fill this section if your PR is not trivial
[ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
[ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
[ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
[ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
[ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
[ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824645780
##########
File path: extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
##########
@@ -44,4 +61,43 @@ NativeImageResourceBuildItem nativeImageResources() {
ReflectiveClassBuildItem registerForReflection() {
return new ReflectiveClassBuildItem(false, false, QUARTZ_JOB_CLASSES);
}
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflectionWithMethods() {
+ return new ReflectiveClassBuildItem(true, false, QUARTZ_JOB_CLASSES_WITH_METHODS);
+ }
+
+ @BuildStep
+ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+ CombinedIndexBuildItem combinedIndex, CurateOutcomeBuildItem curateOutcome) {
+ IndexView index = combinedIndex.getIndex();
+
+ ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+ boolean oracleBlobIsPresent = applicationModel.getDependencies().stream()
+ .anyMatch(d -> d.getGroupId().equals("com.oracle.database.jdbc"));
+
+ final String[] delegatesImpl = index
+ .getAllKnownSubclasses(SQL_JDBC_DELEGATE)
+ .stream()
+ .map(c -> c.name().toString())
+ .filter(n -> oracleBlobIsPresent || !n.contains("oracle"))
+ .toArray(String[]::new);
+
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(false, true, delegatesImpl));
+
+ }
+
+ @BuildStep
+ void indexSaxonHe(BuildProducer<IndexDependencyBuildItem> deps) {
+ deps.produce(new IndexDependencyBuildItem("org.quartz-scheduler", "quartz"));
+ deps.produce(new IndexDependencyBuildItem("org.apache.camel.quarkus", "camel-quarkus-quartz"));
Review comment:
Registration not via Annotation but bia BuildItem works, I'll fix it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#issuecomment-1064954375
@jamesnetherton I fixed several "issues" with the PR but one can not be fixed (see comment about indexing ourse;ves) and another had to be fixed with more changes (see the comment about taking version of c3p0 from the camel)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek edited a comment on pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek edited a comment on pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#issuecomment-1064954375
@jamesnetherton I fixed several "issues" with the PR but one can not be fixed (see comment about indexing ourselves) and another one had to be fixed with more changes (see the comment about taking version of c3p0 from the camel)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton commented on pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#issuecomment-1072102785
I manually merged this to `camel-main`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824553810
##########
File path: extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
##########
@@ -44,4 +61,43 @@ NativeImageResourceBuildItem nativeImageResources() {
ReflectiveClassBuildItem registerForReflection() {
return new ReflectiveClassBuildItem(false, false, QUARTZ_JOB_CLASSES);
}
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflectionWithMethods() {
+ return new ReflectiveClassBuildItem(true, false, QUARTZ_JOB_CLASSES_WITH_METHODS);
+ }
+
+ @BuildStep
+ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+ CombinedIndexBuildItem combinedIndex, CurateOutcomeBuildItem curateOutcome) {
+ IndexView index = combinedIndex.getIndex();
+
+ ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+ boolean oracleBlobIsPresent = applicationModel.getDependencies().stream()
+ .anyMatch(d -> d.getGroupId().equals("com.oracle.database.jdbc"));
+
+ final String[] delegatesImpl = index
+ .getAllKnownSubclasses(SQL_JDBC_DELEGATE)
+ .stream()
+ .map(c -> c.name().toString())
+ .filter(n -> oracleBlobIsPresent || !n.contains("oracle"))
+ .toArray(String[]::new);
+
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(false, true, delegatesImpl));
+
+ }
+
+ @BuildStep
+ void indexSaxonHe(BuildProducer<IndexDependencyBuildItem> deps) {
+ deps.produce(new IndexDependencyBuildItem("org.quartz-scheduler", "quartz"));
+ deps.produce(new IndexDependencyBuildItem("org.apache.camel.quarkus", "camel-quarkus-quartz"));
Review comment:
I'm not sure, why it is behave that way, but:
- If index to ourself is removed, registration for reflection (by annotation) does not work, and I'm getting
```
Caused by: java.lang.ClassNotFoundException: org.apache.camel.quarkus.component.quartz.CamelQuarkusQuartzConnectionProvider`
```
- Therefore I kept index of ourselves
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#issuecomment-1072103551
@jamesnetherton thanks a lot, I forgot to rebase this PR. I'm sorry.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton commented on a change in pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824444482
##########
File path: extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
##########
@@ -44,4 +61,43 @@ NativeImageResourceBuildItem nativeImageResources() {
ReflectiveClassBuildItem registerForReflection() {
return new ReflectiveClassBuildItem(false, false, QUARTZ_JOB_CLASSES);
}
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflectionWithMethods() {
+ return new ReflectiveClassBuildItem(true, false, QUARTZ_JOB_CLASSES_WITH_METHODS);
+ }
+
+ @BuildStep
+ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+ CombinedIndexBuildItem combinedIndex, CurateOutcomeBuildItem curateOutcome) {
+ IndexView index = combinedIndex.getIndex();
+
+ ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+ boolean oracleBlobIsPresent = applicationModel.getDependencies().stream()
+ .anyMatch(d -> d.getGroupId().equals("com.oracle.database.jdbc"));
+
+ final String[] delegatesImpl = index
+ .getAllKnownSubclasses(SQL_JDBC_DELEGATE)
+ .stream()
+ .map(c -> c.name().toString())
+ .filter(n -> oracleBlobIsPresent || !n.contains("oracle"))
+ .toArray(String[]::new);
+
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(false, true, delegatesImpl));
+
+ }
+
+ @BuildStep
+ void indexSaxonHe(BuildProducer<IndexDependencyBuildItem> deps) {
+ deps.produce(new IndexDependencyBuildItem("org.quartz-scheduler", "quartz"));
+ deps.produce(new IndexDependencyBuildItem("org.apache.camel.quarkus", "camel-quarkus-quartz"));
Review comment:
Do we really need to index `camel-quarkus-quartz`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#issuecomment-1072103551
@jamesnetherton thanks a lot, I forgot to rebase this PR. I'm sorry.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#issuecomment-1064847870
@jamesnetherton Thanks for the comments, I agree with all of them and I'll fix them shortly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824556195
##########
File path: pom.xml
##########
@@ -72,6 +72,7 @@
<azure-core.version>1.21.0</azure-core.version><!-- @sync com.azure:azure-sdk-bom:${azure-sdk-bom.version} dep:com.azure:azure-core -->
<azure-core-test.version>1.7.3</azure-core-test.version>
<bouncycastle.version>1.70</bouncycastle.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.bouncycastle:bcprov-jdk15on -->
+ <c3p0.version>0.9.5.4</c3p0.version>
Review comment:
I used version from the camel, but it is a little bit higher, then it is used in quarkus. So I excluded mchange-commons from the io,quarkus (and kept slightly higfher version from camel)
The problems without exclusions were:
```
+-org.apache.camel.quarkus:camel-quarkus-quartz-deployment:2.8.0-SNAPSHOT
+-io.quarkus:quarkus-quartz-deployment:2.7.3.Final
+-io.quarkus:quarkus-quartz:2.7.3.Final
+-org.quartz-scheduler:quartz:2.3.2
+-com.mchange:mchange-commons-java:0.2.15
and
+-org.apache.camel.quarkus:camel-quarkus-quartz-deployment:2.8.0-SNAPSHOT
+-org.apache.camel.quarkus:camel-quarkus-quartz:2.8.0-SNAPSHOT
+-com.mchange:c3p0:0.9.5.5
+-com.mchange:mchange-commons-java:0.2.19
```
```
Dependency convergence error for com.mchange:mchange-commons-java:0.2.15 paths to dependency are:
+-org.apache.camel.quarkus:camel-quarkus-quartz:2.8.0-SNAPSHOT
+-io.quarkus:quarkus-quartz:2.7.3.Final
+-org.quartz-scheduler:quartz:2.3.2
+-com.mchange:mchange-commons-java:0.2.15
and
+-org.apache.camel.quarkus:camel-quarkus-quartz:2.8.0-SNAPSHOT
+-com.mchange:c3p0:0.9.5.5
+-com.mchange:mchange-commons-java:0.2.19
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton commented on a change in pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824578617
##########
File path: extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
##########
@@ -44,4 +61,43 @@ NativeImageResourceBuildItem nativeImageResources() {
ReflectiveClassBuildItem registerForReflection() {
return new ReflectiveClassBuildItem(false, false, QUARTZ_JOB_CLASSES);
}
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflectionWithMethods() {
+ return new ReflectiveClassBuildItem(true, false, QUARTZ_JOB_CLASSES_WITH_METHODS);
+ }
+
+ @BuildStep
+ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+ CombinedIndexBuildItem combinedIndex, CurateOutcomeBuildItem curateOutcome) {
+ IndexView index = combinedIndex.getIndex();
+
+ ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+ boolean oracleBlobIsPresent = applicationModel.getDependencies().stream()
+ .anyMatch(d -> d.getGroupId().equals("com.oracle.database.jdbc"));
+
+ final String[] delegatesImpl = index
+ .getAllKnownSubclasses(SQL_JDBC_DELEGATE)
+ .stream()
+ .map(c -> c.name().toString())
+ .filter(n -> oracleBlobIsPresent || !n.contains("oracle"))
+ .toArray(String[]::new);
+
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(false, true, delegatesImpl));
+
+ }
+
+ @BuildStep
+ void indexSaxonHe(BuildProducer<IndexDependencyBuildItem> deps) {
+ deps.produce(new IndexDependencyBuildItem("org.quartz-scheduler", "quartz"));
+ deps.produce(new IndexDependencyBuildItem("org.apache.camel.quarkus", "camel-quarkus-quartz"));
Review comment:
> registration for reflection (by annotation) does not work
We should register it for reflection in the extension. No need to force that on to users.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton commented on pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#issuecomment-1066504798
@JiriOndrusek lets change the branch to `camel-main` and that should hopefully fix up the test failures.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824553810
##########
File path: extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
##########
@@ -44,4 +61,43 @@ NativeImageResourceBuildItem nativeImageResources() {
ReflectiveClassBuildItem registerForReflection() {
return new ReflectiveClassBuildItem(false, false, QUARTZ_JOB_CLASSES);
}
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflectionWithMethods() {
+ return new ReflectiveClassBuildItem(true, false, QUARTZ_JOB_CLASSES_WITH_METHODS);
+ }
+
+ @BuildStep
+ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+ CombinedIndexBuildItem combinedIndex, CurateOutcomeBuildItem curateOutcome) {
+ IndexView index = combinedIndex.getIndex();
+
+ ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+ boolean oracleBlobIsPresent = applicationModel.getDependencies().stream()
+ .anyMatch(d -> d.getGroupId().equals("com.oracle.database.jdbc"));
+
+ final String[] delegatesImpl = index
+ .getAllKnownSubclasses(SQL_JDBC_DELEGATE)
+ .stream()
+ .map(c -> c.name().toString())
+ .filter(n -> oracleBlobIsPresent || !n.contains("oracle"))
+ .toArray(String[]::new);
+
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(false, true, delegatesImpl));
+
+ }
+
+ @BuildStep
+ void indexSaxonHe(BuildProducer<IndexDependencyBuildItem> deps) {
+ deps.produce(new IndexDependencyBuildItem("org.quartz-scheduler", "quartz"));
+ deps.produce(new IndexDependencyBuildItem("org.apache.camel.quarkus", "camel-quarkus-quartz"));
Review comment:
I'm not sure, why it is behave that way, but:
- If index to itself is removed, registration for reflection (by annotation) does not work, and I'm getting `Caused by: java.lang.ClassNotFoundException: org.apache.camel.quarkus.component.quartz.CamelQuarkusQuartzConnectionProvider`
Therefore I kept index of ourselves
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824640556
##########
File path: extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
##########
@@ -44,4 +61,43 @@ NativeImageResourceBuildItem nativeImageResources() {
ReflectiveClassBuildItem registerForReflection() {
return new ReflectiveClassBuildItem(false, false, QUARTZ_JOB_CLASSES);
}
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflectionWithMethods() {
+ return new ReflectiveClassBuildItem(true, false, QUARTZ_JOB_CLASSES_WITH_METHODS);
+ }
+
+ @BuildStep
+ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+ CombinedIndexBuildItem combinedIndex, CurateOutcomeBuildItem curateOutcome) {
+ IndexView index = combinedIndex.getIndex();
+
+ ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+ boolean oracleBlobIsPresent = applicationModel.getDependencies().stream()
+ .anyMatch(d -> d.getGroupId().equals("com.oracle.database.jdbc"));
+
+ final String[] delegatesImpl = index
+ .getAllKnownSubclasses(SQL_JDBC_DELEGATE)
+ .stream()
+ .map(c -> c.name().toString())
+ .filter(n -> oracleBlobIsPresent || !n.contains("oracle"))
+ .toArray(String[]::new);
+
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(false, true, delegatesImpl));
+
+ }
+
+ @BuildStep
+ void indexSaxonHe(BuildProducer<IndexDependencyBuildItem> deps) {
+ deps.produce(new IndexDependencyBuildItem("org.quartz-scheduler", "quartz"));
+ deps.produce(new IndexDependencyBuildItem("org.apache.camel.quarkus", "camel-quarkus-quartz"));
Review comment:
That is the fact where I'm not sure why it is wrong. I put `@RegisterForReflection` on `org.apache.camel.quarkus.component.quartz.CamelQuarkusQuartzConnectionProvider` in extensions/quartz/runtime module. I thought, that classes from the extensions are registered automatically. But it works only in case, that index contains own extension dependency. There is no need from the user to register it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824642007
##########
File path: extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
##########
@@ -44,4 +61,43 @@ NativeImageResourceBuildItem nativeImageResources() {
ReflectiveClassBuildItem registerForReflection() {
return new ReflectiveClassBuildItem(false, false, QUARTZ_JOB_CLASSES);
}
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflectionWithMethods() {
+ return new ReflectiveClassBuildItem(true, false, QUARTZ_JOB_CLASSES_WITH_METHODS);
+ }
+
+ @BuildStep
+ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+ CombinedIndexBuildItem combinedIndex, CurateOutcomeBuildItem curateOutcome) {
+ IndexView index = combinedIndex.getIndex();
+
+ ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+ boolean oracleBlobIsPresent = applicationModel.getDependencies().stream()
+ .anyMatch(d -> d.getGroupId().equals("com.oracle.database.jdbc"));
+
+ final String[] delegatesImpl = index
+ .getAllKnownSubclasses(SQL_JDBC_DELEGATE)
+ .stream()
+ .map(c -> c.name().toString())
+ .filter(n -> oracleBlobIsPresent || !n.contains("oracle"))
+ .toArray(String[]::new);
+
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(false, true, delegatesImpl));
+
+ }
+
+ @BuildStep
+ void indexSaxonHe(BuildProducer<IndexDependencyBuildItem> deps) {
+ deps.produce(new IndexDependencyBuildItem("org.quartz-scheduler", "quartz"));
+ deps.produce(new IndexDependencyBuildItem("org.apache.camel.quarkus", "camel-quarkus-quartz"));
Review comment:
I'm trying to register it in the extension (via annotation), I can try to register it via processor instead. I'll try it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton closed pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
jamesnetherton closed pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton closed pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
jamesnetherton closed pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton commented on a change in pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824443141
##########
File path: docs/modules/ROOT/pages/reference/extensions/quartz.adoc
##########
@@ -38,3 +38,60 @@ Or add the coordinates to your existing project:
----
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
+
+== Usage
+
+=== Clustering
+
+There are two options how to run Quartz in clustered mode:
+
+==== Quarkus based
+
+Follow the https://quarkus.io/guides/quartz[scheduling periodic tasks quartz guide].
+
+- Define database configuration in `application.properties`.
+- Use for example `flyway` to created database tables required for `Quartz`.
+
+===== Quartz based with an Agroal datasource
+
+Follow the http://www.quartz-scheduler.org/documentation/quartz-1.8.6/configuration/ConfigJDBCJobStoreClustering.html#configure-clustering-with-jdbc-jobstore[Configure Clustering with JDBC-JobStore Guide] with different DS configuration:
+
+- Use `quartz.properties` to configure `JobStore`.
+- Define datasource via quarkus (see the https://quarkus.io/guides/datasource[Quarkus datasource documentation)] and use `CamelQuarkusQuartzConnectionProvider` as `ConnectionProvider` in `quartz.properties`:
+
+```
+...
+org.quartz.jobStore.dataSource = myDS
+
+# datasource configuration
+org.quartz.dataSource.myDS.connectionProvider.class = org.apache.camel.quarkus.component.quartz.CamelQuarkusQuartzConnectionProvider
+org.quartz.dataSource.myDSB.dataSourceName = ds_name_if_not_set_default_ds_will_be_used
+```
+
+
+- You can use for example `flyway` to created database tables required for `Quartz`.
Review comment:
```suggestion
- You can use for example `flyway` to create database tables required for `Quartz`.
```
##########
File path: extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
##########
@@ -44,4 +61,43 @@ NativeImageResourceBuildItem nativeImageResources() {
ReflectiveClassBuildItem registerForReflection() {
return new ReflectiveClassBuildItem(false, false, QUARTZ_JOB_CLASSES);
}
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflectionWithMethods() {
+ return new ReflectiveClassBuildItem(true, false, QUARTZ_JOB_CLASSES_WITH_METHODS);
+ }
+
+ @BuildStep
+ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+ CombinedIndexBuildItem combinedIndex, CurateOutcomeBuildItem curateOutcome) {
+ IndexView index = combinedIndex.getIndex();
+
+ ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+ boolean oracleBlobIsPresent = applicationModel.getDependencies().stream()
+ .anyMatch(d -> d.getGroupId().equals("com.oracle.database.jdbc"));
+
+ final String[] delegatesImpl = index
+ .getAllKnownSubclasses(SQL_JDBC_DELEGATE)
+ .stream()
+ .map(c -> c.name().toString())
+ .filter(n -> oracleBlobIsPresent || !n.contains("oracle"))
+ .toArray(String[]::new);
+
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(false, true, delegatesImpl));
+
+ }
+
+ @BuildStep
+ void indexSaxonHe(BuildProducer<IndexDependencyBuildItem> deps) {
+ deps.produce(new IndexDependencyBuildItem("org.quartz-scheduler", "quartz"));
+ deps.produce(new IndexDependencyBuildItem("org.apache.camel.quarkus", "camel-quarkus-quartz"));
Review comment:
Do we need to index ourselves?
##########
File path: docs/modules/ROOT/pages/reference/extensions/quartz.adoc
##########
@@ -38,3 +38,60 @@ Or add the coordinates to your existing project:
----
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
+
+== Usage
+
+=== Clustering
+
+There are two options how to run Quartz in clustered mode:
+
+==== Quarkus based
+
+Follow the https://quarkus.io/guides/quartz[scheduling periodic tasks quartz guide].
Review comment:
I think we should make this the preferred configuration option given that it's more optimised. WDYT?
```suggestion
This is the preferred option. Follow the https://quarkus.io/guides/quartz[scheduling periodic tasks quartz guide].
```
##########
File path: docs/modules/ROOT/pages/reference/extensions/quartz.adoc
##########
@@ -38,3 +38,60 @@ Or add the coordinates to your existing project:
----
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
+
+== Usage
+
+=== Clustering
+
+There are two options how to run Quartz in clustered mode:
+
+==== Quarkus based
+
+Follow the https://quarkus.io/guides/quartz[scheduling periodic tasks quartz guide].
+
+- Define database configuration in `application.properties`.
+- Use for example `flyway` to created database tables required for `Quartz`.
+
+===== Quartz based with an Agroal datasource
+
+Follow the http://www.quartz-scheduler.org/documentation/quartz-1.8.6/configuration/ConfigJDBCJobStoreClustering.html#configure-clustering-with-jdbc-jobstore[Configure Clustering with JDBC-JobStore Guide] with different DS configuration:
+
+- Use `quartz.properties` to configure `JobStore`.
+- Define datasource via quarkus (see the https://quarkus.io/guides/datasource[Quarkus datasource documentation)] and use `CamelQuarkusQuartzConnectionProvider` as `ConnectionProvider` in `quartz.properties`:
+
+```
+...
+org.quartz.jobStore.dataSource = myDS
+
+# datasource configuration
+org.quartz.dataSource.myDS.connectionProvider.class = org.apache.camel.quarkus.component.quartz.CamelQuarkusQuartzConnectionProvider
+org.quartz.dataSource.myDSB.dataSourceName = ds_name_if_not_set_default_ds_will_be_used
+```
+
+
+- You can use for example `flyway` to created database tables required for `Quartz`.
+
+===== Quartz based
+
+You can follow the http://www.quartz-scheduler.org/documentation/quartz-1.8.6/configuration/ConfigJDBCJobStoreClustering.html#configure-clustering-with-jdbc-jobstore[Configure Clustering with JDBC-JobStore Guide] without any modification:
+
+```
+...
+org.quartz.jobStore.dataSource = myDS
+
+# datasource configuration
+org.quartz.dataSource.myDS.driver = org.postgresql.Driver
+
+# datasource configuration
+org.quartz.dataSource.myDS.URL=jdbc:postgresql://localhost:5432/default
+org.quartz.dataSource.myDS.user = quarkus
+org.quartz.dataSource.myDS.password = quarkus
+```
+
+
+== Camel Quarkus limitations
+
+=== JDBC Job Store
+
+Quartz's property `org.quartz.jobStore.useProperties` is set to `true` and can not bet modified. Value is forced by Quarkus's extension. See the Quartz documentation for more information about `org.quartz.jobStore.useProperties`.
Review comment:
```suggestion
Quartz's property `org.quartz.jobStore.useProperties` is set to `true` and can not be modified. The value is forced by the Quarkus Quartz extension. See the Quartz documentation for more information about `org.quartz.jobStore.useProperties`.
```
##########
File path: pom.xml
##########
@@ -72,6 +72,7 @@
<azure-core.version>1.21.0</azure-core.version><!-- @sync com.azure:azure-sdk-bom:${azure-sdk-bom.version} dep:com.azure:azure-core -->
<azure-core-test.version>1.7.3</azure-core-test.version>
<bouncycastle.version>1.70</bouncycastle.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.bouncycastle:bcprov-jdk15on -->
+ <c3p0.version>0.9.5.4</c3p0.version>
Review comment:
Maybe better to inherit the version from Camel.
```suggestion
<c3p0.version>${3p0-version}</c3p0.version>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824553810
##########
File path: extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
##########
@@ -44,4 +61,43 @@ NativeImageResourceBuildItem nativeImageResources() {
ReflectiveClassBuildItem registerForReflection() {
return new ReflectiveClassBuildItem(false, false, QUARTZ_JOB_CLASSES);
}
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflectionWithMethods() {
+ return new ReflectiveClassBuildItem(true, false, QUARTZ_JOB_CLASSES_WITH_METHODS);
+ }
+
+ @BuildStep
+ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+ CombinedIndexBuildItem combinedIndex, CurateOutcomeBuildItem curateOutcome) {
+ IndexView index = combinedIndex.getIndex();
+
+ ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+ boolean oracleBlobIsPresent = applicationModel.getDependencies().stream()
+ .anyMatch(d -> d.getGroupId().equals("com.oracle.database.jdbc"));
+
+ final String[] delegatesImpl = index
+ .getAllKnownSubclasses(SQL_JDBC_DELEGATE)
+ .stream()
+ .map(c -> c.name().toString())
+ .filter(n -> oracleBlobIsPresent || !n.contains("oracle"))
+ .toArray(String[]::new);
+
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(false, true, delegatesImpl));
+
+ }
+
+ @BuildStep
+ void indexSaxonHe(BuildProducer<IndexDependencyBuildItem> deps) {
+ deps.produce(new IndexDependencyBuildItem("org.quartz-scheduler", "quartz"));
+ deps.produce(new IndexDependencyBuildItem("org.apache.camel.quarkus", "camel-quarkus-quartz"));
Review comment:
I'm not sure, why it is behave that way, but:
- If index to ourself is removed, registration for reflection (by annotation) does not work, and I'm getting `Caused by: java.lang.ClassNotFoundException`: org.apache.camel.quarkus.component.quartz.CamelQuarkusQuartzConnectionProvider`
Therefore I kept index of ourselves
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#issuecomment-1065044962
Could be merged, all is fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton commented on pull request #3609: 3579 Improve quartz test coverage
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#issuecomment-1072102785
I manually merged this to `camel-main`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org