This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 1d18f534695ce285ecd81b82c2f1d82743a2fa0a Author: James Netherton <jamesnether...@gmail.com> AuthorDate: Wed Jan 6 08:53:07 2021 +0000 Upgrade to Camel 3.8.0 --- docs/antora-playbook-dev.yml | 2 +- docs/antora-playbook.yml | 2 +- docs/antora.yml | 2 +- .../ROOT/pages/reference/extensions/aws-ec2.adoc | 2 +- .../ROOT/pages/reference/extensions/aws-ecs.adoc | 2 +- .../ROOT/pages/reference/extensions/aws-eks.adoc | 2 +- .../ROOT/pages/reference/extensions/aws-iam.adoc | 2 +- .../pages/reference/extensions/aws-kinesis.adoc | 2 +- .../ROOT/pages/reference/extensions/aws-kms.adoc | 2 +- .../pages/reference/extensions/aws-lambda.adoc | 2 +- .../ROOT/pages/reference/extensions/aws-s3.adoc | 2 +- .../ROOT/pages/reference/extensions/aws-sdb.adoc | 2 +- .../ROOT/pages/reference/extensions/aws-sns.adoc | 2 +- .../ROOT/pages/reference/extensions/aws-sqs.adoc | 2 +- .../ROOT/pages/reference/extensions/aws-swf.adoc | 2 +- .../pages/reference/extensions/aws-translate.adoc | 2 +- .../reference/extensions/caffeine-lrucache.adoc | 8 +- .../ROOT/pages/reference/extensions/jsonata.adoc | 2 +- .../ROOT/pages/reference/extensions/sjms.adoc | 3 +- docs/modules/ROOT/pages/user-guide/bootstrap.adoc | 44 ++----- .../partials/reference/components/aws-ec2.adoc | 2 +- .../partials/reference/components/aws-ecs.adoc | 2 +- .../partials/reference/components/aws-eks.adoc | 2 +- .../partials/reference/components/aws-iam.adoc | 2 +- .../reference/components/aws-kinesis-firehose.adoc | 2 +- .../partials/reference/components/aws-kinesis.adoc | 2 +- .../partials/reference/components/aws-kms.adoc | 2 +- .../partials/reference/components/aws-lambda.adoc | 2 +- .../ROOT/partials/reference/components/aws-s3.adoc | 2 +- .../partials/reference/components/aws-sdb.adoc | 2 +- .../partials/reference/components/aws-sns.adoc | 2 +- .../partials/reference/components/aws-sqs.adoc | 2 +- .../partials/reference/components/aws-swf.adoc | 2 +- .../reference/components/aws-translate.adoc | 2 +- .../components/azure-storage-datalake.adoc | 1 + .../partials/reference/components/hwcloud-smn.adoc | 1 + .../reference/components/infinispan-embedded.adoc | 1 + .../partials/reference/components/jsonata.adoc | 4 +- .../partials/reference/components/kamelet.adoc | 1 + .../partials/reference/components/paho-mqtt5.adoc | 1 + .../partials/reference/components/sjms-batch.adoc | 13 -- .../reference/components/spring-rabbitmq.adoc | 1 + .../ROOT/partials/reference/components/stitch.adoc | 1 + .../reference/others/caffeine-lrucache.adoc | 13 ++ .../ROOT/partials/reference/others/jfr.adoc | 1 + .../quarkus/core/deployment/CamelProcessor.java | 2 + .../core/DisabledXMLRoutesDefinitionLoader.java | 6 - .../camel/quarkus/core/FastCamelContext.java | 131 ++++++++++++--------- .../quarkus/core/FastFactoryFinderResolver.java | 5 + .../camel/quarkus/core/NoShutdownStrategy.java | 10 ++ .../quarkus/main/deployment/CamelMainHelper.java | 50 ++++++++ .../CamelMainHotDeploymentProcessor.java | 27 +---- .../deployment/CamelMainNativeImageProcessor.java | 28 ++--- .../CamelMainLambdaRouteBuilderDiscoveryTest.java | 2 - .../deployment/CamelMainRouteTemplateTest.java | 1 - .../org/apache/camel/quarkus/main/CamelMain.java | 27 +++-- .../camel/quarkus/main/CamelMainRecorder.java | 6 - .../csimple/deployment/CSimpleXmlProcessor.java | 108 ++++++----------- extensions/infinispan/deployment/pom.xml | 4 - extensions/infinispan/runtime/pom.xml | 15 --- .../graal/SubstituteDefaultCacheManager.java | 100 ---------------- .../runtime/graal/SubstituteInfinispanManager.java | 36 ------ .../component/qute/QuteEndpointConfigurer.java | 3 - .../component/qute/QuteEndpointUriFactory.java | 3 +- .../org/apache/camel/component/qute/qute.json | 3 +- .../component/ssh/deployment/SshProcessor.java | 7 -- extensions/ssh/runtime/pom.xml | 6 + .../support/azure/AzureStorageTestResource.java | 2 +- .../runtime/support/CustomRoutesCollector.java | 20 +--- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../component/hazelcast/it/HazelcastQueueTest.java | 2 - integration-tests/main-devmode/pom.xml | 14 ++- .../camel/quarkus/main/CamelDevModeTest.java | 2 +- .../camel/quarkus/main/CoreMainXmlIoResource.java | 19 +-- .../src/main/resources/application.properties | 4 +- .../camel/quarkus/main/CoreMainXmlIoTest.java | 7 +- integration-tests/main-xml-jaxb/pom.xml | 4 +- .../quarkus/main/CoreMainXmlJaxbResource.java | 19 +-- .../src/main/resources/application.properties | 4 +- .../camel/quarkus/main/CoreMainXmlJaxbTest.java | 10 +- pom.xml | 13 +- poms/bom/pom.xml | 5 + 83 files changed, 363 insertions(+), 501 deletions(-) diff --git a/docs/antora-playbook-dev.yml b/docs/antora-playbook-dev.yml index 43c47f2..51f733e 100644 --- a/docs/antora-playbook-dev.yml +++ b/docs/antora-playbook-dev.yml @@ -26,7 +26,7 @@ content: start_path: docs - url: g...@github.com:apache/camel.git branches: - - camel-3.7.x # replace ${camel.docs.branch} + - camel-3.8.x # replace ${camel.docs.branch} start_paths: - docs/components - url: g...@github.com:apache/camel.git diff --git a/docs/antora-playbook.yml b/docs/antora-playbook.yml index 0c65a45..0ceede0 100644 --- a/docs/antora-playbook.yml +++ b/docs/antora-playbook.yml @@ -26,7 +26,7 @@ content: start_path: docs - url: g...@github.com:apache/camel.git branches: - - camel-3.7.x # replace ${camel.docs.branch} + - camel-3.8.x # replace ${camel.docs.branch} start_paths: - docs/components - url: g...@github.com:apache/camel.git diff --git a/docs/antora.yml b/docs/antora.yml index 89def84..00fdb1b 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -22,4 +22,4 @@ nav: - modules/ROOT/nav.adoc asciidoc: attributes: - cq-camel-components: 3.7.x@components # replace ${camel.docs.components.xref} + cq-camel-components: 3.8.x@components # replace ${camel.docs.components.xref} diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-ec2.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-ec2.adoc index 2e221ea..14b930b 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-ec2.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-ec2.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Manage AWS EC2 instances. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-ecs.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-ecs.adoc index 8fa18be..63c73a9 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-ecs.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-ecs.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Manage AWS ECS cluster instances. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-eks.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-eks.adoc index 93ea6e6..dd81039 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-eks.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-eks.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Manage AWS EKS cluster instances. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 0.0.1 :cq-native-since: 0.0.1 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-iam.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-iam.adoc index 3388eb5..e4510c4 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-iam.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-iam.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Manage AWS IAM instances. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-kinesis.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-kinesis.adoc index a6a4b34..9c31f8d 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-kinesis.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-kinesis.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Consume and produce records from AWS Kinesis Streams and AWS Kinesis Firehose streams. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-kms.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-kms.adoc index c12e938..c868c76 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-kms.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-kms.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Manage keys stored in AWS KMS instances. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-lambda.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-lambda.adoc index e4c300e..8743d8d 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-lambda.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-lambda.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Manage and invoke AWS Lambda functions. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-s3.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-s3.adoc index 44fed06..de1ab72 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-s3.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-s3.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Store and retrieve objects from AWS S3 Storage Service. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 0.0.1 :cq-native-since: 0.0.1 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-sdb.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-sdb.adoc index 369bae1..736425e 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-sdb.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-sdb.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Store and Retrieve data from/to AWS SDB service. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-sns.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-sns.adoc index e4685cc..a60c9e8 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-sns.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-sns.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Send messages to an AWS Simple Notification Topic. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 0.0.1 :cq-native-since: 0.0.1 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-sqs.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-sqs.adoc index 9c09e07..3220d8a 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-sqs.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-sqs.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Sending and receive messages to/from AWS SQS service. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 0.0.1 :cq-native-since: 0.0.1 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-swf.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-swf.adoc index 936224f..6c64f44 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-swf.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-swf.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Manage workflows in the AWS Simple Workflow service. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 diff --git a/docs/modules/ROOT/pages/reference/extensions/aws-translate.adoc b/docs/modules/ROOT/pages/reference/extensions/aws-translate.adoc index f375cbb..21df9d7 100644 --- a/docs/modules/ROOT/pages/reference/extensions/aws-translate.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/aws-translate.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: Translate texts using AWS Translate. -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 diff --git a/docs/modules/ROOT/pages/reference/extensions/caffeine-lrucache.adoc b/docs/modules/ROOT/pages/reference/extensions/caffeine-lrucache.adoc index 421db19..b13c69b 100644 --- a/docs/modules/ROOT/pages/reference/extensions/caffeine-lrucache.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/caffeine-lrucache.adoc @@ -6,7 +6,7 @@ :cq-native-supported: true :cq-status: Stable :cq-description: An LRUCacheFactory implementation based on Caffeine -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 @@ -15,6 +15,12 @@ An LRUCacheFactory implementation based on Caffeine +== What's inside + +* xref:{cq-camel-components}:others:caffeine-lrucache.adoc[Caffeine Lrucache] + +Please refer to the above link for usage and configuration details. + == Maven coordinates [source,xml] diff --git a/docs/modules/ROOT/pages/reference/extensions/jsonata.adoc b/docs/modules/ROOT/pages/reference/extensions/jsonata.adoc index d22514b..3b53fd3 100644 --- a/docs/modules/ROOT/pages/reference/extensions/jsonata.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/jsonata.adoc @@ -16,7 +16,7 @@ JSON to JSON transformation using JSONATA. == What's inside -* xref:{cq-camel-components}::jsonata-component.adoc[JSONATA component], URI syntax: `jsonata:resourceUri` +* xref:{cq-camel-components}::jsonata-component.adoc[JSONata component], URI syntax: `jsonata:resourceUri` Please refer to the above link for usage and configuration details. diff --git a/docs/modules/ROOT/pages/reference/extensions/sjms.adoc b/docs/modules/ROOT/pages/reference/extensions/sjms.adoc index a9c8263..ccbfe90 100644 --- a/docs/modules/ROOT/pages/reference/extensions/sjms.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/sjms.adoc @@ -18,9 +18,8 @@ Send and receive messages to/from a JMS Queue or Topic using plain JMS 1.x API. == What's inside * xref:{cq-camel-components}::sjms-component.adoc[Simple JMS component], URI syntax: `sjms:destinationType:destinationName` -* xref:{cq-camel-components}::sjms-batch-component.adoc[Simple JMS Batch component], URI syntax: `sjms-batch:destinationName` -Please refer to the above links for usage and configuration details. +Please refer to the above link for usage and configuration details. == Maven coordinates diff --git a/docs/modules/ROOT/pages/user-guide/bootstrap.adoc b/docs/modules/ROOT/pages/user-guide/bootstrap.adoc index 0780575..62d5c52 100644 --- a/docs/modules/ROOT/pages/user-guide/bootstrap.adoc +++ b/docs/modules/ROOT/pages/user-guide/bootstrap.adoc @@ -37,7 +37,7 @@ public class Configurations { } } ---- -<1> Camel uses the component URI scheme to look-up components from its registry, this requires you to add the `@Named` annotation to the method, otherwise the CDI container would create an anonymous bean and Camel would not be able to look it up. +<1> Camel uses the component URI scheme to look-up components from its registry, this requires you to add the `@Named` annotation to the method, otherwise the CDI container would create an anonymous bean and Camel would not be able to look it up. In Camel Quarkus the Camel components are discovered during the augmentation phase, producing a new component as shown in the example above would invalidate any optimization that may have been made. @@ -96,7 +96,7 @@ public class Main { } } ---- -<1> Start Quarkus and the Camel Quarkus runtime +<1> Start Quarkus and the Camel Quarkus runtime [NOTE] ==== @@ -105,25 +105,23 @@ It is recommended to perform very little logic in the Java Main. === XML Configuration -In order to configure Camel routes, rests or templates in XML, you must add a Camel XML parser dependency to the classpath. E.g either `camel-quarkus-xml-io` or +In order to configure Camel routes, rests or templates in XML, you must add a Camel XML parser dependency to the classpath. E.g either `camel-quarkus-xml-io` or `camel-quarkus-xml-jaxb`. `camel-quarkus-xml-io` is preferred due to its lightweight implementation. -==== Routes - -With Camel Main, you can set a property that points to the location of route XML files: +With Camel Main, you can set a property that points to the location of resources XML files such as routes, xref:latest@manual::rest-dsl.adoc[REST DSL] and xref:latest@manual::route-template.adoc[Route templates]: [source,properties] ---- -camel.main.xml-routes = routes/routes.xml, file:src/main/routes/other-routes.xml +camel.main.routes-include-pattern = routes/routes.xml, file:src/main/routes/rests.xml, file:src/main/rests/route-template.xml ---- [NOTE] ==== -Path globbing like `camel.main.xml-routes = *./routes.xml` currently does not work in native mode. +Path globbing like `camel.main.routes-include-pattern = *./routes.xml` currently does not work in native mode. ==== -Spring XML with `<beans>` or Blueprint XML with `<blueprint>` elements are not supported. The route XML should be in the simplified version like: +.Route [source,xml] ---- <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -139,18 +137,12 @@ Spring XML with `<beans>` or Blueprint XML with `<blueprint>` elements are not s </routes> ---- +[NOTE] +==== +Spring XML with `<beans>` or Blueprint XML with `<blueprint>` elements are not supported. The route XML should be in the simplified version like: +==== -==== REST DSL - -The Camel xref:latest@manual::rest-dsl.adoc[REST DSL] can be defined in XML and configured with Camel Main via a property: - -[source,properties] ----- -camel.main.xml-rests = rests/rests.xml, file:src/main/rests/other-rests.xml ----- - -The XML for the REST configuration looks like: - +.Rest DSL [source,xml] ---- <rests xmlns="http://camel.apache.org/schema/spring"> @@ -164,17 +156,7 @@ The XML for the REST configuration looks like: </rests> ---- -==== Route Templates - -xref:latest@manual::route-template.adoc[Route templates] can be defined in XML and configured with Camel Main via a property: - -[source,properties] ----- -camel.main.xml-route-templates = templates/route-template.xml, file:src/main/rests/other-route-template.xml ----- - -The XML for the route template configuration looks like: - +.Route Templates [source,xml] ---- <routeTemplates xmlns="http://camel.apache.org/schema/spring"> diff --git a/docs/modules/ROOT/partials/reference/components/aws-ec2.adoc b/docs/modules/ROOT/partials/reference/components/aws-ec2.adoc index 918ad78..89c0dfe 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-ec2.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-ec2.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-ec2 :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 :cq-camel-part-name: aws-ec2 diff --git a/docs/modules/ROOT/partials/reference/components/aws-ecs.adoc b/docs/modules/ROOT/partials/reference/components/aws-ecs.adoc index 1960685..9ab8dbe 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-ecs.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-ecs.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-ecs :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 :cq-camel-part-name: aws-ecs diff --git a/docs/modules/ROOT/partials/reference/components/aws-eks.adoc b/docs/modules/ROOT/partials/reference/components/aws-eks.adoc index 7516ffe..fef3a90 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-eks.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-eks.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-eks :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 0.0.1 :cq-native-since: 0.0.1 :cq-camel-part-name: aws-eks diff --git a/docs/modules/ROOT/partials/reference/components/aws-iam.adoc b/docs/modules/ROOT/partials/reference/components/aws-iam.adoc index fb4816b..f0afeae 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-iam.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-iam.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-iam :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 :cq-camel-part-name: aws-iam diff --git a/docs/modules/ROOT/partials/reference/components/aws-kinesis-firehose.adoc b/docs/modules/ROOT/partials/reference/components/aws-kinesis-firehose.adoc index 3b2b7b2..340bdbf 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-kinesis-firehose.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-kinesis-firehose.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-kinesis :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 :cq-camel-part-name: aws-kinesis-firehose diff --git a/docs/modules/ROOT/partials/reference/components/aws-kinesis.adoc b/docs/modules/ROOT/partials/reference/components/aws-kinesis.adoc index a933790..94e7faf 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-kinesis.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-kinesis.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-kinesis :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 :cq-camel-part-name: aws-kinesis diff --git a/docs/modules/ROOT/partials/reference/components/aws-kms.adoc b/docs/modules/ROOT/partials/reference/components/aws-kms.adoc index c074599..6696844 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-kms.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-kms.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-kms :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 :cq-camel-part-name: aws-kms diff --git a/docs/modules/ROOT/partials/reference/components/aws-lambda.adoc b/docs/modules/ROOT/partials/reference/components/aws-lambda.adoc index 6e6bd9e..5f97b88 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-lambda.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-lambda.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-lambda :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 :cq-camel-part-name: aws-lambda diff --git a/docs/modules/ROOT/partials/reference/components/aws-s3.adoc b/docs/modules/ROOT/partials/reference/components/aws-s3.adoc index b721d72..5bf3c8b 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-s3.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-s3.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-s3 :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 0.0.1 :cq-native-since: 0.0.1 :cq-camel-part-name: aws-s3 diff --git a/docs/modules/ROOT/partials/reference/components/aws-sdb.adoc b/docs/modules/ROOT/partials/reference/components/aws-sdb.adoc index cb14049..cb6bba3 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-sdb.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-sdb.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-sdb :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 :cq-camel-part-name: aws-sdb diff --git a/docs/modules/ROOT/partials/reference/components/aws-sns.adoc b/docs/modules/ROOT/partials/reference/components/aws-sns.adoc index 3e19301..0d37687 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-sns.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-sns.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-sns :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 0.0.1 :cq-native-since: 0.0.1 :cq-camel-part-name: aws-sns diff --git a/docs/modules/ROOT/partials/reference/components/aws-sqs.adoc b/docs/modules/ROOT/partials/reference/components/aws-sqs.adoc index 53ab120..ccd44df 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-sqs.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-sqs.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-sqs :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 0.0.1 :cq-native-since: 0.0.1 :cq-camel-part-name: aws-sqs diff --git a/docs/modules/ROOT/partials/reference/components/aws-swf.adoc b/docs/modules/ROOT/partials/reference/components/aws-swf.adoc index 8b39d33..d6f3774 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-swf.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-swf.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-swf :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 :cq-camel-part-name: aws-swf diff --git a/docs/modules/ROOT/partials/reference/components/aws-translate.adoc b/docs/modules/ROOT/partials/reference/components/aws-translate.adoc index f58a954..1e2a1b1 100644 --- a/docs/modules/ROOT/partials/reference/components/aws-translate.adoc +++ b/docs/modules/ROOT/partials/reference/components/aws-translate.adoc @@ -4,7 +4,7 @@ :cq-artifact-id-base: aws-translate :cq-native-supported: true :cq-status: Stable -:cq-deprecated: false +:cq-deprecated: true :cq-jvm-since: 1.0.0 :cq-native-since: 1.0.0 :cq-camel-part-name: aws-translate diff --git a/docs/modules/ROOT/partials/reference/components/azure-storage-datalake.adoc b/docs/modules/ROOT/partials/reference/components/azure-storage-datalake.adoc new file mode 100644 index 0000000..a509c1d --- /dev/null +++ b/docs/modules/ROOT/partials/reference/components/azure-storage-datalake.adoc @@ -0,0 +1 @@ +// Empty partial for a Camel bit unsupported by Camel Quarkus to avoid warnings when this file is included from a Camel page diff --git a/docs/modules/ROOT/partials/reference/components/hwcloud-smn.adoc b/docs/modules/ROOT/partials/reference/components/hwcloud-smn.adoc new file mode 100644 index 0000000..a509c1d --- /dev/null +++ b/docs/modules/ROOT/partials/reference/components/hwcloud-smn.adoc @@ -0,0 +1 @@ +// Empty partial for a Camel bit unsupported by Camel Quarkus to avoid warnings when this file is included from a Camel page diff --git a/docs/modules/ROOT/partials/reference/components/infinispan-embedded.adoc b/docs/modules/ROOT/partials/reference/components/infinispan-embedded.adoc new file mode 100644 index 0000000..a509c1d --- /dev/null +++ b/docs/modules/ROOT/partials/reference/components/infinispan-embedded.adoc @@ -0,0 +1 @@ +// Empty partial for a Camel bit unsupported by Camel Quarkus to avoid warnings when this file is included from a Camel page diff --git a/docs/modules/ROOT/partials/reference/components/jsonata.adoc b/docs/modules/ROOT/partials/reference/components/jsonata.adoc index 0e6518d..2b9f794 100644 --- a/docs/modules/ROOT/partials/reference/components/jsonata.adoc +++ b/docs/modules/ROOT/partials/reference/components/jsonata.adoc @@ -8,6 +8,6 @@ :cq-jvm-since: 1.6.0 :cq-native-since: 1.6.0 :cq-camel-part-name: jsonata -:cq-camel-part-title: JSONATA -:cq-camel-part-description: JSON to JSON transformation using JSONATA. +:cq-camel-part-title: JSONata +:cq-camel-part-description: Transforms JSON payload using JSONata transformation. :cq-extension-page-title: JSONATA diff --git a/docs/modules/ROOT/partials/reference/components/kamelet.adoc b/docs/modules/ROOT/partials/reference/components/kamelet.adoc new file mode 100644 index 0000000..a509c1d --- /dev/null +++ b/docs/modules/ROOT/partials/reference/components/kamelet.adoc @@ -0,0 +1 @@ +// Empty partial for a Camel bit unsupported by Camel Quarkus to avoid warnings when this file is included from a Camel page diff --git a/docs/modules/ROOT/partials/reference/components/paho-mqtt5.adoc b/docs/modules/ROOT/partials/reference/components/paho-mqtt5.adoc new file mode 100644 index 0000000..a509c1d --- /dev/null +++ b/docs/modules/ROOT/partials/reference/components/paho-mqtt5.adoc @@ -0,0 +1 @@ +// Empty partial for a Camel bit unsupported by Camel Quarkus to avoid warnings when this file is included from a Camel page diff --git a/docs/modules/ROOT/partials/reference/components/sjms-batch.adoc b/docs/modules/ROOT/partials/reference/components/sjms-batch.adoc deleted file mode 100644 index eff2868..0000000 --- a/docs/modules/ROOT/partials/reference/components/sjms-batch.adoc +++ /dev/null @@ -1,13 +0,0 @@ -// Do not edit directly! -// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page -:cq-artifact-id: camel-quarkus-sjms -:cq-artifact-id-base: sjms -:cq-native-supported: true -:cq-status: Stable -:cq-deprecated: false -:cq-jvm-since: 1.0.0 -:cq-native-since: 1.0.0 -:cq-camel-part-name: sjms-batch -:cq-camel-part-title: Simple JMS Batch -:cq-camel-part-description: Highly performant and transactional batch consumption of messages from a JMS queue. -:cq-extension-page-title: Simple JMS diff --git a/docs/modules/ROOT/partials/reference/components/spring-rabbitmq.adoc b/docs/modules/ROOT/partials/reference/components/spring-rabbitmq.adoc new file mode 100644 index 0000000..a509c1d --- /dev/null +++ b/docs/modules/ROOT/partials/reference/components/spring-rabbitmq.adoc @@ -0,0 +1 @@ +// Empty partial for a Camel bit unsupported by Camel Quarkus to avoid warnings when this file is included from a Camel page diff --git a/docs/modules/ROOT/partials/reference/components/stitch.adoc b/docs/modules/ROOT/partials/reference/components/stitch.adoc new file mode 100644 index 0000000..a509c1d --- /dev/null +++ b/docs/modules/ROOT/partials/reference/components/stitch.adoc @@ -0,0 +1 @@ +// Empty partial for a Camel bit unsupported by Camel Quarkus to avoid warnings when this file is included from a Camel page diff --git a/docs/modules/ROOT/partials/reference/others/caffeine-lrucache.adoc b/docs/modules/ROOT/partials/reference/others/caffeine-lrucache.adoc new file mode 100644 index 0000000..648f4e7 --- /dev/null +++ b/docs/modules/ROOT/partials/reference/others/caffeine-lrucache.adoc @@ -0,0 +1,13 @@ +// Do not edit directly! +// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page +:cq-artifact-id: camel-quarkus-caffeine-lrucache +:cq-artifact-id-base: caffeine-lrucache +:cq-native-supported: true +:cq-status: Stable +:cq-deprecated: true +:cq-jvm-since: 1.0.0 +:cq-native-since: 1.0.0 +:cq-camel-part-name: caffeine-lrucache +:cq-camel-part-title: Caffeine Lrucache +:cq-camel-part-description: Camel Caffeine LRUCache support +:cq-extension-page-title: Caffeine LRUCache diff --git a/docs/modules/ROOT/partials/reference/others/jfr.adoc b/docs/modules/ROOT/partials/reference/others/jfr.adoc new file mode 100644 index 0000000..a509c1d --- /dev/null +++ b/docs/modules/ROOT/partials/reference/others/jfr.adoc @@ -0,0 +1 @@ +// Empty partial for a Camel bit unsupported by Camel Quarkus to avoid warnings when this file is included from a Camel page diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java index 7efea5e..f755f1b 100644 --- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java +++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java @@ -150,6 +150,8 @@ class CamelProcessor { CamelServiceDestination.DISCOVERY, true, "META-INF/services/org/apache/camel/*", + "META-INF/services/org/apache/camel/routes-loader/*", + "META-INF/services/org/apache/camel/invoke-on-header/*", "META-INF/services/org/apache/camel/management/*", "META-INF/services/org/apache/camel/model/*", "META-INF/services/org/apache/camel/configurer/*", diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java index a50befb..ed92c66 100644 --- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java +++ b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java @@ -19,7 +19,6 @@ package org.apache.camel.quarkus.core; import java.io.InputStream; import org.apache.camel.CamelContext; -import org.apache.camel.NamedNode; import org.apache.camel.spi.XMLRoutesDefinitionLoader; public class DisabledXMLRoutesDefinitionLoader implements XMLRoutesDefinitionLoader { @@ -37,9 +36,4 @@ public class DisabledXMLRoutesDefinitionLoader implements XMLRoutesDefinitionLoa public Object loadRestsDefinition(CamelContext context, InputStream inputStream) throws Exception { throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-io"); } - - @Override - public <T extends NamedNode> T createModelFromXml(CamelContext context, String xml, Class<T> type) throws Exception { - throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-io"); - } } diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java index 09a1267..43ed897 100644 --- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java +++ b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java @@ -41,7 +41,6 @@ import org.apache.camel.catalog.impl.DefaultRuntimeCamelCatalog; import org.apache.camel.component.microprofile.config.CamelMicroProfilePropertiesSource; import org.apache.camel.health.HealthCheckRegistry; import org.apache.camel.impl.engine.AbstractCamelContext; -import org.apache.camel.impl.engine.BaseServiceResolver; import org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager; import org.apache.camel.impl.engine.DefaultBeanIntrospection; import org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor; @@ -65,6 +64,7 @@ import org.apache.camel.impl.engine.DefaultPackageScanResourceResolver; import org.apache.camel.impl.engine.DefaultReactiveExecutor; import org.apache.camel.impl.engine.DefaultRouteController; import org.apache.camel.impl.engine.DefaultRouteFactory; +import org.apache.camel.impl.engine.DefaultRoutesLoader; import org.apache.camel.impl.engine.DefaultStreamCachingStrategy; import org.apache.camel.impl.engine.DefaultTracer; import org.apache.camel.impl.engine.DefaultTransformerRegistry; @@ -141,6 +141,7 @@ import org.apache.camel.spi.RestBindingJaxbDataFormatFactory; import org.apache.camel.spi.RestRegistryFactory; import org.apache.camel.spi.RouteController; import org.apache.camel.spi.RouteFactory; +import org.apache.camel.spi.RoutesLoader; import org.apache.camel.spi.ShutdownStrategy; import org.apache.camel.spi.StreamCachingStrategy; import org.apache.camel.spi.Tracer; @@ -155,14 +156,15 @@ import org.apache.camel.spi.ValidatorRegistry; import org.apache.camel.spi.XMLRoutesDefinitionLoader; import org.apache.camel.support.CamelContextHelper; import org.apache.camel.support.DefaultUuidGenerator; +import org.apache.camel.support.ResolverHelper; import org.apache.camel.util.IOHelper; import org.apache.camel.util.ObjectHelper; public class FastCamelContext extends AbstractCamelContext implements CatalogCamelContext, ModelCamelContext { - private Model model; private final String version; private final XMLRoutesDefinitionLoader xmlLoader; private final ModelToXMLDumper modelDumper; + private Model model; public FastCamelContext(FactoryFinderResolver factoryFinderResolver, String version, XMLRoutesDefinitionLoader xmlLoader, ModelToXMLDumper modelDumper) { @@ -177,7 +179,22 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam setTracing(Boolean.FALSE); setDebugging(Boolean.FALSE); setMessageHistory(Boolean.FALSE); + } + + private static ValueHolder<String> createValidatorKey(ValidatorDefinition def) { + return new ValidatorKey(new DataType(def.getType())); + } + + private static ValueHolder<String> createTransformerKey(TransformerDefinition def) { + return ObjectHelper.isNotEmpty(def.getScheme()) ? new TransformerKey(def.getScheme()) + : new TransformerKey(new DataType(def.getFromType()), new DataType(def.getToType())); + } + @Override + public void build() { + super.build(); + // we are fast build so the time should be reset to 0 + resetBuildTime(); } @Override @@ -344,11 +361,13 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam @Override protected BeanProxyFactory createBeanProxyFactory() { - return new BaseServiceResolver<>(BeanProxyFactory.FACTORY, BeanProxyFactory.class, - getBootstrapFactoryFinder()) - .resolve(getCamelContextReference()) - .orElseThrow(() -> new IllegalArgumentException("Cannot find BeanProxyFactory on classpath. " - + "Add camel-bean to classpath.")); + return ResolverHelper.resolveService( + getCamelContextReference(), + getBootstrapFactoryFinder(), + BeanProxyFactory.FACTORY, + BeanProxyFactory.class) + .orElseThrow(() -> new IllegalArgumentException( + "Cannot find BeanProxyFactory on classpath. Add camel-bean to classpath.")); } @Override @@ -363,11 +382,13 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam @Override protected BeanProcessorFactory createBeanProcessorFactory() { - return new BaseServiceResolver<>(BeanProcessorFactory.FACTORY, BeanProcessorFactory.class, - getBootstrapFactoryFinder()) - .resolve(getCamelContextReference()) - .orElseThrow(() -> new IllegalArgumentException("Cannot find BeanProcessorFactory on classpath. " - + "Add camel-bean to classpath.")); + return ResolverHelper.resolveService( + getCamelContextReference(), + getBootstrapFactoryFinder(), + BeanProcessorFactory.FACTORY, + BeanProcessorFactory.class) + .orElseThrow(() -> new IllegalArgumentException( + "Cannot find BeanProcessorFactory on classpath. Add camel-bean to classpath.")); } @Override @@ -396,6 +417,11 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam } @Override + protected RoutesLoader createRoutesLoader() { + return new DefaultRoutesLoader(); + } + + @Override protected ModelToXMLDumper createModelToXMLDumper() { return modelDumper; } @@ -429,11 +455,13 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam @Override protected RestRegistryFactory createRestRegistryFactory() { - return new BaseServiceResolver<>(RestRegistryFactory.FACTORY, RestRegistryFactory.class, - getBootstrapFactoryFinder()) - .resolve(getCamelContextReference()) - .orElseThrow(() -> new IllegalArgumentException("Cannot find RestRegistryFactory on classpath. " - + "Add camel-rest to classpath.")); + return ResolverHelper.resolveService( + getCamelContextReference(), + getBootstrapFactoryFinder(), + RestRegistryFactory.FACTORY, + RestRegistryFactory.class) + .orElseThrow(() -> new IllegalArgumentException( + "Cannot find RestRegistryFactory on classpath. Add camel-rest to classpath.")); } @Override @@ -473,9 +501,12 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam @Override protected HealthCheckRegistry createHealthCheckRegistry() { - return new BaseServiceResolver<>(HealthCheckRegistry.FACTORY, HealthCheckRegistry.class, - getBootstrapFactoryFinder()) - .resolve(getCamelContextReference()).orElse(null); + return ResolverHelper.resolveService( + getCamelContextReference(), + getBootstrapFactoryFinder(), + HealthCheckRegistry.FACTORY, + HealthCheckRegistry.class) + .orElse(null); } @Override @@ -485,12 +516,13 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam @Override protected RestBindingJaxbDataFormatFactory createRestBindingJaxbDataFormatFactory() { - return new BaseServiceResolver<>(RestBindingJaxbDataFormatFactory.FACTORY, RestBindingJaxbDataFormatFactory.class, - getBootstrapFactoryFinder()) - .resolve(getCamelContextReference()) - .orElseThrow( - () -> new IllegalArgumentException("Cannot find RestBindingJaxbDataFormatFactory on classpath. " - + "Add camel-jaxb to classpath.")); + return ResolverHelper.resolveService( + getCamelContextReference(), + getBootstrapFactoryFinder(), + RestBindingJaxbDataFormatFactory.FACTORY, + RestBindingJaxbDataFormatFactory.class) + .orElseThrow(() -> new IllegalArgumentException( + "Cannot find RestBindingJaxbDataFormatFactory on classpath. Add camel-jaxb to classpath.")); } @Override @@ -602,6 +634,10 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam return null; } + // + // ModelCamelContext + // + @Override public Processor createErrorHandler(Route route, Processor processor) throws Exception { return ErrorHandlerReifier.reifier(route, route.getErrorHandlerFactory()) @@ -613,10 +649,6 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam this.model = null; } - // - // ModelCamelContext - // - @Override public void startRouteDefinitions() throws Exception { List<RouteDefinition> routeDefinitions = model.getRouteDefinitions(); @@ -701,13 +733,13 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam } @Override - public void setDataFormats(Map<String, DataFormatDefinition> dataFormats) { - model.setDataFormats(dataFormats); + public Map<String, DataFormatDefinition> getDataFormats() { + return model.getDataFormats(); } @Override - public Map<String, DataFormatDefinition> getDataFormats() { - return model.getDataFormats(); + public void setDataFormats(Map<String, DataFormatDefinition> dataFormats) { + model.setDataFormats(dataFormats); } @Override @@ -726,11 +758,6 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam } @Override - public void setValidators(List<ValidatorDefinition> validators) { - model.setValidators(validators); - } - - @Override public HystrixConfigurationDefinition getHystrixConfiguration(String id) { return model.getHystrixConfiguration(id); } @@ -796,8 +823,8 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam } @Override - public void setTransformers(List<TransformerDefinition> transformers) { - model.setTransformers(transformers); + public void setValidators(List<ValidatorDefinition> validators) { + model.setValidators(validators); } @Override @@ -806,6 +833,11 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam } @Override + public void setTransformers(List<TransformerDefinition> transformers) { + model.setTransformers(transformers); + } + + @Override public ServiceCallConfigurationDefinition getServiceCallConfiguration(String serviceName) { return model.getServiceCallConfiguration(serviceName); } @@ -831,13 +863,13 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam } @Override - public void setRouteFilter(Function<RouteDefinition, Boolean> filter) { - model.setRouteFilter(filter); + public Function<RouteDefinition, Boolean> getRouteFilter() { + return model.getRouteFilter(); } @Override - public Function<RouteDefinition, Boolean> getRouteFilter() { - return model.getRouteFilter(); + public void setRouteFilter(Function<RouteDefinition, Boolean> filter) { + model.setRouteFilter(filter); } @Override @@ -918,10 +950,6 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam getValidatorRegistry().put(createValidatorKey(def), validator); } - private static ValueHolder<String> createValidatorKey(ValidatorDefinition def) { - return new ValidatorKey(new DataType(def.getType())); - } - @SuppressWarnings("unchecked") @Override public void registerTransformer(TransformerDefinition def) { @@ -930,11 +958,6 @@ public class FastCamelContext extends AbstractCamelContext implements CatalogCam getTransformerRegistry().put(createTransformerKey(def), transformer); } - private static ValueHolder<String> createTransformerKey(TransformerDefinition def) { - return ObjectHelper.isNotEmpty(def.getScheme()) ? new TransformerKey(def.getScheme()) - : new TransformerKey(new DataType(def.getFromType()), new DataType(def.getToType())); - } - @Override public void addModelLifecycleStrategy(ModelLifecycleStrategy modelLifecycleStrategy) { model.addModelLifecycleStrategy(modelLifecycleStrategy); diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastFactoryFinderResolver.java b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastFactoryFinderResolver.java index 5713886..421a386 100644 --- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastFactoryFinderResolver.java +++ b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastFactoryFinderResolver.java @@ -63,6 +63,11 @@ public class FastFactoryFinderResolver extends DefaultFactoryFinderResolver { return new FastFactoryFinder(resourcePath); } + @Override + public FactoryFinder resolveBootstrapFactoryFinder(ClassResolver classResolver, String resourcePath) { + return new FastFactoryFinder(resourcePath); + } + // exposed for testing purpose public Map<String, Class<?>> getClassMap() { return Collections.unmodifiableMap(this.classMap); diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/NoShutdownStrategy.java b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/NoShutdownStrategy.java index 4110fba..477bcc3 100644 --- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/NoShutdownStrategy.java +++ b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/NoShutdownStrategy.java @@ -19,6 +19,7 @@ package org.apache.camel.quarkus.core; import java.util.List; import java.util.concurrent.TimeUnit; +import org.apache.camel.LoggingLevel; import org.apache.camel.CamelContext; import org.apache.camel.Service; import org.apache.camel.spi.RouteStartupOrder; @@ -130,6 +131,15 @@ public class NoShutdownStrategy implements ShutdownStrategy { } @Override + public LoggingLevel getLoggingLevel() { + return LoggingLevel.OFF; + } + + public void setLoggingLevel(LoggingLevel LoggingLevel) { + // noop + } + + @Override public void start() { } diff --git a/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainHelper.java b/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainHelper.java new file mode 100644 index 0000000..6f60192 --- /dev/null +++ b/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainHelper.java @@ -0,0 +1,50 @@ +/* + * 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.main.deployment; + +import java.util.stream.Stream; + +import org.apache.camel.quarkus.core.deployment.util.CamelSupport; + +public final class CamelMainHelper { + private static final String[] EMPTY_STRING_ARRAY = new String[0]; + + private CamelMainHelper() { + } + + public static Stream<String> routesIncludePatter() { + final String[] i1 = CamelSupport.getOptionalConfigValue( + "camel.main.routes-include-pattern", String[].class, EMPTY_STRING_ARRAY); + final String[] i2 = CamelSupport.getOptionalConfigValue( + "camel.main.routesIncludePattern", String[].class, EMPTY_STRING_ARRAY); + + return i1.length == 0 && i2.length == 0 + ? Stream.empty() + : Stream.concat(Stream.of(i1), Stream.of(i2)).filter(location -> !"false".equals(location)); + } + + public static Stream<String> routesExcludePatter() { + final String[] i1 = CamelSupport.getOptionalConfigValue( + "camel.main.routes-exclude-pattern", String[].class, EMPTY_STRING_ARRAY); + final String[] i2 = CamelSupport.getOptionalConfigValue( + "camel.main.routesExcludePattern", String[].class, EMPTY_STRING_ARRAY); + + return i1.length == 0 && i2.length == 0 + ? Stream.empty() + : Stream.concat(Stream.of(i1), Stream.of(i2)).filter(location -> !"false".equals(location)); + } +} diff --git a/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainHotDeploymentProcessor.java b/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainHotDeploymentProcessor.java index d207ea5..8325147 100644 --- a/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainHotDeploymentProcessor.java +++ b/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainHotDeploymentProcessor.java @@ -21,40 +21,19 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.stream.Collectors; -import java.util.stream.Stream; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem; -import org.apache.camel.quarkus.core.deployment.util.CamelSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/* - * camel-main does not yet support filtering with pattern/glob so - * each entry of camel.main.xml-[routes|rests] is a path thus can - * be safely added to the list of files to watch to trigger hot - * deployment. - * - * See https://issues.apache.org/jira/browse/CAMEL-14100 - */ class CamelMainHotDeploymentProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(CamelMainHotDeploymentProcessor.class); - private static final String[] EMPTY_STRING_ARRAY = new String[0]; private static final String FILE_PREFIX = "file:"; @BuildStep - List<HotDeploymentWatchedFileBuildItem> xmlRoutes() { - return locations("camel.main.xml-routes"); - } - - @BuildStep - List<HotDeploymentWatchedFileBuildItem> xmlRests() { - return locations("camel.main.xml-rests"); - } - - private static List<HotDeploymentWatchedFileBuildItem> locations(String property) { - String[] locations = CamelSupport.getOptionalConfigValue(property, String[].class, EMPTY_STRING_ARRAY); - List<HotDeploymentWatchedFileBuildItem> items = Stream.of(locations) + List<HotDeploymentWatchedFileBuildItem> locations() { + List<HotDeploymentWatchedFileBuildItem> items = CamelMainHelper.routesIncludePatter() .filter(location -> location.startsWith(FILE_PREFIX)) .map(location -> location.substring(FILE_PREFIX.length())) .distinct() @@ -66,7 +45,7 @@ class CamelMainHotDeploymentProcessor { .collect(Collectors.toList()); if (!items.isEmpty()) { - LOGGER.info("HotDeployment files ({}):", property); + LOGGER.info("HotDeployment files:"); for (HotDeploymentWatchedFileBuildItem item : items) { LOGGER.info("- {}", item.getLocation()); } diff --git a/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainNativeImageProcessor.java b/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainNativeImageProcessor.java index 453f473..bab94d6 100644 --- a/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainNativeImageProcessor.java +++ b/extensions-core/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainNativeImageProcessor.java @@ -16,19 +16,19 @@ */ package org.apache.camel.quarkus.main.deployment; +import java.util.stream.Collectors; + import io.quarkus.deployment.Capabilities; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; -import org.apache.camel.quarkus.core.deployment.util.CamelSupport; import org.apache.camel.quarkus.support.common.CamelCapabilities; import org.apache.camel.support.ResourceHelper; import org.apache.camel.util.AntPathMatcher; import org.jboss.logging.Logger; public class CamelMainNativeImageProcessor { - private static final Logger LOG = Logger.getLogger(CamelMainNativeImageProcessor.class); @BuildStep @@ -46,27 +46,25 @@ public class CamelMainNativeImageProcessor { } @BuildStep - void camelNativeImageResources(Capabilities capabilities, BuildProducer<NativeImageResourceBuildItem> nativeResource) { - if (capabilities.isCapabilityPresent(CamelCapabilities.XML)) { - String prefix = "camel.main."; - String[] properties = new String[] { "xml-rests", "xml-routes", "xml-route-templates" }; - for (String property : properties) { - embedCamelResource(prefix + property, nativeResource); - } + private void camelNativeImageResources( + Capabilities capabilities, + BuildProducer<NativeImageResourceBuildItem> nativeResource) { + + if (!capabilities.isCapabilityPresent(CamelCapabilities.XML)) { + return; } - } - private void embedCamelResource(String propertyName, BuildProducer<NativeImageResourceBuildItem> nativeResource) { - for (String path : CamelSupport.getOptionalConfigValue(propertyName, String[].class, new String[0])) { + for (String path : CamelMainHelper.routesIncludePatter().collect(Collectors.toList())) { String scheme = ResourceHelper.getScheme(path); // Null scheme is equivalent to classpath scheme if (scheme == null || scheme.equals("classpath:")) { if (AntPathMatcher.INSTANCE.isPattern(path)) { - // Classpath directory traversal via wildcard paths does not work on GraalVM. The exact path to the resource has to be looked up + // Classpath directory traversal via wildcard paths does not work on GraalVM. + // The exact path to the resource has to be looked up // https://github.com/oracle/graal/issues/1108 - LOG.warnf("%s classpath wildcards does not work in native mode. Resources matching %s will not be loaded.", - propertyName, path); + LOG.warnf("Classpath wildcards does not work in native mode. Resources matching %s will not be loaded.", + path); } else { nativeResource.produce(new NativeImageResourceBuildItem(path.replace("classpath:", ""))); } diff --git a/extensions-core/main/deployment/src/test/java/org/apache/camel/quarkus/main/deployment/CamelMainLambdaRouteBuilderDiscoveryTest.java b/extensions-core/main/deployment/src/test/java/org/apache/camel/quarkus/main/deployment/CamelMainLambdaRouteBuilderDiscoveryTest.java index 3697f7e..f2e951d 100644 --- a/extensions-core/main/deployment/src/test/java/org/apache/camel/quarkus/main/deployment/CamelMainLambdaRouteBuilderDiscoveryTest.java +++ b/extensions-core/main/deployment/src/test/java/org/apache/camel/quarkus/main/deployment/CamelMainLambdaRouteBuilderDiscoveryTest.java @@ -63,12 +63,10 @@ public class CamelMainLambdaRouteBuilderDiscoveryTest { @Test public void testRoutesDiscovery() { assertThat(main.getCamelContext().getRoutes()).isNotEmpty(); - assertThat(main.configure().getRoutesBuilders()).isNotEmpty(); } @Produces public LambdaRouteBuilder myRoute() { return rb -> rb.from("direct:in").routeId("my-route").to("log:out"); } - } diff --git a/extensions-core/main/deployment/src/test/java/org/apache/camel/quarkus/main/deployment/CamelMainRouteTemplateTest.java b/extensions-core/main/deployment/src/test/java/org/apache/camel/quarkus/main/deployment/CamelMainRouteTemplateTest.java index 3925fb2..e91c15d 100644 --- a/extensions-core/main/deployment/src/test/java/org/apache/camel/quarkus/main/deployment/CamelMainRouteTemplateTest.java +++ b/extensions-core/main/deployment/src/test/java/org/apache/camel/quarkus/main/deployment/CamelMainRouteTemplateTest.java @@ -76,7 +76,6 @@ public class CamelMainRouteTemplateTest { main.getCamelContext().addRouteFromTemplate("second", "myTemplate", parameters); assertThat(main.getCamelContext().getRoutes()).isNotEmpty(); - assertThat(main.configure().getRoutesBuilders()).isNotEmpty(); FluentProducerTemplate p = main.getCamelContext().createFluentProducerTemplate(); String out1 = p.withBody("body1").to("direct:one").request(String.class); diff --git a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java index ab75ad5..a77fdb0 100644 --- a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java +++ b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java @@ -24,13 +24,12 @@ import io.quarkus.runtime.Quarkus; import org.apache.camel.CamelContext; import org.apache.camel.ExtendedCamelContext; import org.apache.camel.ProducerTemplate; -import org.apache.camel.RoutesBuilder; import org.apache.camel.main.MainCommandLineSupport; import org.apache.camel.main.MainConfigurationProperties; import org.apache.camel.main.MainListener; import org.apache.camel.main.MainShutdownStrategy; +import org.apache.camel.main.RoutesConfigurer; import org.apache.camel.main.SimpleMainShutdownStrategy; -import org.apache.camel.spi.CamelBeanPostProcessor; import org.apache.camel.spi.HasCamelContext; import org.apache.camel.support.service.ServiceHelper; import org.slf4j.Logger; @@ -46,14 +45,21 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC this.engineStarted = new AtomicBoolean(); } - @Override - protected void loadRouteBuilders(CamelContext camelContext) throws Exception { - // routes are discovered and pre-instantiated which allow to post process them to support Camel's DI - CamelBeanPostProcessor postProcessor = camelContext.adapt(ExtendedCamelContext.class).getBeanPostProcessor(); - for (RoutesBuilder builder : mainConfigurationProperties.getRoutesBuilders()) { - postProcessor.postProcessBeforeInitialization(builder, builder.getClass().getName()); - postProcessor.postProcessAfterInitialization(builder, builder.getClass().getName()); + protected void configureRoutes(CamelContext camelContext) throws Exception { + // then configure and add the routes + RoutesConfigurer configurer = new RoutesConfigurer(); + + if (mainConfigurationProperties.isRoutesCollectorEnabled()) { + configurer.setRoutesCollector(routesCollector); } + + configurer.setBeanPostProcessor(camelContext.adapt(ExtendedCamelContext.class).getBeanPostProcessor()); + configurer.setRoutesBuilders(mainConfigurationProperties.getRoutesBuilders()); + configurer.setRoutesExcludePattern(mainConfigurationProperties.getRoutesExcludePattern()); + configurer.setRoutesIncludePattern(mainConfigurationProperties.getRoutesIncludePattern()); + configurer.setJavaRoutesExcludePattern(mainConfigurationProperties.getJavaRoutesExcludePattern()); + configurer.setJavaRoutesIncludePattern(mainConfigurationProperties.getJavaRoutesIncludePattern()); + configurer.configureRoutes(camelContext); } @Override @@ -146,8 +152,9 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC } @Override - public void run(String[] args) throws Exception { + public int run(String[] args) throws Exception { parseArguments(args); runEngine(); + return getExitCode(); } } diff --git a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java index 0b3e65c..37ef711 100644 --- a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java +++ b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java @@ -46,12 +46,6 @@ public class CamelMainRecorder { // no need to look for sources. main.setDefaultPropertyPlaceholderLocation("false"); - // xml rest/routes/templates should be explicitly configured as an - // additional dependency is required thus, disable auto discovery - main.configure().setXmlRoutes("false"); - main.configure().setXmlRests("false"); - main.configure().setXmlRouteTemplates("false"); - // register to the container container.instance(CamelMainProducers.class).setMain(main); diff --git a/extensions/csimple/deployment/src/main/java/org/apache/camel/quarkus/component/csimple/deployment/CSimpleXmlProcessor.java b/extensions/csimple/deployment/src/main/java/org/apache/camel/quarkus/component/csimple/deployment/CSimpleXmlProcessor.java index 2718247..f5c2d29 100644 --- a/extensions/csimple/deployment/src/main/java/org/apache/camel/quarkus/component/csimple/deployment/CSimpleXmlProcessor.java +++ b/extensions/csimple/deployment/src/main/java/org/apache/camel/quarkus/component/csimple/deployment/CSimpleXmlProcessor.java @@ -16,23 +16,14 @@ */ package org.apache.camel.quarkus.component.csimple.deployment; -import java.io.Closeable; import java.io.FileNotFoundException; -import java.io.IOException; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; import java.util.List; -import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; -import org.xml.sax.SAXException; - import io.quarkus.deployment.Capabilities; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; @@ -43,10 +34,11 @@ import org.apache.camel.quarkus.core.deployment.LanguageExpressionContentHandler import org.apache.camel.quarkus.core.deployment.spi.CamelRoutesBuilderClassBuildItem; import org.apache.camel.quarkus.core.deployment.util.CamelSupport; import org.apache.camel.quarkus.support.common.CamelCapabilities; +import org.apache.camel.spi.Resource; +import org.apache.camel.util.AntPathMatcher; import org.jboss.logging.Logger; public class CSimpleXmlProcessor { - private static final Logger LOG = Logger.getLogger(CSimpleXmlProcessor.class); @BuildStep @@ -55,78 +47,56 @@ public class CSimpleXmlProcessor { List<CamelRoutesBuilderClassBuildItem> routesBuilderClasses, BuildProducer<CSimpleExpressionSourceBuildItem> csimpleExpressions, Capabilities capabilities) - throws ParserConfigurationException, SAXException, IOException { + throws Exception { if (capabilities.isCapabilityPresent(CamelCapabilities.MAIN)) { - final List<String> locations = Stream.of("camel.main.xml-routes", "camel.main.xml-rests") + final String[] includes = Stream.of( + "camel.main.routesIncludePattern", + "camel.main.routes-include-pattern") + .map(prop -> CamelSupport.getOptionalConfigValue(prop, String[].class, new String[0])) + .flatMap(Stream::of) + .filter(path -> !path.equals("false")) + .toArray(String[]::new); + + final String[] excludes = Stream.of( + "camel.main.routesExcludePattern", + "camel.main.routes-exclude-pattern") .map(prop -> CamelSupport.getOptionalConfigValue(prop, String[].class, new String[0])) .flatMap(Stream::of) - .collect(Collectors.toList()); + .filter(path -> !path.equals("false")) + .toArray(String[]::new); try (DefaultPackageScanResourceResolver resolver = new DefaultPackageScanResourceResolver()) { resolver.setCamelContext(new DefaultCamelContext()); + final SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); saxParserFactory.setNamespaceAware(true); - SAXParser saxParser = saxParserFactory.newSAXParser(); - for (String part : locations) { - try { - try (CloseableCollection<InputStream> set = new CloseableCollection<InputStream>( - resolver.findResources(part))) { - for (InputStream is : set) { - LOG.debugf("Found XML routes from location: %s", part); - try { - saxParser.parse( - is, - new LanguageExpressionContentHandler( - "csimple", - (script, isPredicate) -> csimpleExpressions.produce( - new CSimpleExpressionSourceBuildItem( - script, - isPredicate, - "org.apache.camel.language.csimple.XmlRouteBuilder")))); - } finally { - if (is != null) { - is.close(); - } - } - } - } - } catch (FileNotFoundException e) { - LOG.debugf("No XML routes found in %s. Skipping XML routes detection.", part); - } catch (Exception e) { - throw new RuntimeException("Could not analyze CSimple expressions in " + part, e); - } - } - } - } + final SAXParser saxParser = saxParserFactory.newSAXParser(); - } - - static class CloseableCollection<E extends Closeable> implements Closeable, Iterable<E> { - private final Collection<E> delegate; - - public CloseableCollection(Collection<E> delegate) { - this.delegate = delegate; - } + for (String include : includes) { + for (Resource resource : resolver.findResources(include)) { + if (AntPathMatcher.INSTANCE.anyMatch(excludes, resource.getLocation())) { + continue; + } - @Override - public void close() throws IOException { - List<Exception> exceptions = new ArrayList<>(); - for (Closeable closeable : delegate) { - try { - closeable.close(); - } catch (Exception e) { - exceptions.add(e); + try (InputStream is = resource.getInputStream()) { + saxParser.parse( + is, + new LanguageExpressionContentHandler( + "csimple", + (script, isPredicate) -> csimpleExpressions.produce( + new CSimpleExpressionSourceBuildItem( + script, + isPredicate, + "org.apache.camel.language.csimple.XmlRouteBuilder")))); + } catch (FileNotFoundException e) { + LOG.debugf("No XML routes found in %s. Skipping XML routes detection.", resource.getLocation()); + } catch (Exception e) { + throw new RuntimeException("Could not analyze CSimple expressions in " + resource.getLocation(), e); + } + } } } - if (!exceptions.isEmpty()) { - throw new IOException("Could not close a resource", exceptions.get(0)); - } - } - - @Override - public Iterator<E> iterator() { - return delegate.iterator(); } } } diff --git a/extensions/infinispan/deployment/pom.xml b/extensions/infinispan/deployment/pom.xml index 9326010..1beb5a8 100644 --- a/extensions/infinispan/deployment/pom.xml +++ b/extensions/infinispan/deployment/pom.xml @@ -38,10 +38,6 @@ <artifactId>quarkus-jaxb-deployment</artifactId> </dependency> <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-caffeine-deployment</artifactId> - </dependency> - <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-core-deployment</artifactId> </dependency> diff --git a/extensions/infinispan/runtime/pom.xml b/extensions/infinispan/runtime/pom.xml index aa9aea2..1df845e 100644 --- a/extensions/infinispan/runtime/pom.xml +++ b/extensions/infinispan/runtime/pom.xml @@ -58,10 +58,6 @@ <groupId>io.quarkus</groupId> <artifactId>quarkus-jaxb</artifactId> </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-caffeine</artifactId> - </dependency> <dependency> <groupId>org.infinispan</groupId> @@ -87,17 +83,6 @@ </exclusion> </exclusions> </dependency> - - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-caffeine-lrucache</artifactId> - </dependency> - - <dependency> - <groupId>org.graalvm.nativeimage</groupId> - <artifactId>svm</artifactId> - <scope>provided</scope> - </dependency> </dependencies> <build> diff --git a/extensions/infinispan/runtime/src/main/java/org/apache/camel/quarkus/infinispan/runtime/graal/SubstituteDefaultCacheManager.java b/extensions/infinispan/runtime/src/main/java/org/apache/camel/quarkus/infinispan/runtime/graal/SubstituteDefaultCacheManager.java deleted file mode 100644 index 7ed2456..0000000 --- a/extensions/infinispan/runtime/src/main/java/org/apache/camel/quarkus/infinispan/runtime/graal/SubstituteDefaultCacheManager.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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.infinispan.runtime.graal; - -import java.io.IOException; -import java.io.InputStream; - -import com.oracle.svm.core.annotate.Substitute; -import com.oracle.svm.core.annotate.TargetClass; -import org.infinispan.configuration.cache.Configuration; -import org.infinispan.configuration.global.GlobalConfiguration; -import org.infinispan.configuration.parsing.ConfigurationBuilderHolder; -import org.infinispan.manager.DefaultCacheManager; - -@TargetClass(DefaultCacheManager.class) -final class SubstituteDefaultCacheManager { - - @Substitute - public SubstituteDefaultCacheManager() { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(boolean start) { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(Configuration defaultConfiguration) { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(Configuration defaultConfiguration, boolean start) { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(GlobalConfiguration globalConfiguration) { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(GlobalConfiguration globalConfiguration, boolean start) { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(GlobalConfiguration globalConfiguration, - Configuration defaultConfiguration) { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(GlobalConfiguration globalConfiguration, - Configuration defaultConfiguration, - boolean start) { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(String configurationFile) throws IOException { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(String configurationFile, boolean start) throws IOException { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(InputStream configurationStream) throws IOException { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(InputStream configurationStream, boolean start) - throws IOException { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } - - @Substitute - public SubstituteDefaultCacheManager(ConfigurationBuilderHolder holder, boolean start) { - throw new RuntimeException("DefaultCacheManager not supported in native image mode"); - } -} diff --git a/extensions/infinispan/runtime/src/main/java/org/apache/camel/quarkus/infinispan/runtime/graal/SubstituteInfinispanManager.java b/extensions/infinispan/runtime/src/main/java/org/apache/camel/quarkus/infinispan/runtime/graal/SubstituteInfinispanManager.java deleted file mode 100644 index 196dce7..0000000 --- a/extensions/infinispan/runtime/src/main/java/org/apache/camel/quarkus/infinispan/runtime/graal/SubstituteInfinispanManager.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.infinispan.runtime.graal; - -import com.oracle.svm.core.annotate.Alias; -import com.oracle.svm.core.annotate.Substitute; -import com.oracle.svm.core.annotate.TargetClass; -import org.apache.camel.component.infinispan.InfinispanManager; -import org.apache.camel.util.ObjectHelper; -import org.infinispan.commons.api.BasicCache; -import org.infinispan.commons.api.BasicCacheContainer; - -@TargetClass(InfinispanManager.class) -final class SubstituteInfinispanManager { - @Alias - private BasicCacheContainer cacheContainer; - - @Substitute - public <K, V> BasicCache<K, V> getCache(String cacheName) { - return ObjectHelper.isEmpty(cacheName) ? cacheContainer.getCache() : cacheContainer.getCache(cacheName); - } -} diff --git a/extensions/qute/component/src/generated/java/org/apache/camel/component/qute/QuteEndpointConfigurer.java b/extensions/qute/component/src/generated/java/org/apache/camel/component/qute/QuteEndpointConfigurer.java index ff14a7c..015d6e0 100644 --- a/extensions/qute/component/src/generated/java/org/apache/camel/component/qute/QuteEndpointConfigurer.java +++ b/extensions/qute/component/src/generated/java/org/apache/camel/component/qute/QuteEndpointConfigurer.java @@ -30,7 +30,6 @@ public class QuteEndpointConfigurer extends PropertyConfigurerSupport implements case "encoding": target.setEncoding(property(camelContext, java.lang.String.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; - case "synchronous": target.setSynchronous(property(camelContext, boolean.class, value)); return true; default: return false; } } @@ -47,7 +46,6 @@ public class QuteEndpointConfigurer extends PropertyConfigurerSupport implements case "encoding": return java.lang.String.class; case "lazystartproducer": case "lazyStartProducer": return boolean.class; - case "synchronous": return boolean.class; default: return null; } } @@ -65,7 +63,6 @@ public class QuteEndpointConfigurer extends PropertyConfigurerSupport implements case "encoding": return target.getEncoding(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); - case "synchronous": return target.isSynchronous(); default: return null; } } diff --git a/extensions/qute/component/src/generated/java/org/apache/camel/component/qute/QuteEndpointUriFactory.java b/extensions/qute/component/src/generated/java/org/apache/camel/component/qute/QuteEndpointUriFactory.java index 3ab0ef8..46cc173 100644 --- a/extensions/qute/component/src/generated/java/org/apache/camel/component/qute/QuteEndpointUriFactory.java +++ b/extensions/qute/component/src/generated/java/org/apache/camel/component/qute/QuteEndpointUriFactory.java @@ -20,10 +20,9 @@ public class QuteEndpointUriFactory extends org.apache.camel.support.component.E private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; static { - Set<String> props = new HashSet<>(7); + Set<String> props = new HashSet<>(6); props.add("allowTemplateFromHeader"); props.add("lazyStartProducer"); - props.add("synchronous"); props.add("contentCache"); props.add("allowContextMapAll"); props.add("resourceUri"); diff --git a/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json b/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json index 843e553..8ba71f3 100644 --- a/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json +++ b/extensions/qute/component/src/generated/resources/org/apache/camel/component/qute/qute.json @@ -33,7 +33,6 @@ "allowTemplateFromHeader": { "kind": "parameter", "displayName": "Allow Template From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow to use resource template from header or not (default false). Enabling this allows to specify dynamic templates via message header. However this can be seen as a potential security vuln [...] "contentCache": { "kind": "parameter", "displayName": "Content Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether to use resource content cache or not" }, "encoding": { "kind": "parameter", "displayName": "Encoding", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Character encoding of the resource content." }, - "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...] - "synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported)." } + "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...] } } diff --git a/extensions/ssh/deployment/src/main/java/org/apache/camel/quarkus/component/ssh/deployment/SshProcessor.java b/extensions/ssh/deployment/src/main/java/org/apache/camel/quarkus/component/ssh/deployment/SshProcessor.java index 4b2b9df..aed141b 100644 --- a/extensions/ssh/deployment/src/main/java/org/apache/camel/quarkus/component/ssh/deployment/SshProcessor.java +++ b/extensions/ssh/deployment/src/main/java/org/apache/camel/quarkus/component/ssh/deployment/SshProcessor.java @@ -30,12 +30,10 @@ import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; -import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; import org.apache.sshd.common.channel.ChannelListener; import org.apache.sshd.common.forward.PortForwardingEventListener; import org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory; import org.apache.sshd.common.session.SessionListener; -import org.apache.sshd.common.util.security.eddsa.EdDSASecurityProviderUtils; class SshProcessor { @@ -47,11 +45,6 @@ class SshProcessor { } @BuildStep - RuntimeInitializedClassBuildItem delayEdDSAConfiguration() { - return new RuntimeInitializedClassBuildItem(EdDSASecurityProviderUtils.class.getName()); - } - - @BuildStep void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses) { reflectiveClasses.produce( new ReflectiveClassBuildItem( diff --git a/extensions/ssh/runtime/pom.xml b/extensions/ssh/runtime/pom.xml index 83a191a..6089844 100644 --- a/extensions/ssh/runtime/pom.xml +++ b/extensions/ssh/runtime/pom.xml @@ -60,6 +60,12 @@ <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-support-bouncycastle</artifactId> </dependency> + <!-- TODO: Remove this as it's an optional dependency --> + <!-- https://github.com/apache/camel-quarkus/issues/2212 --> + <dependency> + <groupId>net.i2p.crypto</groupId> + <artifactId>eddsa</artifactId> + </dependency> <dependency> <groupId>org.graalvm.nativeimage</groupId> <artifactId>svm</artifactId> diff --git a/integration-tests-support/azure/src/main/java/org/apache/camel/quarkus/test/support/azure/AzureStorageTestResource.java b/integration-tests-support/azure/src/main/java/org/apache/camel/quarkus/test/support/azure/AzureStorageTestResource.java index c837f78..75b76ca 100644 --- a/integration-tests-support/azure/src/main/java/org/apache/camel/quarkus/test/support/azure/AzureStorageTestResource.java +++ b/integration-tests-support/azure/src/main/java/org/apache/camel/quarkus/test/support/azure/AzureStorageTestResource.java @@ -33,7 +33,7 @@ import org.testcontainers.containers.wait.strategy.Wait; public class AzureStorageTestResource implements QuarkusTestResourceLifecycleManager { private static final Logger LOGGER = LoggerFactory.getLogger(AzureStorageTestResource.class); - private static final String AZURITE_IMAGE = "mcr.microsoft.com/azure-storage/azurite:3.9.0"; + private static final String AZURITE_IMAGE = "mcr.microsoft.com/azure-storage/azurite:3.10.0"; private static final int BLOB_SERVICE_PORT = 10000; private static final int QUEUE_SERVICE_PORT = 10001; diff --git a/integration-tests-support/custom-routes-collector/runtime/src/main/java/org/apache/camel/quarkus/main/runtime/support/CustomRoutesCollector.java b/integration-tests-support/custom-routes-collector/runtime/src/main/java/org/apache/camel/quarkus/main/runtime/support/CustomRoutesCollector.java index 34f58be..f87c704 100644 --- a/integration-tests-support/custom-routes-collector/runtime/src/main/java/org/apache/camel/quarkus/main/runtime/support/CustomRoutesCollector.java +++ b/integration-tests-support/custom-routes-collector/runtime/src/main/java/org/apache/camel/quarkus/main/runtime/support/CustomRoutesCollector.java @@ -16,15 +16,13 @@ */ package org.apache.camel.quarkus.main.runtime.support; +import java.util.Collection; import java.util.Collections; import java.util.List; import org.apache.camel.CamelContext; import org.apache.camel.RoutesBuilder; import org.apache.camel.main.RoutesCollector; -import org.apache.camel.model.RouteTemplatesDefinition; -import org.apache.camel.model.RoutesDefinition; -import org.apache.camel.model.rest.RestsDefinition; public class CustomRoutesCollector implements RoutesCollector { @Override @@ -36,18 +34,10 @@ public class CustomRoutesCollector implements RoutesCollector { } @Override - public List<RoutesDefinition> collectXmlRoutesFromDirectory(CamelContext camelContext, String directory) throws Exception { - return Collections.emptyList(); - } - - @Override - public List<RouteTemplatesDefinition> collectXmlRouteTemplatesFromDirectory(CamelContext camelContext, String directory) - throws Exception { - return Collections.emptyList(); - } - - @Override - public List<RestsDefinition> collectXmlRestsFromDirectory(CamelContext camelContext, String directory) throws Exception { + public Collection<RoutesBuilder> collectRoutesFromDirectory( + CamelContext camelContext, + String excludePattern, + String includePattern) { return Collections.emptyList(); } } diff --git a/integration-tests/csimple/src/main/resources/application.properties b/integration-tests/csimple/src/main/resources/application.properties index 0ee16d9..5a35e45 100644 --- a/integration-tests/csimple/src/main/resources/application.properties +++ b/integration-tests/csimple/src/main/resources/application.properties @@ -15,4 +15,4 @@ ## limitations under the License. ## --------------------------------------------------------------------------- -camel.main.xml-routes = classpath:routes/my-routes.xml +camel.main.routes-include-pattern = classpath:routes/my-routes.xml diff --git a/integration-tests/dataformats-json/src/main/resources/application.properties b/integration-tests/dataformats-json/src/main/resources/application.properties index 1767f72..f928ec0 100644 --- a/integration-tests/dataformats-json/src/main/resources/application.properties +++ b/integration-tests/dataformats-json/src/main/resources/application.properties @@ -27,4 +27,4 @@ camel.context.name = camel-quarkus-integration-tests-dataformats-json # # Main # -camel.main.xml-routes = classpath:routes/jsonb-routes.xml,classpath:routes/jackson-routes.xml,classpath:routes/johnzon-routes.xml,classpath:routes/gson-routes.xml +camel.main.routes-include-pattern = classpath:routes/jsonb-routes.xml,classpath:routes/jackson-routes.xml,classpath:routes/johnzon-routes.xml,classpath:routes/gson-routes.xml diff --git a/integration-tests/hazelcast/src/test/java/org/apache/camel/quarkus/component/hazelcast/it/HazelcastQueueTest.java b/integration-tests/hazelcast/src/test/java/org/apache/camel/quarkus/component/hazelcast/it/HazelcastQueueTest.java index b8ad960..3410a99 100644 --- a/integration-tests/hazelcast/src/test/java/org/apache/camel/quarkus/component/hazelcast/it/HazelcastQueueTest.java +++ b/integration-tests/hazelcast/src/test/java/org/apache/camel/quarkus/component/hazelcast/it/HazelcastQueueTest.java @@ -25,7 +25,6 @@ import io.quarkus.test.common.http.TestHTTPEndpoint; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static io.restassured.RestAssured.given; @@ -144,7 +143,6 @@ public class HazelcastQueueTest { @SuppressWarnings("unchecked") @Test - @Disabled public void testPollConsumer() { // add all values given() diff --git a/integration-tests/main-devmode/pom.xml b/integration-tests/main-devmode/pom.xml index c496a90..6e562dd 100644 --- a/integration-tests/main-devmode/pom.xml +++ b/integration-tests/main-devmode/pom.xml @@ -161,6 +161,18 @@ </exclusions> </dependency> </dependencies> - + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <systemPropertyVariables> + <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> + </systemPropertyVariables> + </configuration> + </plugin> + </plugins> + </build> </project> diff --git a/integration-tests/main-devmode/src/test/java/org/apache/camel/quarkus/main/CamelDevModeTest.java b/integration-tests/main-devmode/src/test/java/org/apache/camel/quarkus/main/CamelDevModeTest.java index 5257d4c..80303e9 100644 --- a/integration-tests/main-devmode/src/test/java/org/apache/camel/quarkus/main/CamelDevModeTest.java +++ b/integration-tests/main-devmode/src/test/java/org/apache/camel/quarkus/main/CamelDevModeTest.java @@ -74,7 +74,7 @@ public class CamelDevModeTest { Properties props = new Properties(); props.setProperty("quarkus.banner.enabled", "false"); - props.setProperty("camel.main.xml-routes", "file:" + BASE.toAbsolutePath().toString() + "/routes.xml"); + props.setProperty("camel.main.routes-include-pattern", "file:" + BASE.toAbsolutePath().toString() + "/routes.xml"); try { props.store(writer, ""); diff --git a/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java index 75a3014..54b3dee 100644 --- a/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java +++ b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java @@ -21,7 +21,6 @@ import javax.inject.Inject; import javax.json.Json; import javax.json.JsonArrayBuilder; import javax.json.JsonObject; -import javax.json.JsonObjectBuilder; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -32,6 +31,8 @@ import javax.ws.rs.core.MediaType; import org.apache.camel.ExtendedCamelContext; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.TemplatedRouteBuilder; +import org.apache.camel.spi.RoutesBuilderLoader; +import org.apache.camel.xml.in.XmlRoutesBuilderLoader; @Path("/test") @ApplicationScoped @@ -63,23 +64,15 @@ public class CoreMainXmlIoResource { JsonArrayBuilder routes = Json.createArrayBuilder(); main.getCamelContext().getRoutes().forEach(route -> routes.add(route.getId())); - JsonObjectBuilder collector = Json.createObjectBuilder(); - collector.add("type", main.getRoutesCollector().getClass().getName()); - if (main.getRoutesCollector() instanceof CamelMainRoutesCollector) { - CamelMainRoutesCollector crc = (CamelMainRoutesCollector) main.getRoutesCollector(); - collector.add("type-registry", crc.getRegistryRoutesLoader().getClass().getName()); - collector.add("type-xml", camelContext.getXMLRoutesDefinitionLoader().getClass().getName()); - } - return Json.createObjectBuilder() - .add("xml-loader", camelContext.getXMLRoutesDefinitionLoader().getClass().getName()) + .add("xml-routes-definitions-loader", camelContext.getXMLRoutesDefinitionLoader().getClass().getName()) + .add("xml-routes-builder-loader", + camelContext.getBootstrapFactoryFinder(RoutesBuilderLoader.FACTORY_PATH) + .findClass(XmlRoutesBuilderLoader.EXTENSION).get().getName()) .add("xml-model-dumper", camelContext.getModelToXMLDumper().getClass().getName()) .add("xml-model-factory", camelContext.getModelJAXBContextFactory().getClass().getName()) - .add("routes-collector", collector) - .add("listeners", listeners) .add("routeBuilders", routeBuilders) .add("routes", routes) - .add("autoConfigurationLogSummary", main.getMainConfigurationProperties().isAutoConfigurationLogSummary()) .build(); } diff --git a/integration-tests/main-xml-io/src/main/resources/application.properties b/integration-tests/main-xml-io/src/main/resources/application.properties index de06ddb..e9d12eb 100644 --- a/integration-tests/main-xml-io/src/main/resources/application.properties +++ b/integration-tests/main-xml-io/src/main/resources/application.properties @@ -28,6 +28,4 @@ camel.rest.component = platform-http # # Main # -camel.main.xml-routes = classpath:routes/my-routes.xml -camel.main.xml-rests = classpath:rests/my-rests.xml -camel.main.xml-route-templates = classpath:templates/my-templates.xml +camel.main.routes-include-pattern = classpath:routes/my-routes.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml diff --git a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java index 9a6fd6f..239e9b1 100644 --- a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java +++ b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java @@ -27,6 +27,7 @@ import io.restassured.path.json.JsonPath; import org.apache.camel.quarkus.core.DisabledModelJAXBContextFactory; import org.apache.camel.quarkus.core.DisabledModelToXMLDumper; import org.apache.camel.xml.in.ModelParserXMLRoutesDefinitionLoader; +import org.apache.camel.xml.in.XmlRoutesBuilderLoader; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -45,10 +46,14 @@ public class CoreMainXmlIoTest { .body() .jsonPath(); - assertThat(p.getString("xml-loader")).isEqualTo(ModelParserXMLRoutesDefinitionLoader.class.getName()); assertThat(p.getString("xml-model-dumper")).isEqualTo(DisabledModelToXMLDumper.class.getName()); assertThat(p.getString("xml-model-factory")).isEqualTo(DisabledModelJAXBContextFactory.class.getName()); + assertThat(p.getString("xml-routes-definitions-loader")) + .isEqualTo(ModelParserXMLRoutesDefinitionLoader.class.getName()); + assertThat(p.getString("xml-routes-builder-loader")) + .isEqualTo(XmlRoutesBuilderLoader.class.getName()); + assertThat(p.getList("routeBuilders", String.class)) .isEmpty(); diff --git a/integration-tests/main-xml-jaxb/pom.xml b/integration-tests/main-xml-jaxb/pom.xml index ec0955a..2f0bae0 100644 --- a/integration-tests/main-xml-jaxb/pom.xml +++ b/integration-tests/main-xml-jaxb/pom.xml @@ -36,11 +36,11 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-xml-io</artifactId> + <artifactId>camel-quarkus-xml-jaxb</artifactId> </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-xml-jaxb</artifactId> + <artifactId>camel-quarkus-xml-io</artifactId> </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> diff --git a/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbResource.java b/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbResource.java index dab9cf1..9645e7b 100644 --- a/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbResource.java +++ b/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbResource.java @@ -21,7 +21,6 @@ import javax.inject.Inject; import javax.json.Json; import javax.json.JsonArrayBuilder; import javax.json.JsonObject; -import javax.json.JsonObjectBuilder; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -29,6 +28,8 @@ import javax.ws.rs.core.MediaType; import org.apache.camel.ExtendedCamelContext; import org.apache.camel.builder.TemplatedRouteBuilder; +import org.apache.camel.spi.RoutesBuilderLoader; +import org.apache.camel.xml.in.XmlRoutesBuilderLoader; @Path("/test") @ApplicationScoped @@ -57,23 +58,15 @@ public class CoreMainXmlJaxbResource { JsonArrayBuilder routes = Json.createArrayBuilder(); main.getCamelContext().getRoutes().forEach(route -> routes.add(route.getId())); - JsonObjectBuilder collector = Json.createObjectBuilder(); - collector.add("type", main.getRoutesCollector().getClass().getName()); - if (main.getRoutesCollector() instanceof CamelMainRoutesCollector) { - CamelMainRoutesCollector crc = (CamelMainRoutesCollector) main.getRoutesCollector(); - collector.add("type-registry", crc.getRegistryRoutesLoader().getClass().getName()); - collector.add("type-xml", camelContext.getXMLRoutesDefinitionLoader().getClass().getName()); - } - return Json.createObjectBuilder() - .add("xml-loader", camelContext.getXMLRoutesDefinitionLoader().getClass().getName()) + .add("xml-routes-definitions-loader", camelContext.getXMLRoutesDefinitionLoader().getClass().getName()) + .add("xml-routes-builder-loader", + camelContext.getBootstrapFactoryFinder(RoutesBuilderLoader.FACTORY_PATH) + .findClass(XmlRoutesBuilderLoader.EXTENSION).get().getName()) .add("xml-model-dumper", camelContext.getModelToXMLDumper().getClass().getName()) .add("xml-model-factory", camelContext.getModelJAXBContextFactory().getClass().getName()) - .add("routes-collector", collector) - .add("listeners", listeners) .add("routeBuilders", routeBuilders) .add("routes", routes) - .add("autoConfigurationLogSummary", main.getMainConfigurationProperties().isAutoConfigurationLogSummary()) .build(); } } diff --git a/integration-tests/main-xml-jaxb/src/main/resources/application.properties b/integration-tests/main-xml-jaxb/src/main/resources/application.properties index de06ddb..e9d12eb 100644 --- a/integration-tests/main-xml-jaxb/src/main/resources/application.properties +++ b/integration-tests/main-xml-jaxb/src/main/resources/application.properties @@ -28,6 +28,4 @@ camel.rest.component = platform-http # # Main # -camel.main.xml-routes = classpath:routes/my-routes.xml -camel.main.xml-rests = classpath:rests/my-rests.xml -camel.main.xml-route-templates = classpath:templates/my-templates.xml +camel.main.routes-include-pattern = classpath:routes/my-routes.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml diff --git a/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java b/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java index f5f6b24..a1accb2 100644 --- a/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java +++ b/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java @@ -24,6 +24,8 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.path.json.JsonPath; import org.apache.camel.xml.in.ModelParserXMLRoutesDefinitionLoader; +import org.apache.camel.xml.in.XmlRoutesBuilderLoader; +import org.apache.camel.xml.jaxb.DefaultModelJAXBContextFactory; import org.apache.camel.xml.jaxb.JaxbModelToXMLDumper; import org.junit.jupiter.api.Test; @@ -42,9 +44,13 @@ public class CoreMainXmlJaxbTest { .body() .jsonPath(); - assertThat(p.getString("xml-loader")).isEqualTo(ModelParserXMLRoutesDefinitionLoader.class.getName()); assertThat(p.getString("xml-model-dumper")).isEqualTo(JaxbModelToXMLDumper.class.getName()); - assertThat(p.getString("xml-model-factory")).isEqualTo("org.apache.camel.xml.jaxb.DefaultModelJAXBContextFactory"); + assertThat(p.getString("xml-model-factory")).isEqualTo(DefaultModelJAXBContextFactory.class.getName()); + + assertThat(p.getString("xml-routes-definitions-loader")) + .isEqualTo(ModelParserXMLRoutesDefinitionLoader.class.getName()); + assertThat(p.getString("xml-routes-builder-loader")) + .isEqualTo(XmlRoutesBuilderLoader.class.getName()); assertThat(p.getList("routeBuilders", String.class)) .isEmpty(); diff --git a/pom.xml b/pom.xml index fa6a71a..f355dcc 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ <parent> <groupId>org.apache.camel</groupId> <artifactId>camel-dependencies</artifactId> - <version>3.7.0</version> + <version>3.8.0</version> </parent> <groupId>org.apache.camel.quarkus</groupId> @@ -45,7 +45,7 @@ <aws-java-sdk.version>${aws-java-sdk-version}</aws-java-sdk.version> <awssdk1-swf-libs.version>${aws-java-sdk-swf-libs}</awssdk1-swf-libs.version> <!-- TODO: Use azure-sdk-bom once they start maintaining it properly https://github.com/Azure/azure-sdk-for-java/issues/18759 --> - <azure-core.version>1.8.1</azure-core.version><!-- keep compatible with the azure artifacts below --> + <azure-core.version>1.12.0</azure-core.version><!-- keep compatible with the azure artifacts below --> <azure-sdk-bom.version>1.0.1</azure-sdk-bom.version> <azure-storage-blob-java-sdk12.version>${azure-storage-blob-java-sdk12-version}</azure-storage-blob-java-sdk12.version> <azure-storage-queue-java-sdk12.version>${azure-storage-queue-java-sdk12-version}</azure-storage-queue-java-sdk12.version> @@ -54,8 +54,8 @@ <bouncycastle.version>${bouncycastle-version}</bouncycastle.version><!-- keep in sync with Camel --> - <camel.major.minor>3.7</camel.major.minor> <!-- run after each change: cd docs && mvndev validate --> - <camel.version>${camel.major.minor}.1</camel.version> + <camel.major.minor>3.8</camel.major.minor> <!-- run after each change: cd docs && mvndev validate --> + <camel.version>${camel.major.minor}.0</camel.version> <camel.docs.components.xref>${camel.major.minor}.x@components</camel.docs.components.xref><!-- the version in Camel's docs/components/antora.yml --> <camel.docs.branch>camel-${camel.major.minor}.x</camel.docs.branch><!-- The stable branch on which our Antora docs depends --> @@ -67,6 +67,7 @@ <curator.version>4.3.0</curator.version><!-- Mess in the transitive dependencies of Spark, Zookeeper and other hadoop related components --> <debezium.version>1.4.0.Final</debezium.version> <derby.version>10.15.2.0</derby.version><!-- Spark --> + <eddsa.version>0.3.0</eddsa.version> <freemarker.version>2.3.30</freemarker.version> <fommil.netlib.core.version>1.1.2</fommil.netlib.core.version><!-- Mess in Weka transitive deps --> <jodatime.version>2.10.6</jodatime.version><!-- Mess in transitive dependencies of Spark and Splunk --> @@ -89,7 +90,7 @@ <jaxen.version>1.2.0</jaxen.version> <javassist.version>3.22.0-CR2</javassist.version><!-- debezium --> <jersey-sun.version>1.19.4</jersey-sun.version><!-- Spark --> - <jetty.version>9.4.18.v20190429</jetty.version> + <jetty.version>${jetty9-version}</jetty.version> <jnr-ffi.version>2.1.2</jnr-ffi.version><!-- Mess in web3j transitive deps --> <kafka.version>2.5.0</kafka.version> <kudu.version>${kudu-version}</kudu.version><!-- keep in sync with Camel --> @@ -136,7 +137,7 @@ <mock-javamail.version>${mock-javamail-version}</mock-javamail.version> <pdfbox.version>${pdfbox-version}</pdfbox.version> <slf4j-log4j12.version>1.7.30</slf4j-log4j12.version><!-- Mess in the transitive dependencies of hbase-testing-util --> - <sshd.version>2.3.0</sshd.version> + <sshd.version>${sshd-version}</sshd.version> <stax2.version>4.2</stax2.version> <testcontainers.version>1.15.1</testcontainers.version> <wiremock.version>2.27.2</wiremock.version> diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml index 0398382..e166e8c 100644 --- a/poms/bom/pom.xml +++ b/poms/bom/pom.xml @@ -5809,6 +5809,11 @@ <version>${jodatime.version}</version> </dependency> <dependency> + <groupId>net.i2p.crypto</groupId> + <artifactId>eddsa</artifactId> + <version>${eddsa.version}</version> + </dependency> + <dependency> <groupId>org.antlr</groupId> <artifactId>antlr</artifactId> <version>${antlr3.version}</version>