From 0da1bf963c17c5fa0a70fbb075cdb4bcfdab5bdd Mon Sep 17 00:00:00 2001 From: James Netherton Date: Mon, 20 Jan 2025 09:42:24 +0000 Subject: [PATCH 1/4] Upgrade Quarkus to 3.19.0.CR1 --- docs/antora.yml | 2 +- .../kafka/deployment/KafkaProcessor.java | 6 +- .../MicroProfileHealthProcessor.java | 2 +- .../deployment/VertxWebsocketProcessor.java | 4 +- .../websocket/VertxWebsocketRecorder.java | 22 +-- .../oauth/it/KafkaKeycloakTestResource.java | 30 ++-- .../src/test/resources/kafkaServer.properties | 166 ------------------ pom.xml | 15 +- .../src/main/generated/flattened-full-pom.xml | 10 +- .../main/generated/flattened-reduced-pom.xml | 10 +- .../flattened-reduced-verbose-pom.xml | 10 +- 11 files changed, 60 insertions(+), 217 deletions(-) delete mode 100644 integration-tests/kafka-oauth/src/test/resources/kafkaServer.properties diff --git a/docs/antora.yml b/docs/antora.yml index 5137cc338f20..8bb8c21cf5f7 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -31,7 +31,7 @@ asciidoc: camel-version: 4.10.0 # replace ${camel.version} camel-docs-version: next camel-quarkus-version: 3.19.0 # replace ${camel-quarkus.version} - quarkus-version: 3.18.0 # replace ${quarkus.version} + quarkus-version: 3.19.0.CR1 # replace ${quarkus.version} graalvm-version: 23.1.2 # replace ${graalvm.version} graalvm-docs-version: jdk21 # replace ${graalvm-docs.version} mapstruct-version: 1.6.3 # replace ${mapstruct.version} diff --git a/extensions/kafka/deployment/src/main/java/org/apache/camel/quarkus/component/kafka/deployment/KafkaProcessor.java b/extensions/kafka/deployment/src/main/java/org/apache/camel/quarkus/component/kafka/deployment/KafkaProcessor.java index c9fba0b9eacf..4ddf9345d161 100644 --- a/extensions/kafka/deployment/src/main/java/org/apache/camel/quarkus/component/kafka/deployment/KafkaProcessor.java +++ b/extensions/kafka/deployment/src/main/java/org/apache/camel/quarkus/component/kafka/deployment/KafkaProcessor.java @@ -31,7 +31,7 @@ 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.deployment.dev.devservices.DevServicesConfig; import io.quarkus.kafka.client.deployment.KafkaBuildTimeConfig; import org.apache.camel.quarkus.component.kafka.KafkaClientFactoryProducer; import org.eclipse.microprofile.config.Config; @@ -63,7 +63,7 @@ void createKafkaClientFactoryProducerBean( } } - @BuildStep(onlyIfNot = IsNormal.class, onlyIf = GlobalDevServicesConfig.Enabled.class) + @BuildStep(onlyIfNot = IsNormal.class, onlyIf = DevServicesConfig.Enabled.class) public void configureKafkaComponentForDevServices( DevServicesLauncherConfigResultBuildItem devServiceResult, KafkaBuildTimeConfig kafkaBuildTimeConfig, @@ -72,7 +72,7 @@ public void configureKafkaComponentForDevServices( Config config = ConfigProvider.getConfig(); Optional brokers = config.getOptionalValue(CAMEL_KAFKA_BROKERS, String.class); - if (brokers.isEmpty() && kafkaBuildTimeConfig.devservices.enabled.orElse(true)) { + if (brokers.isEmpty() && kafkaBuildTimeConfig.devservices().enabled().orElse(true)) { String kafkaBootstrapServers = devServiceResult.getConfig().get(KAFKA_BOOTSTRAP_SERVERS); if (kafkaBootstrapServers != null) { runTimeConfig.produce(new RunTimeConfigurationDefaultBuildItem(CAMEL_KAFKA_BROKERS, kafkaBootstrapServers)); diff --git a/extensions/microprofile-health/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthProcessor.java b/extensions/microprofile-health/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthProcessor.java index 1be7493e4f6a..27acb20ef12e 100644 --- a/extensions/microprofile-health/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthProcessor.java +++ b/extensions/microprofile-health/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthProcessor.java @@ -70,7 +70,7 @@ public boolean getAsBoolean() { .orElse(true); return !mpHealthDisabled && camelHealthEnabled && camelHealthConfig.enabled() - && quarkusHealthConfig.enabled; + && quarkusHealthConfig.enabled(); } } diff --git a/extensions/vertx-websocket/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/deployment/VertxWebsocketProcessor.java b/extensions/vertx-websocket/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/deployment/VertxWebsocketProcessor.java index 7b434f4d75c0..c8984cb87372 100644 --- a/extensions/vertx-websocket/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/deployment/VertxWebsocketProcessor.java +++ b/extensions/vertx-websocket/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/deployment/VertxWebsocketProcessor.java @@ -25,7 +25,7 @@ import io.quarkus.deployment.builditem.LaunchModeBuildItem; import io.quarkus.vertx.deployment.VertxBuildItem; import io.quarkus.vertx.http.deployment.VertxWebRouterBuildItem; -import io.quarkus.vertx.http.runtime.HttpConfiguration; +import io.quarkus.vertx.http.runtime.VertxHttpConfig; import org.apache.camel.component.vertx.websocket.VertxWebsocketComponent; import org.apache.camel.quarkus.component.vertx.websocket.VertxWebsocketRecorder; import org.apache.camel.quarkus.core.deployment.spi.CamelRuntimeBeanBuildItem; @@ -46,7 +46,7 @@ CamelRuntimeBeanBuildItem configureVertxWebsocketComponent( VertxBuildItem vertx, VertxWebRouterBuildItem router, LaunchModeBuildItem launchMode, - HttpConfiguration httpConfig, + VertxHttpConfig httpConfig, VertxWebsocketRecorder recorder) { return new CamelRuntimeBeanBuildItem("vertx-websocket", VertxWebsocketComponent.class.getName(), recorder.createVertxWebsocketComponent(vertx.getVertx(), router.getHttpRouter(), launchMode.getLaunchMode(), diff --git a/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java b/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java index f1186656bc58..5483a6df5ded 100644 --- a/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java +++ b/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java @@ -27,8 +27,8 @@ import io.quarkus.tls.TlsConfiguration; import io.quarkus.tls.TlsConfigurationRegistry; import io.quarkus.vertx.http.runtime.CertificateConfig; -import io.quarkus.vertx.http.runtime.HttpConfiguration; import io.quarkus.vertx.http.runtime.ServerSslConfig; +import io.quarkus.vertx.http.runtime.VertxHttpConfig; import io.vertx.core.Vertx; import io.vertx.core.http.HttpClientOptions; import io.vertx.core.http.WebSocketConnectOptions; @@ -53,13 +53,13 @@ public RuntimeValue createVertxWebsocketComponent( RuntimeValue vertx, RuntimeValue router, LaunchMode launchMode, - HttpConfiguration httpConfig) { + VertxHttpConfig httpConfig) { boolean sslEnabled = isHttpSeverSecureTransportConfigured(httpConfig); int httpPort = httpConfig.determinePort(launchMode); int httpsPort = httpConfig.determineSslPort(launchMode); - HOST = httpConfig.host; + HOST = httpConfig.host(); PORT = sslEnabled ? httpsPort : httpPort; QuarkusVertxWebsocketComponent component = new QuarkusVertxWebsocketComponent(); @@ -70,15 +70,15 @@ public RuntimeValue createVertxWebsocketComponent( return new RuntimeValue<>(component); } - private boolean isHttpSeverSecureTransportConfigured(HttpConfiguration httpConfig) { + private boolean isHttpSeverSecureTransportConfigured(VertxHttpConfig httpConfig) { return httpServerTlsRegistryConfigurationExists(httpConfig) || httpServerLegacySslConfigurationExists(httpConfig); } - private boolean httpServerTlsRegistryConfigurationExists(HttpConfiguration httpConfig) { + private boolean httpServerTlsRegistryConfigurationExists(VertxHttpConfig httpConfig) { if (Arc.container() != null) { TlsConfigurationRegistry tlsConfigurationRegistry = Arc.container().select(TlsConfigurationRegistry.class).orNull(); if (tlsConfigurationRegistry != null) { - Optional tlsConfigurationName = httpConfig.tlsConfigurationName; + Optional tlsConfigurationName = httpConfig.tlsConfigurationName(); Optional defaultTlsConfiguration = tlsConfigurationRegistry.getDefault(); if (tlsConfigurationName.isPresent() && tlsConfigurationRegistry.get(tlsConfigurationName.get()).isPresent()) { return true; @@ -90,15 +90,15 @@ private boolean httpServerTlsRegistryConfigurationExists(HttpConfiguration httpC return false; } - private boolean httpServerLegacySslConfigurationExists(HttpConfiguration httpConfig) { - ServerSslConfig ssl = httpConfig.ssl; + private boolean httpServerLegacySslConfigurationExists(VertxHttpConfig httpConfig) { + ServerSslConfig ssl = httpConfig.ssl(); if (ssl != null) { - CertificateConfig certificate = ssl.certificate; + CertificateConfig certificate = ssl.certificate(); if (certificate != null) { - if (certificate.files.isPresent() && certificate.keyFiles.isPresent()) { + if (certificate.files().isPresent() && certificate.keyFiles().isPresent()) { return true; } - return certificate.keyStoreFile.isPresent() && certificate.keyStorePassword.isPresent(); + return certificate.keyStoreFile().isPresent() && certificate.keyStorePassword().isPresent(); } } return false; diff --git a/integration-tests/kafka-oauth/src/test/java/org/apache/camel/quarkus/kafka/oauth/it/KafkaKeycloakTestResource.java b/integration-tests/kafka-oauth/src/test/java/org/apache/camel/quarkus/kafka/oauth/it/KafkaKeycloakTestResource.java index dcbeada712f6..5fe2fd471feb 100644 --- a/integration-tests/kafka-oauth/src/test/java/org/apache/camel/quarkus/kafka/oauth/it/KafkaKeycloakTestResource.java +++ b/integration-tests/kafka-oauth/src/test/java/org/apache/camel/quarkus/kafka/oauth/it/KafkaKeycloakTestResource.java @@ -31,7 +31,8 @@ import org.apache.commons.io.IOUtils; import org.eclipse.microprofile.config.ConfigProvider; import org.jboss.logging.Logger; -import org.testcontainers.utility.MountableFile; + +import static java.util.Map.entry; import static io.strimzi.test.container.StrimziKafkaContainer.KAFKA_PORT; @@ -80,18 +81,27 @@ public Map start() { } //Start kafka container - //TODO: Ideally we'd use kafka.container.image, but we can't due to https://github.com/strimzi/test-container/issues/63 - String imageName = ConfigProvider.getConfig().getValue("kafka-oauth.container.image", String.class); + String imageName = ConfigProvider.getConfig().getValue("kafka.container.image", String.class); this.kafka = new StrimziKafkaContainer(imageName) .withBrokerId(1) - .withKafkaConfigurationMap(Map.of("listener.security.protocol.map", - "JWT:SASL_PLAINTEXT,BROKER1:PLAINTEXT", - "listener.name.jwt.oauthbearer.sasl.jaas.config", - getOauthSaslJaasConfig(keycloak.getInternalUrl(), keycloak.getServerUrl()), - "listener.name.jwt.plain.sasl.jaas.config", - getPlainSaslJaasConfig(keycloak.getInternalUrl(), keycloak.getServerUrl()))) + .withKafkaConfigurationMap(Map.ofEntries( + entry("listener.security.protocol.map", "JWT:SASL_PLAINTEXT,BROKER1:PLAINTEXT"), + entry("listener.name.jwt.oauthbearer.sasl.jaas.config", + getOauthSaslJaasConfig(keycloak.getInternalUrl(), keycloak.getServerUrl())), + entry("listener.name.jwt.plain.sasl.jaas.config", + getPlainSaslJaasConfig(keycloak.getInternalUrl(), keycloak.getServerUrl())), + entry("sasl.enabled.mechanisms", "OAUTHBEARER"), + entry("sasl.mechanism.inter.broker.protocol", "OAUTHBEARER"), + entry("oauth.username.claim", "preferred_username"), + entry("principal.builder.class", "io.strimzi.kafka.oauth.server.OAuthKafkaPrincipalBuilder"), + entry("listener.name.jwt.sasl.enabled.mechanisms", "OAUTHBEARER,PLAIN"), + entry("listener.name.jwt.oauthbearer.sasl.server.callback.handler.class", + "io.strimzi.kafka.oauth.server.JaasServerOauthValidatorCallbackHandler"), + entry("listener.name.jwt.oauthbearer.sasl.login.callback.handler.class", + "io.strimzi.kafka.oauth.client.JaasClientOauthLoginCallbackHandler"), + entry("listener.name.jwt.plain.sasl.server.callback.handler.class", + "io.strimzi.kafka.oauth.server.plain.JaasServerOauthOverPlainValidatorCallbackHandler"))) .withNetworkAliases("kafka") - .withServerProperties(MountableFile.forClasspathResource("kafkaServer.properties")) .withBootstrapServers( c -> String.format("JWT://%s:%s", c.getHost(), c.getMappedPort(KAFKA_PORT))); this.kafka.start(); diff --git a/integration-tests/kafka-oauth/src/test/resources/kafkaServer.properties b/integration-tests/kafka-oauth/src/test/resources/kafkaServer.properties deleted file mode 100644 index cbf18d7404c6..000000000000 --- a/integration-tests/kafka-oauth/src/test/resources/kafkaServer.properties +++ /dev/null @@ -1,166 +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. -## --------------------------------------------------------------------------- - -# see kafka.server.KafkaConfig for additional details and defaults - -############################# Server Basics ############################# - -# The id of the broker. This must be set to a unique integer for each broker. -broker.id=1 - -############################# Socket Server Settings ############################# - -# The address the socket server listens on. It will get the value returned from -# java.net.InetAddress.getCanonicalHostName() if not configured. -# FORMAT: -# listeners = listener_name://host_name:port -# EXAMPLE: -# listeners = PLAINTEXT://your.host.name:9092 -#listeners=PLAINTEXT://:9092 -listeners=JWT://:9092 -#advertised.listeners=SASL_PLAINTEXT://localhost:9092 - - - -# Hostname and port the broker will advertise to producers and consumers. If not set, -# it uses the value for "listeners" if configured. Otherwise, it will use the value -# returned from java.net.InetAddress.getCanonicalHostName(). -#advertised.listeners=PLAINTEXT://your.host.name:9092 -#advertised.listeners=SASL_PLAINTEXT://localhost:9092 - -# Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details -#listener.security.protocol.map=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL -listener.security.protocol.map=JWT:SASL_PLAINTEXT - - -# The number of threads that the server uses for receiving requests from the network and sending responses to the network -num.network.threads=3 - -# The number of threads that the server uses for processing requests, which may include disk I/O -num.io.threads=8 - -# The send buffer (SO_SNDBUF) used by the socket server -socket.send.buffer.bytes=102400 - -# The receive buffer (SO_RCVBUF) used by the socket server -socket.receive.buffer.bytes=102400 - -# The maximum size of a request that the socket server will accept (protection against OOM) -socket.request.max.bytes=104857600 - - -inter.broker.listener.name=JWT - - -#### SASL #### - -sasl.enabled.mechanisms=OAUTHBEARER - -sasl.mechanism.inter.broker.protocol=OAUTHBEARER - -oauth.username.claim=preferred_username -principal.builder.class=io.strimzi.kafka.oauth.server.OAuthKafkaPrincipalBuilder - -listener.name.jwt.sasl.enabled.mechanisms=OAUTHBEARER,PLAIN -listener.name.jwt.oauthbearer.sasl.jaas.config=set_by_test - -listener.name.jwt.oauthbearer.sasl.server.callback.handler.class=io.strimzi.kafka.oauth.server.JaasServerOauthValidatorCallbackHandler -listener.name.jwt.oauthbearer.sasl.login.callback.handler.class=io.strimzi.kafka.oauth.client.JaasClientOauthLoginCallbackHandler -#listener.name.jwt.plain.sasl.jaas.config=set_by_test - -listener.name.jwt.plain.sasl.server.callback.handler.class=io.strimzi.kafka.oauth.server.plain.JaasServerOauthOverPlainValidatorCallbackHandler - -############################# Log Basics ############################# - -# A comma separated list of directories under which to store log files -log.dirs=/tmp/kafka-logs - -# The default number of log partitions per topic. More partitions allow greater -# parallelism for consumption, but this will also result in more files across -# the brokers. -num.partitions=1 - -# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown. -# This value is recommended to be increased for installations with data dirs located in RAID array. -num.recovery.threads.per.data.dir=1 - -############################# Internal Topic Settings ############################# -# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state" -# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3. -offsets.topic.replication.factor=1 -transaction.state.log.replication.factor=1 -transaction.state.log.min.isr=1 - -############################# Log Flush Policy ############################# - -# Messages are immediately written to the filesystem but by default we only fsync() to sync -# the OS cache lazily. The following configurations control the flush of data to disk. -# There are a few important trade-offs here: -# 1. Durability: Unflushed data may be lost if you are not using replication. -# 2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush. -# 3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to excessive seeks. -# The settings below allow one to configure the flush policy to flush data after a period of time or -# every N messages (or both). This can be done globally and overridden on a per-topic basis. - -# The number of messages to accept before forcing a flush of data to disk -#log.flush.interval.messages=10000 - -# The maximum amount of time a message can sit in a log before we force a flush -#log.flush.interval.ms=1000 - -############################# Log Retention Policy ############################# - -# The following configurations control the disposal of log segments. The policy can -# be set to delete segments after a period of time, or after a given size has accumulated. -# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens -# from the end of the log. - -# The minimum age of a log file to be eligible for deletion due to age -log.retention.hours=168 - -# A size-based retention policy for logs. Segments are pruned from the log unless the remaining -# segments drop below log.retention.bytes. Functions independently of log.retention.hours. -#log.retention.bytes=1073741824 - -# The maximum size of a log segment file. When this size is reached a new log segment will be created. -log.segment.bytes=1073741824 - -# The interval at which log segments are checked to see if they can be deleted according -# to the retention policies -log.retention.check.interval.ms=300000 - -############################# Zookeeper ############################# - -# Zookeeper connection string (see zookeeper docs for details). -# This is a comma separated host:port pairs, each corresponding to a zk -# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002". -# You can also append an optional chroot string to the urls to specify the -# root directory for all kafka znodes. -zookeeper.connect=localhost:2181 - -# Timeout in ms for connecting to zookeeper -zookeeper.connection.timeout.ms=45000 - - -############################# Group Coordinator Settings ############################# - -# The following configuration specifies the time, in milliseconds, that the GroupCoordinator will delay the initial consumer rebalance. -# The rebalance will be further delayed by the value of group.initial.rebalance.delay.ms as new members join the group, up to a maximum of max.poll.interval.ms. -# The default value for this is 3 seconds. -# We override this to 0 here as it makes for a better out-of-the-box experience for development and testing. -# However, in production environments the default value of 3 seconds is more suitable as this will help to avoid unnecessary, and potentially expensive, rebalances during application startup. -group.initial.rebalance.delay.ms=0 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4c4ca0773dd9..4f12bd5e0dbe 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 3.7.7 2.2.4 2.6.0 - 3.18.0 + 3.19.0.CR1 4.0.0 2.7.1 @@ -73,14 +73,14 @@ 1.12.0 2.29.14 0.31.3 - 3.27.2 + 3.27.3 1.11.714 ${azure-sdk-bom-version} 1.54.1 1.15.0 1.0.0 - 1.79 - 3.1.8 + 1.80 + 3.2.0 ${commons-beanutils-version} 1.8.0 ${commons-collections-version} @@ -126,7 +126,7 @@ ${jedis-client-version} 2.5.0 1.1.0 - 3.7.2 + 3.9.0 26.0.7 ${kudu-version} 2.0.21 @@ -150,7 +150,7 @@ ${reactor-netty-version} 2.9.0 3.1.8 - 4.26.0 + 4.27.0 2.3 ${snakeyaml-engine-version} ${spring-version} @@ -235,8 +235,7 @@ mirror.gcr.io/hashicorp/vault:1.17 icr.io/ibm-messaging/mq:9.4.0.5-r1 mirror.gcr.io/influxdb:1.8.10-alpine - quay.io/strimzi-test-container/test-container:latest-kafka-3.8.0 - quay.io/strimzi/kafka:latest-kafka-3.7.0 + quay.io/strimzi-test-container/test-container:latest-kafka-3.9.0 quay.io/keycloak/keycloak:${keycloak.version} mirror.gcr.io/apache/kudu:1.17.0 mirror.gcr.io/localstack/localstack:3.7.2 diff --git a/poms/bom/src/main/generated/flattened-full-pom.xml b/poms/bom/src/main/generated/flattened-full-pom.xml index 637399fffc1f..0f5dfc37a20f 100644 --- a/poms/bom/src/main/generated/flattened-full-pom.xml +++ b/poms/bom/src/main/generated/flattened-full-pom.xml @@ -6922,7 +6922,7 @@ io.smallrye.reactive smallrye-reactive-messaging-camel - 4.26.0 + 4.27.0 io.swagger.codegen.v3 @@ -7059,7 +7059,7 @@ org.apache.kafka connect-runtime - 3.7.2 + 3.9.0 io.swagger.core.v3 @@ -7152,17 +7152,17 @@ org.bouncycastle bcmail-jdk18on - 1.79 + 1.80 org.bouncycastle bcpg-jdk18on - 1.79 + 1.80 org.bouncycastle bcutil-jdk18on - 1.79 + 1.80 org.eclipse.angus diff --git a/poms/bom/src/main/generated/flattened-reduced-pom.xml b/poms/bom/src/main/generated/flattened-reduced-pom.xml index f05104d63199..f004616c7b42 100644 --- a/poms/bom/src/main/generated/flattened-reduced-pom.xml +++ b/poms/bom/src/main/generated/flattened-reduced-pom.xml @@ -6877,7 +6877,7 @@ io.smallrye.reactive smallrye-reactive-messaging-camel - 4.26.0 + 4.27.0 io.swagger.codegen.v3 @@ -7004,7 +7004,7 @@ org.apache.kafka connect-runtime - 3.7.2 + 3.9.0 io.swagger.core.v3 @@ -7097,17 +7097,17 @@ org.bouncycastle bcmail-jdk18on - 1.79 + 1.80 org.bouncycastle bcpg-jdk18on - 1.79 + 1.80 org.bouncycastle bcutil-jdk18on - 1.79 + 1.80 org.eclipse.angus diff --git a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml index ae918b15e630..1b981e873364 100644 --- a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml +++ b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml @@ -6877,7 +6877,7 @@ io.smallrye.reactive smallrye-reactive-messaging-camel - 4.26.0 + 4.27.0 io.swagger.codegen.v3 @@ -7004,7 +7004,7 @@ org.apache.kafka connect-runtime - 3.7.2 + 3.9.0 io.swagger.core.v3 @@ -7097,17 +7097,17 @@ org.bouncycastle bcmail-jdk18on - 1.79 + 1.80 org.bouncycastle bcpg-jdk18on - 1.79 + 1.80 org.bouncycastle bcutil-jdk18on - 1.79 + 1.80 org.eclipse.angus From a50f9326e019d9e8f2fefc07644a918bba00eeed Mon Sep 17 00:00:00 2001 From: James Netherton Date: Fri, 7 Feb 2025 07:46:53 +0000 Subject: [PATCH 2/4] Disable Micrometer JMX tests due to #6984 --- integration-tests/micrometer/pom.xml | 2 ++ .../micrometer/it/MicrometerProducers.java | 19 +++++++------------ .../micrometer/it/MicrometerTest.java | 2 ++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/integration-tests/micrometer/pom.xml b/integration-tests/micrometer/pom.xml index 629271296933..4537ad400e22 100644 --- a/integration-tests/micrometer/pom.xml +++ b/integration-tests/micrometer/pom.xml @@ -67,10 +67,12 @@ io.quarkus quarkus-resteasy-jsonb + io.quarkus diff --git a/integration-tests/micrometer/src/main/java/org/apache/camel/quarkus/component/micrometer/it/MicrometerProducers.java b/integration-tests/micrometer/src/main/java/org/apache/camel/quarkus/component/micrometer/it/MicrometerProducers.java index a4779e71ed8c..37efcb542c1f 100644 --- a/integration-tests/micrometer/src/main/java/org/apache/camel/quarkus/component/micrometer/it/MicrometerProducers.java +++ b/integration-tests/micrometer/src/main/java/org/apache/camel/quarkus/component/micrometer/it/MicrometerProducers.java @@ -18,31 +18,26 @@ import java.util.List; -import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.Meter; -import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.config.MeterFilter; import io.micrometer.core.instrument.simple.SimpleMeterRegistry; -import io.micrometer.core.instrument.util.HierarchicalNameMapper; -import io.micrometer.jmx.JmxMeterRegistry; import io.micrometer.prometheus.PrometheusMeterRegistry; -import io.quarkus.arc.profile.IfBuildProfile; import io.quarkus.micrometer.runtime.MeterFilterConstraint; import jakarta.enterprise.inject.Produces; import jakarta.inject.Named; import jakarta.inject.Singleton; -import org.apache.camel.component.micrometer.CamelJmxConfig; import org.apache.camel.component.micrometer.MicrometerComponent; public class MicrometerProducers { - @Produces - @Singleton - @IfBuildProfile("test") - public MeterRegistry registry() { - return new JmxMeterRegistry(CamelJmxConfig.DEFAULT, Clock.SYSTEM, HierarchicalNameMapper.DEFAULT); - } + // TODO: https://github.com/apache/camel-quarkus/issues/6984 + // @Produces + // @Singleton + // @IfBuildProfile("test") + // public MeterRegistry registry() { + // return new JmxMeterRegistry(CamelJmxConfig.DEFAULT, Clock.SYSTEM, HierarchicalNameMapper.DEFAULT); + // } @Produces @Singleton diff --git a/integration-tests/micrometer/src/test/java/org/apache/camel/quarkus/component/micrometer/it/MicrometerTest.java b/integration-tests/micrometer/src/test/java/org/apache/camel/quarkus/component/micrometer/it/MicrometerTest.java index ec18e5aa14ad..a6c930d7c8c6 100644 --- a/integration-tests/micrometer/src/test/java/org/apache/camel/quarkus/component/micrometer/it/MicrometerTest.java +++ b/integration-tests/micrometer/src/test/java/org/apache/camel/quarkus/component/micrometer/it/MicrometerTest.java @@ -34,6 +34,7 @@ import io.restassured.path.json.JsonPath; import org.awaitility.Awaitility; import org.hamcrest.Matchers; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -210,6 +211,7 @@ public void testDumpAsJson() { Matchers.is("1")); } + @Disabled("https://github.com/apache/camel-quarkus/issues/6984") @ParameterizedTest @ValueSource(strings = { "metrics", "org.apache.camel.micrometer" }) //test uses domains from both default and custom JMX registries @DisabledOnIntegrationTest("https://github.com/apache/camel-quarkus/issues/5209") From e9b94f1696ebb389551d4f580a0109b9b2f45aae Mon Sep 17 00:00:00 2001 From: James Netherton Date: Tue, 11 Feb 2025 13:04:43 +0000 Subject: [PATCH 3/4] Remove obserability-services config workaround for /observe endpoint tracing Fixes #6967 --- .../ObservabilityServicesProcessor.java | 9 ---- ...ervabilityServicesConfigSourceFactory.java | 54 ------------------- ...rvabilityServicesRuntimeConfigBuilder.java | 27 ---------- 3 files changed, 90 deletions(-) delete mode 100644 extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesConfigSourceFactory.java delete mode 100644 extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesRuntimeConfigBuilder.java diff --git a/extensions/observability-services/deployment/src/main/java/org/apache/camel/quarkus/component/observabilityservices/deployment/ObservabilityServicesProcessor.java b/extensions/observability-services/deployment/src/main/java/org/apache/camel/quarkus/component/observabilityservices/deployment/ObservabilityServicesProcessor.java index 63be81aa2599..4d8027ac5ebb 100644 --- a/extensions/observability-services/deployment/src/main/java/org/apache/camel/quarkus/component/observabilityservices/deployment/ObservabilityServicesProcessor.java +++ b/extensions/observability-services/deployment/src/main/java/org/apache/camel/quarkus/component/observabilityservices/deployment/ObservabilityServicesProcessor.java @@ -18,9 +18,6 @@ import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.deployment.builditem.RunTimeConfigBuilderBuildItem; -import io.quarkus.opentelemetry.deployment.tracing.TracerEnabled; -import org.apache.camel.quarkus.component.observabilityservices.ObservabilityServicesRuntimeConfigBuilder; class ObservabilityServicesProcessor { private static final String FEATURE = "camel-observability-services"; @@ -29,10 +26,4 @@ class ObservabilityServicesProcessor { FeatureBuildItem feature() { return new FeatureBuildItem(FEATURE); } - - // TODO: Remove this https://github.com/apache/camel-quarkus/issues/6967 - @BuildStep(onlyIf = TracerEnabled.class) - RunTimeConfigBuilderBuildItem observabilityServicesRuntimeConfiguration() { - return new RunTimeConfigBuilderBuildItem(ObservabilityServicesRuntimeConfigBuilder.class); - } } diff --git a/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesConfigSourceFactory.java b/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesConfigSourceFactory.java deleted file mode 100644 index 2d2d7714db46..000000000000 --- a/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesConfigSourceFactory.java +++ /dev/null @@ -1,54 +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.component.observabilityservices; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import io.smallrye.config.ConfigSourceContext; -import io.smallrye.config.ConfigSourceFactory; -import io.smallrye.config.ConfigValue; -import io.smallrye.config.PropertiesConfigSource; -import org.apache.camel.util.ObjectHelper; -import org.eclipse.microprofile.config.spi.ConfigSource; - -/** - * TODO: Remove this https://github.com/apache/camel-quarkus/issues/6967 - */ -public class ObservabilityServicesConfigSourceFactory implements ConfigSourceFactory { - @Override - public Iterable getConfigSources(ConfigSourceContext context) { - ConfigValue sdkDisabled = context.getValue("quarkus.otel.sdk.disabled"); - - if (sdkDisabled != null && sdkDisabled.getValue().equals("false")) { - Map properties = new HashMap<>(1); - ConfigValue otelSuppressedUris = context.getValue("quarkus.otel.traces.suppress-application-uris"); - String suppressedEndpoints = "/observe/*"; - - if (otelSuppressedUris != null && ObjectHelper.isNotEmpty(otelSuppressedUris.getValue())) { - suppressedEndpoints += "," + otelSuppressedUris.getValue(); - } - - properties.put("quarkus.otel.traces.suppress-application-uris", suppressedEndpoints); - return Set.of(new PropertiesConfigSource(properties, "camel-quarkus-observability-services", 300)); - } - - return Collections.emptySet(); - } -} diff --git a/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesRuntimeConfigBuilder.java b/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesRuntimeConfigBuilder.java deleted file mode 100644 index 3a382cc37e0b..000000000000 --- a/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesRuntimeConfigBuilder.java +++ /dev/null @@ -1,27 +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.component.observabilityservices; - -import io.quarkus.runtime.configuration.ConfigBuilder; -import io.smallrye.config.SmallRyeConfigBuilder; - -public class ObservabilityServicesRuntimeConfigBuilder implements ConfigBuilder { - @Override - public SmallRyeConfigBuilder configBuilder(SmallRyeConfigBuilder builder) { - return builder.withSources(new ObservabilityServicesConfigSourceFactory()); - } -} From 7c519bd079b06e45f13ab76f7d512fc87f3b0ce3 Mon Sep 17 00:00:00 2001 From: James Netherton Date: Wed, 12 Feb 2025 12:01:24 +0000 Subject: [PATCH 4/4] Remove OpenTelemetry thread pool factory workarounds Fixes #6669 Fixes #6642 --- ...enTelemetryThreadPoolServiceOverrides.java | 51 --------- ...etryInstrumentedThreadFactoryListener.java | 35 ------ ...elemetryInstrumentedThreadPoolFactory.java | 73 ------------- ...urrentContextScheduledExecutorService.java | 101 ------------------ .../ForwardingScheduledExecutorService.java | 75 ------------- 5 files changed, 335 deletions(-) delete mode 100644 extensions/opentelemetry/deployment/src/main/java/org/apache/camel/quarkus/component/opentelemetry/deployment/OpenTelemetryThreadPoolServiceOverrides.java delete mode 100644 extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/OpenTelemetryInstrumentedThreadFactoryListener.java delete mode 100644 extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/OpenTelemetryInstrumentedThreadPoolFactory.java delete mode 100644 extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/internal/CurrentContextScheduledExecutorService.java delete mode 100644 extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/internal/ForwardingScheduledExecutorService.java diff --git a/extensions/opentelemetry/deployment/src/main/java/org/apache/camel/quarkus/component/opentelemetry/deployment/OpenTelemetryThreadPoolServiceOverrides.java b/extensions/opentelemetry/deployment/src/main/java/org/apache/camel/quarkus/component/opentelemetry/deployment/OpenTelemetryThreadPoolServiceOverrides.java deleted file mode 100644 index 89319d2df7f4..000000000000 --- a/extensions/opentelemetry/deployment/src/main/java/org/apache/camel/quarkus/component/opentelemetry/deployment/OpenTelemetryThreadPoolServiceOverrides.java +++ /dev/null @@ -1,51 +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.component.opentelemetry.deployment; - -import java.nio.file.Paths; -import java.util.Map; - -import io.quarkus.deployment.annotations.BuildProducer; -import io.quarkus.deployment.annotations.BuildStep; -import org.apache.camel.quarkus.core.deployment.spi.CamelServiceBuildItem; -import org.apache.camel.quarkus.core.deployment.spi.CamelServiceDestination; -import org.apache.camel.quarkus.core.deployment.spi.CamelServicePatternBuildItem; -import org.apache.camel.spi.FactoryFinder; - -/** - * TODO: Remove this: https://github.com/apache/camel-quarkus/issues/6642 - */ -class OpenTelemetryThreadPoolServiceOverrides { - @BuildStep - void overrideCamelOpenTelemetryThreadPoolServices( - BuildProducer camelServicePattern, - BuildProducer camelService) { - - Map.of("thread-pool-factory", "OpenTelemetryInstrumentedThreadPoolFactory", - "thread-factory-listener", "OpenTelemetryInstrumentedThreadFactoryListener") - .forEach((serviceName, type) -> { - String servicePath = FactoryFinder.DEFAULT_PATH + serviceName; - // Disable broken original service - camelServicePattern - .produce(new CamelServicePatternBuildItem(CamelServiceDestination.DISCOVERY, false, servicePath)); - - // Replace with working - camelService.produce(new CamelServiceBuildItem(Paths.get(servicePath), - "org.apache.camel.quarkus.component.opentelemetry.patch.%s".formatted(type))); - }); - } -} diff --git a/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/OpenTelemetryInstrumentedThreadFactoryListener.java b/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/OpenTelemetryInstrumentedThreadFactoryListener.java deleted file mode 100644 index 69eb1446fc05..000000000000 --- a/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/OpenTelemetryInstrumentedThreadFactoryListener.java +++ /dev/null @@ -1,35 +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.component.opentelemetry.patch; - -import java.util.concurrent.ThreadFactory; - -import io.opentelemetry.context.Context; -import org.apache.camel.spi.ExecutorServiceManager; -import org.apache.camel.spi.annotations.JdkService; - -/** - * TODO: Remove this: https://github.com/apache/camel-quarkus/issues/6642 - */ -@JdkService(ExecutorServiceManager.ThreadFactoryListener.FACTORY) -public class OpenTelemetryInstrumentedThreadFactoryListener implements ExecutorServiceManager.ThreadFactoryListener { - - @Override - public ThreadFactory onNewThreadFactory(ThreadFactory factory) { - return runnable -> factory.newThread(Context.current().wrap(runnable)); - } -} diff --git a/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/OpenTelemetryInstrumentedThreadPoolFactory.java b/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/OpenTelemetryInstrumentedThreadPoolFactory.java deleted file mode 100644 index 99832a5b176b..000000000000 --- a/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/OpenTelemetryInstrumentedThreadPoolFactory.java +++ /dev/null @@ -1,73 +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.component.opentelemetry.patch; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.RejectedExecutionHandler; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.TimeUnit; - -import io.opentelemetry.context.Context; -import org.apache.camel.quarkus.component.opentelemetry.patch.internal.CurrentContextScheduledExecutorService; -import org.apache.camel.spi.ThreadPoolFactory; -import org.apache.camel.spi.ThreadPoolProfile; -import org.apache.camel.spi.annotations.JdkService; -import org.apache.camel.support.DefaultThreadPoolFactory; - -/** - * TODO: Remove this: https://github.com/apache/camel-quarkus/issues/6642 - */ -@JdkService(ThreadPoolFactory.FACTORY) -public class OpenTelemetryInstrumentedThreadPoolFactory extends DefaultThreadPoolFactory implements ThreadPoolFactory { - - @Override - public ExecutorService newCachedThreadPool(ThreadFactory threadFactory) { - return Context.taskWrapping(super.newCachedThreadPool(threadFactory)); - } - - @Override - public ExecutorService newThreadPool( - int corePoolSize, - int maxPoolSize, - long keepAliveTime, - TimeUnit timeUnit, - int maxQueueSize, - boolean allowCoreThreadTimeOut, - RejectedExecutionHandler rejectedExecutionHandler, - ThreadFactory threadFactory) - throws IllegalArgumentException { - - ExecutorService executorService = super.newThreadPool( - corePoolSize, - maxPoolSize, - keepAliveTime, - timeUnit, - maxQueueSize, - allowCoreThreadTimeOut, - rejectedExecutionHandler, - threadFactory); - - return Context.taskWrapping(executorService); - } - - @Override - public ScheduledExecutorService newScheduledThreadPool(ThreadPoolProfile profile, ThreadFactory threadFactory) { - return new CurrentContextScheduledExecutorService(super.newScheduledThreadPool(profile, threadFactory)); - } - -} diff --git a/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/internal/CurrentContextScheduledExecutorService.java b/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/internal/CurrentContextScheduledExecutorService.java deleted file mode 100644 index c5937782315b..000000000000 --- a/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/internal/CurrentContextScheduledExecutorService.java +++ /dev/null @@ -1,101 +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.component.opentelemetry.patch.internal; - -import java.util.Collection; -import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import io.opentelemetry.context.Context; - -/** - * TODO: Remove this: https://github.com/apache/camel-quarkus/issues/6642 - */ -public class CurrentContextScheduledExecutorService extends ForwardingScheduledExecutorService { - - public CurrentContextScheduledExecutorService(ScheduledExecutorService delegate) { - super(delegate); - } - - @Override - public Future submit(Callable task) { - return delegate().submit(Context.current().wrap(task)); - } - - @Override - public Future submit(Runnable task, T result) { - return delegate().submit(Context.current().wrap(task), result); - } - - @Override - public Future submit(Runnable task) { - return delegate().submit(Context.current().wrap(task)); - } - - @Override - public List> invokeAll(Collection> tasks) throws InterruptedException { - return delegate().invokeAll(wrap(Context.current(), tasks)); - } - - @Override - public List> invokeAll(Collection> tasks, long timeout, TimeUnit unit) - throws InterruptedException { - return delegate().invokeAll(wrap(Context.current(), tasks), timeout, unit); - } - - @Override - public T invokeAny(Collection> tasks) throws InterruptedException, ExecutionException { - return delegate().invokeAny(wrap(Context.current(), tasks)); - } - - @Override - public T invokeAny(Collection> tasks, long timeout, TimeUnit unit) - throws InterruptedException, ExecutionException, TimeoutException { - return delegate().invokeAny(wrap(Context.current(), tasks), timeout, unit); - } - - @Override - public void execute(Runnable command) { - delegate().execute(Context.current().wrap(command)); - } - - @Override - public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) { - return delegate().schedule(Context.current().wrap(command), delay, unit); - } - - @Override - public ScheduledFuture schedule(Callable callable, long delay, TimeUnit unit) { - return delegate().schedule(Context.current().wrap(callable), delay, unit); - } - - @Override - public ScheduledFuture scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { - return delegate().scheduleAtFixedRate(Context.current().wrap(command), initialDelay, period, unit); - } - - @Override - public ScheduledFuture scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { - return delegate().scheduleWithFixedDelay(Context.current().wrap(command), initialDelay, delay, unit); - } -} diff --git a/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/internal/ForwardingScheduledExecutorService.java b/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/internal/ForwardingScheduledExecutorService.java deleted file mode 100644 index d01f4bb4bf1f..000000000000 --- a/extensions/opentelemetry/runtime/src/main/java/org/apache/camel/quarkus/component/opentelemetry/patch/internal/ForwardingScheduledExecutorService.java +++ /dev/null @@ -1,75 +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.component.opentelemetry.patch.internal; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; - -import io.opentelemetry.context.Context; - -/** - * TODO: Remove this: https://github.com/apache/camel-quarkus/issues/6642 - */ -abstract class ForwardingScheduledExecutorService implements ScheduledExecutorService { - - private final ScheduledExecutorService delegate; - - protected ForwardingScheduledExecutorService(ScheduledExecutorService delegate) { - this.delegate = delegate; - } - - ScheduledExecutorService delegate() { - return delegate; - } - - @Override - public void shutdown() { - delegate.shutdown(); - } - - @Override - public List shutdownNow() { - return delegate.shutdownNow(); - } - - @Override - public boolean isShutdown() { - return delegate.isShutdown(); - } - - @Override - public boolean isTerminated() { - return delegate.isTerminated(); - } - - @Override - public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { - return delegate.awaitTermination(timeout, unit); - } - - protected static Collection> wrap(Context context, Collection> tasks) { - List> wrapped = new ArrayList<>(); - for (Callable task : tasks) { - wrapped.add(context.wrap(task)); - } - return wrapped; - } -}