Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Quarkus to 2.8.0.CR1 + Upgrade Camel to 3.16.0 #3653

Merged
merged 10 commits into from
Mar 24, 2022
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
**Merged pull requests:**

- Avoid compiling regular expressions in loops [\#3649](https://github.com/apache/camel-quarkus/pull/3649) ([ppalaga](https://github.com/ppalaga))
- Switch from `NativeImageTest` to `QuarkusIntegrationTest` [\#3648](https://github.com/apache/camel-quarkus/pull/3648) ([jamesnetherton](https://github.com/jamesnetherton))
- Switch from `QuarkusIntegrationTest` to `QuarkusIntegrationTest` [\#3648](https://github.com/apache/camel-quarkus/pull/3648) ([jamesnetherton](https://github.com/jamesnetherton))
- file: Ensure FileTest.charset is fixed under Windows \#3530 [\#3647](https://github.com/apache/camel-quarkus/pull/3647) ([aldettinger](https://github.com/aldettinger))
- Tidy geronimo-jms\_2.0\_spec exclusions [\#3646](https://github.com/apache/camel-quarkus/pull/3646) ([ppalaga](https://github.com/ppalaga))
- file: Rewrite the charset related test \#3627 [\#3645](https://github.com/apache/camel-quarkus/pull/3645) ([aldettinger](https://github.com/aldettinger))
Expand Down
12 changes: 6 additions & 6 deletions docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ asciidoc:

min-maven-version: 3.8.1 # replace ${min-maven-version}
target-maven-version: 3.8.4 # replace ${target-maven-version}
camel-version: 3.15.0 # replace ${camel.version}
camel-docs-version: 3.15.x # replace ${camel.docs.components.version}
quarkus-version: 2.7.5.Final # replace ${quarkus.version}
graalvm-version: 21.3.1 # replace ${graalvm.version}
graalvm-docs-version: 21.3
camel-version: 3.15.0
camel-docs-version: 3.15.x
quarkus-version: 2.8.0.CR1 # replace ${quarkus.version}
graalvm-version: 22.0.0.2 # replace ${graalvm.version}
graalvm-docs-version: 22.0
# attributes used in xrefs to other Antora components
cq-camel-components: 3.15.x@components # replace ${camel.docs.components.xref}
cq-camel-components: 3.15.x@components
quarkus-examples-version: latest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cqArtifactId: camel-quarkus-elasticsearch-rest
cqArtifactIdBase: elasticsearch-rest
cqNativeSupported: true
cqStatus: Stable
cqDeprecated: false
cqDeprecated: true
cqJvmSince: 1.0.0
cqNativeSince: 1.0.0
cqCamelPartName: elasticsearch-rest
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/dataformats/ical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ cqJvmSince: 1.0.0
cqNativeSince: 1.0.0
cqCamelPartName: ical
cqCamelPartTitle: iCal
cqCamelPartDescription: Marshal and unmarshal iCal (.ics) documents to/from model objects provided by the iCal4j library.
cqCamelPartDescription: Marshal and unmarshal iCal (.ics) documents to/from model objects.
cqExtensionPageTitle: iCal
2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/dataformats/jacksonXml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ cqJvmSince: 1.0.0
cqNativeSince: 1.0.0
cqCamelPartName: jacksonXml
cqCamelPartTitle: Jackson XML
cqCamelPartDescription: Unmarshal a XML payloads to POJOs and back using XMLMapper extension of Jackson.
cqCamelPartDescription: Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson.
cqExtensionPageTitle: JacksonXML
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/migration-guide/2.8.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following guide outlines how to adapt your code to changes that were made in

In previous releases, the FHIR extension default was to enable support for all FHIR versions.

This has now changed. Only the FHIR versions that the Camel FHIR component and DataFormat use by default are enabled (R4 & DSTU3).
This has now changed. Only the FHIR version that the Camel FHIR component and DataFormat use by default are enabled (R4).

To enable or disable support for the various FHIR versions, you can add some configuration properties to `application.properties`. For example.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
:cq-artifact-id: camel-quarkus-elasticsearch-rest
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-status-deprecation: Stable Deprecated
:cq-description: Send requests to ElasticSearch via REST API
:cq-deprecated: false
:cq-deprecated: true
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0

[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0## [.badge-key]##⚠️##[.badge-unsupported]##Deprecated##

Send requests to ElasticSearch via REST API

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/reference/extensions/fhir.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Enable FHIR DSTU2_1 Specs in native mode.

Enable FHIR DSTU3 Specs in native mode.
| `boolean`
| `true`
| `false`

|icon:lock[title=Fixed at build time] [[quarkus.camel.fhir.enable-r4]]`link:#quarkus.camel.fhir.enable-r4[quarkus.camel.fhir.enable-r4]`

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/reference/extensions/ical.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Marshal and unmarshal iCal (.ics) documents to/from model objects provided by the iCal4j library.
:cq-description: Marshal and unmarshal iCal (.ics) documents to/from model objects.
:cq-deprecated: false
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0

[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##

Marshal and unmarshal iCal (.ics) documents to/from model objects provided by the iCal4j library.
Marshal and unmarshal iCal (.ics) documents to/from model objects.

== What's inside

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/reference/extensions/jacksonxml.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Unmarshal a XML payloads to POJOs and back using XMLMapper extension of Jackson.
:cq-description: Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson.
:cq-deprecated: false
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0

[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##

Unmarshal a XML payloads to POJOs and back using XMLMapper extension of Jackson.
Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson.

== What's inside

Expand Down
58 changes: 58 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/quartz.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,61 @@ Or add the coordinates to your existing project:
----

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== Usage

=== Clustering

There are two options how to run Quartz in clustered mode:

==== Quarkus based

This is the preferred option. Follow the https://quarkus.io/guides/quartz[scheduling periodic tasks quartz guide].

- Define database configuration in `application.properties`.
- Use for example `flyway` to create database tables required for `Quartz`.

===== Quartz based with an Agroal datasource

Follow the http://www.quartz-scheduler.org/documentation/quartz-1.8.6/configuration/ConfigJDBCJobStoreClustering.html#configure-clustering-with-jdbc-jobstore[Configure Clustering with JDBC-JobStore Guide] with different DS configuration:

- Use `quartz.properties` to configure `JobStore`.
- Define datasource via quarkus (see the https://quarkus.io/guides/datasource[Quarkus datasource documentation)] and use `CamelQuarkusQuartzConnectionProvider` as `ConnectionProvider` in `quartz.properties`:

```
...
org.quartz.jobStore.dataSource = myDS

# datasource configuration
org.quartz.dataSource.myDS.connectionProvider.class = org.apache.camel.quarkus.component.quartz.CamelQuarkusQuartzConnectionProvider
org.quartz.dataSource.myDSB.dataSourceName = ds_name_if_not_set_default_ds_will_be_used
```


- You can use for example `flyway` to create database tables required for `Quartz`.

===== Quartz based

You can follow the http://www.quartz-scheduler.org/documentation/quartz-1.8.6/configuration/ConfigJDBCJobStoreClustering.html#configure-clustering-with-jdbc-jobstore[Configure Clustering with JDBC-JobStore Guide] without any modification:

```
...
org.quartz.jobStore.dataSource = myDS

# datasource configuration
org.quartz.dataSource.myDS.driver = org.postgresql.Driver

# datasource configuration
org.quartz.dataSource.myDS.URL=jdbc:postgresql://localhost:5432/default
org.quartz.dataSource.myDS.user = quarkus
org.quartz.dataSource.myDS.password = quarkus
```


== Camel Quarkus limitations

=== JDBC Job Store

Quartz's property `org.quartz.jobStore.useProperties` is set to `true` and can not be modified. The value is forced by the Quarkus Quartz extension.
See the Quartz documentation for more information about `org.quartz.jobStore.useProperties`.

6 changes: 0 additions & 6 deletions docs/modules/ROOT/pages/reference/extensions/yaml-dsl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

An YAML stack for parsing YAML route definitions

== What's inside

* xref:{cq-camel-components}:others:yaml-dsl.adoc[YAML DSL]

Please refer to the above link for usage and configuration details.

== Maven coordinates

https://code.quarkus.io/?extension-search=camel-quarkus-yaml-dsl[Create a new project with this extension on code.quarkus.io, window="_blank"]
Expand Down
6 changes: 2 additions & 4 deletions docs/modules/ROOT/pages/user-guide/defining-camel-routes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,8 @@ The route XML should be in the simplified version like:
----
<rests xmlns="http://camel.apache.org/schema/spring">
<rest id="greeting" path="/greeting">
<get uri="/hello">
<setBody>
<constant>Hello World!</constant>
</setBody>
<get path="/hello">
<to uri="direct:greet"/>
</get>
</rest>
</rests>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ metadata:
- "integration"
status:
- "stable"
- "deprecated"
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class FhirConfig {
/**
* Enable FHIR DSTU3 Specs in native mode.
*/
@ConfigItem(name = "enable-dstu3", defaultValue = "true")
@ConfigItem(name = "enable-dstu3", defaultValue = "false")
public boolean enableDstu3;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static final class Dstu3Enabled implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
return ConfigProvider.getConfig().getOptionalValue("quarkus.camel.fhir.enable-dstu3", Boolean.class)
.orElse(Boolean.TRUE);
.orElse(Boolean.FALSE);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#
---
name: "Camel iCal"
description: "Marshal and unmarshal iCal (.ics) documents to/from model objects provided by the iCal4j library"
description: "Marshal and unmarshal iCal (.ics) documents to/from model objects"
metadata:
guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/ical.html"
categories:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#
---
name: "Camel JacksonXML"
description: "Unmarshal a XML payloads to POJOs and back using XMLMapper extension of Jackson"
description: "Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson"
metadata:
guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/jacksonxml.html"
categories:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,38 @@
*/
package org.apache.camel.quarkus.component.kafka.deployment;

import java.util.Collection;
import java.util.Optional;
import java.util.stream.Stream;

import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.deployment.Capabilities;
import io.quarkus.deployment.Capability;
import io.quarkus.deployment.IsNormal;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.DevServicesLauncherConfigResultBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.RunTimeConfigurationDefaultBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.dev.devservices.GlobalDevServicesConfig;
import io.quarkus.kafka.client.deployment.KafkaBuildTimeConfig;
import org.apache.camel.quarkus.component.kafka.KafkaClientFactoryProducer;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.ConfigProvider;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
import org.jboss.jandex.IndexView;

class KafkaProcessor {
private static final String FEATURE = "camel-kafka";
private static final String CAMEL_KAFKA_BROKERS = "camel.component.kafka.brokers";
private static final String KAFKA_BOOTSTRAP_SERVERS = "kafka.bootstrap.servers";
private static final DotName[] KAFKA_CLIENTS_TYPES = {
DotName.createSimple("org.apache.kafka.clients.producer.Producer"),
DotName.createSimple("org.apache.kafka.clients.consumer.Consumer")
};

@BuildStep
FeatureBuildItem feature() {
Expand Down Expand Up @@ -68,4 +79,19 @@ public void configureKafkaComponentForDevServices(
}
}
}

@BuildStep
public void reflectiveClasses(CombinedIndexBuildItem combinedIndex,
BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
IndexView index = combinedIndex.getIndex();

Stream.of(KAFKA_CLIENTS_TYPES)
.map(index::getAllKnownImplementors)
.flatMap(Collection::stream)
.map(ClassInfo::toString)
.forEach(name -> reflectiveClass.produce(new ReflectiveClassBuildItem(false, true, name)));

reflectiveClass
.produce(new ReflectiveClassBuildItem(false, true, "org.apache.kafka.clients.producer.internals.Sender"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.apache.camel.health.HealthCheckRegistry;
import org.apache.camel.health.HealthCheckRepository;
import org.apache.camel.impl.health.ConsumersHealthCheckRepository;
import org.apache.camel.impl.health.ContextHealthCheck;
import org.apache.camel.impl.health.HealthCheckRegistryRepository;
import org.apache.camel.impl.health.RoutesHealthCheckRepository;
import org.apache.camel.quarkus.component.microprofile.health.runtime.CamelMicroProfileHealthConfig;
Expand Down Expand Up @@ -118,10 +117,6 @@ List<CamelBeanBuildItem> camelHealthDiscovery(CombinedIndexBuildItem combinedInd
return false;
}

if (className.equals(ContextHealthCheck.class.getName())) {
return config.getOptionalValue("camel.health.contextEnabled", boolean.class).orElse(true);
}

if (className.equals(RoutesHealthCheckRepository.class.getName())) {
return config.getOptionalValue("camel.health.routesEnabled", boolean.class).orElse(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand All @@ -54,7 +55,6 @@ public static final Asset applicationProperties() {
Writer writer = new StringWriter();

Properties props = new Properties();
props.put("camel.health.contextEnabled", "false");
props.put("camel.health.routesEnabled", "false");
props.put("camel.health.consumersEnabled", "false");
props.put("camel.health.registryEnabled", "false");
Expand All @@ -69,9 +69,9 @@ public static final Asset applicationProperties() {
}

@Test
public void contextHealthCheckNull() {
public void contextHealthCheckNotNull() {
ContextHealthCheck contextHealthCheck = context.getRegistry().lookupByNameAndType("context", ContextHealthCheck.class);
assertNull(contextHealthCheck);
assertNotNull(contextHealthCheck);
}

@Test
Expand Down
5 changes: 5 additions & 0 deletions extensions/openapi-java/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<artifactId>quarkus-resteasy</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-direct</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.apache.camel.quarkus.component.openapi.java.deployment;

import java.io.File;
import java.util.Arrays;

import io.quarkus.bootstrap.model.AppArtifact;
Expand All @@ -41,7 +40,8 @@ public class RESTOpenAPITest {
.withConfigurationResource("application.properties")
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
.addClasses(RestRoutes.class, QuarkusResource.class)
.addAsResource(new File("src/test/resources/routes/my-route.xml"), "routes/my-route.xml"));
.addAsResource("routes/rests.xml", "routes/rests.xml")
.addAsResource("routes/routes.xml", "routes/routes.xml"));

@BeforeAll
static void setUp() {
Expand Down