Skip to content

Commit

Permalink
Upgrade Camel to 4.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnetherton committed Jul 22, 2024
1 parent 4914030 commit 8070038
Show file tree
Hide file tree
Showing 80 changed files with 3,279 additions and 2,846 deletions.
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ asciidoc:
requires: "'util=camel-website-util,quarkus=xref:js/quarkus.js'"

# Project versions
camel-version: 4.6.0 # replace ${camel.version}
camel-version: 4.7.0 # replace ${camel.version}
camel-docs-version: next
camel-quarkus-version: 3.13.0 # replace ${camel-quarkus.version}
quarkus-version: 3.12.0 # replace ${quarkus.version}
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/examples/components/activemq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ cqDeprecated: false
cqJvmSince: 1.0.0
cqNativeSince: 1.0.0
cqCamelPartName: activemq
cqCamelPartTitle: ActiveMQ
cqCamelPartDescription: Send messages to (or consume from) Apache ActiveMQ. This component extends the Camel JMS component.
cqCamelPartTitle: ActiveMQ 5.x
cqCamelPartDescription: Send messages to (or consume from) Apache ActiveMQ 5.x. This component extends the Camel JMS component.
cqExtensionPageTitle: ActiveMQ
2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/components/coap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ cqJvmSince: 1.1.0
cqNativeSince: n/a
cqCamelPartName: coap
cqCamelPartTitle: CoAP
cqCamelPartDescription: Send and receive messages to/from COAP capable devices.
cqCamelPartDescription: Send and receive messages to/from CoAP (Constrained Application Protocol) capable devices.
cqExtensionPageTitle: CoAP
2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/components/nitrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cqArtifactId: camel-quarkus-nitrite
cqArtifactIdBase: nitrite
cqNativeSupported: true
cqStatus: Stable
cqDeprecated: false
cqDeprecated: true
cqJvmSince: 1.0.0
cqNativeSince: 1.8.0
cqCamelPartName: nitrite
Expand Down
13 changes: 0 additions & 13 deletions docs/modules/ROOT/examples/dataformats/pgp.yml

This file was deleted.

4 changes: 2 additions & 2 deletions docs/modules/ROOT/examples/others/kotlin-dsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ cqArtifactId: camel-quarkus-kotlin-dsl
cqArtifactIdBase: kotlin-dsl
cqNativeSupported: true
cqStatus: Stable
cqDeprecated: false
cqDeprecated: true
cqJvmSince: 1.8.0
cqNativeSince: 2.16.0
cqCamelPartName: kotlin-dsl
cqCamelPartTitle: Kotlin DSL
cqCamelPartDescription: Camel DSL with Kotlin
cqCamelPartDescription: Camel DSL with Kotlin (deprecated)
cqExtensionPageTitle: Kotlin DSL
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/reference/extensions/activemq.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Send messages to (or consume from) Apache ActiveMQ. This component extends the Camel JMS component.
:cq-description: Send messages to (or consume from) Apache ActiveMQ 5.x. This component extends the Camel JMS component.
:cq-deprecated: false
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0
Expand All @@ -18,12 +18,12 @@ ifeval::[{doc-show-badges} == true]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##
endif::[]

Send messages to (or consume from) Apache ActiveMQ. This component extends the Camel JMS component.
Send messages to (or consume from) Apache ActiveMQ 5.x. This component extends the Camel JMS component.

[id="extensions-activemq-whats-inside"]
== What's inside

* xref:{cq-camel-components}::activemq-component.adoc[ActiveMQ component], URI syntax: `activemq:destinationType:destinationName`
* xref:{cq-camel-components}::activemq-component.adoc[ActiveMQ 5.x component], URI syntax: `activemq:destinationType:destinationName`

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

Expand Down
6 changes: 6 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/core.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ Filter for tracing messages.
| `string`
|

|icon:lock[title=Fixed at build time] [[quarkus.camel.type-converter.statistics-enabled]]`link:#quarkus.camel.type-converter.statistics-enabled[quarkus.camel.type-converter.statistics-enabled]`

Whether type converter statistics are enabled. By default, type converter utilization statistics are disabled. Note that enabling statistics incurs a minor performance impact under very heavy load.
| `boolean`
| `false`

|icon:lock[title=Fixed at build time] [[quarkus.camel.main.shutdown.timeout]]`link:#quarkus.camel.main.shutdown.timeout[quarkus.camel.main.shutdown.timeout]`

A timeout (with millisecond precision) to wait for `CamelMain++#++stop()` to finish
Expand Down
1 change: 0 additions & 1 deletion docs/modules/ROOT/pages/reference/extensions/crypto.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Sign and verify exchanges using the Signature Service of the Java Cryptographic

* xref:{cq-camel-components}:dataformats:crypto-dataformat.adoc[Crypto (Java Cryptographic Extension) data format]
* xref:{cq-camel-components}::crypto-component.adoc[Crypto (JCE) component], URI syntax: `crypto:cryptoOperation:name`
* xref:{cq-camel-components}:dataformats:pgp-dataformat.adoc[PGP data format]

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

Expand Down
7 changes: 7 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/ical.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,10 @@ Or add the coordinates to your existing project:
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-ical-ssl-in-native-mode"]
== SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add
`quarkus.ssl.native=true` to your `application.properties` yourself. See also
https://quarkus.io/guides/native-and-ssl[Quarkus SSL guide].
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/reference/extensions/kotlin-dsl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
:cq-artifact-id: camel-quarkus-kotlin-dsl
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-status-deprecation: Stable Deprecated
:cq-description: Support for parsing Kotlin route definitions at runtime
:cq-deprecated: false
:cq-deprecated: true
:cq-jvm-since: 1.8.0
:cq-native-since: 2.16.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.8.0## [.badge-key]##Native since##[.badge-supported]##2.16.0##
[.badge-key]##JVM since##[.badge-supported]##1.8.0## [.badge-key]##Native since##[.badge-supported]##2.16.0## [.badge-key]##⚠️##[.badge-unsupported]##Deprecated##
endif::[]

Support for parsing Kotlin route definitions at runtime
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/reference/extensions/nitrite.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
:cq-artifact-id: camel-quarkus-nitrite
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-status-deprecation: Stable Deprecated
:cq-description: Access Nitrite databases.
:cq-deprecated: false
:cq-deprecated: true
:cq-jvm-since: 1.0.0
:cq-native-since: 1.8.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.8.0##
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.8.0## [.badge-key]##⚠️##[.badge-unsupported]##Deprecated##
endif::[]

Access Nitrite databases.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.quarkus.core.deployment;

import java.util.function.BooleanSupplier;
import java.util.stream.StreamSupport;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.BuildSteps;
import io.quarkus.deployment.builditem.AllowJNDIBuildItem;
import org.eclipse.microprofile.config.ConfigProvider;

/**
* Build steps relating to camel debugging support. This is primarily required due to camel-main
* having the capability to enable debugging features that live in the Camel core such as the
* DebuggerJmxConnectorService
*/
@BuildSteps(onlyIf = CamelDebugProcessor.CamelDebugConfigurationPresent.class)
public class CamelDebugProcessor {
@BuildStep
AllowJNDIBuildItem allowJNDI() {
return new AllowJNDIBuildItem();
}

static final class CamelDebugConfigurationPresent implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
return StreamSupport.stream(ConfigProvider.getConfig().getPropertyNames().spliterator(), false)
.anyMatch(key -> key.startsWith("camel.debug"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ void camelServices(
@Record(ExecutionTime.STATIC_INIT)
@BuildStep
CamelTypeConverterRegistryBuildItem typeConverterRegistry(
CamelConfig config,
CamelRecorder recorder,
ApplicationArchivesBuildItem applicationArchives,
List<CamelTypeConverterLoaderBuildItem> additionalLoaders,
Expand All @@ -256,7 +257,8 @@ CamelTypeConverterRegistryBuildItem typeConverterRegistry(

IndexView index = combinedIndex.getIndex();

RuntimeValue<TypeConverterRegistry> typeConverterRegistry = recorder.createTypeConverterRegistry();
RuntimeValue<TypeConverterRegistry> typeConverterRegistry = recorder
.createTypeConverterRegistry(config.typeConverter.statisticsEnabled);

//
// This should be simplified by searching for classes implementing TypeConverterLoader but that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public enum FailureRemedy {
@ConfigItem
public TraceConfig trace;

/**
* Build time configuration options for Camel type converters.
*/
@ConfigItem
public TypeConverterConfig typeConverter;

@ConfigGroup
public static class BootstrapConfig {
/**
Expand Down Expand Up @@ -504,4 +510,14 @@ public static class TraceConfig {
@ConfigItem
public Optional<String> traceFilter;
}

@ConfigGroup
public static class TypeConverterConfig {
/**
* Whether type converter statistics are enabled. By default, type converter utilization statistics are disabled.
* Note that enabling statistics incurs a minor performance impact under very heavy load.
*/
@ConfigItem(defaultValue = "false")
public boolean statisticsEnabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public RuntimeValue<Registry> createRegistry(Map<String, CamelBeanQualifierResol
return new RuntimeValue<>(new RuntimeRegistry(beanQualifierResolvers));
}

public RuntimeValue<TypeConverterRegistry> createTypeConverterRegistry() {
return new RuntimeValue<>(new FastTypeConverter());
public RuntimeValue<TypeConverterRegistry> createTypeConverterRegistry(boolean statisticsEnabled) {
return new RuntimeValue<>(new FastTypeConverter(statisticsEnabled));
}

public void addTypeConverterLoader(RuntimeValue<TypeConverterRegistry> registry, RuntimeValue<TypeConverterLoader> loader) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
public class FastTypeConverter extends DefaultTypeConverter {
private static final Logger LOG = LoggerFactory.getLogger(FastTypeConverter.class);

public FastTypeConverter() {
super(null, null, null, false);
public FastTypeConverter(boolean statisticsEnabled) {
super(null, null, null, false, statisticsEnabled);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* 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.core.graal;

import java.io.IOException;
import java.util.function.BooleanSupplier;

import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.RecomputeFieldValue;
import com.oracle.svm.core.annotate.RecomputeFieldValue.Kind;
import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;
import org.apache.camel.impl.debugger.DebuggerJmxConnectorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Disable MBean server interactions in DebuggerJmxConnectorService if camel-management is not present.
*/
@TargetClass(value = DebuggerJmxConnectorService.class, onlyWith = CamelManagementAbsent.class)
final class DebuggerJmxConnectorServiceSubstitutions {
@Alias
@RecomputeFieldValue(kind = Kind.FromAlias)
private static Logger LOG = LoggerFactory.getLogger(DebuggerJmxConnectorService.class);

@Substitute
protected void doStart() throws Exception {
LOG.warn(
"The JmxConnectorService is enabled but camel-quarkus-management is not detected. DebuggerJmxConnectorService will not be started.");
}

@Substitute
protected void doStop() throws Exception {
// Noop
}

@Substitute
protected void createJmxConnector(String host) throws IOException {
// Noop
}
}

final class CamelManagementAbsent implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
try {
Thread.currentThread().getContextClassLoader().loadClass("org.apache.camel.management.ManagedCamelContextImpl");
return false;
} catch (ClassNotFoundException e) {
return true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#
---
name: "Camel ActiveMQ"
description: "Send messages to (or consume from) Apache ActiveMQ. This component extends the Camel JMS component"
description: "Send messages to (or consume from) Apache ActiveMQ 5.x. This component extends the Camel JMS component"
metadata:
icon-url: "https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg"
guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/activemq.html"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
*/
package org.apache.camel.quarkus.component.aws2.kinesis.deployment;

import java.util.stream.Stream;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import org.jboss.logging.Logger;

class Aws2KinesisProcessor {
Expand All @@ -29,4 +33,12 @@ class Aws2KinesisProcessor {
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

@BuildStep
void runtimeInitializedClasses(BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitializedClass) {
Stream.of("software.amazon.awssdk.services.dynamodb.DynamoDbRetryPolicy",
"software.amazon.kinesis.lifecycle.ShutdownTask")
.map(RuntimeInitializedClassBuildItem::new)
.forEach(runtimeInitializedClass::produce);
}
}
5 changes: 5 additions & 0 deletions extensions/aws2-kinesis/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-netty</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>nativeimage</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
Loading

0 comments on commit 8070038

Please sign in to comment.