This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new b19ee3ccbe69 CAMEL-27300: Upgrade protobuf-java to 4.36.2, the gencode
version of the Apicurio Registry 3.3.4 protobuf serdes (#30495)
b19ee3ccbe69 is described below
commit b19ee3ccbe698cf6ee487d0e8298af8ad0d79538
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Nov 20 16:00:20 2026 +0100
CAMEL-27300: Upgrade protobuf-java to 4.36.2, the gencode version of the
Apicurio Registry 3.3.4 protobuf serdes (#30495)
The protobuf classes in the Apicurio Registry 3.3.4 protobuf serdes are
generated
with protoc 4.36.2, and fail to load with the protobuf-java 4.35.1 that
Camel managed
(ProtobufRuntimeVersionException). The protoc that generates the protobuf
classes of
Camel stays at 4.35.1 in a new protoc-version property, so that they still
load with
the protobuf-java of Quarkus.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.github/dependabot.yml | 3 ++-
components/camel-ai/camel-kserve/pom.xml | 2 +-
components/camel-ai/camel-tensorflow-serving/pom.xml | 2 +-
components/camel-grpc/pom.xml | 2 +-
.../kafka/KafkaSchemaRegistryVendorClassesTest.java | 17 +++++++++++++++++
components/camel-protobuf/pom.xml | 2 +-
.../camel-salesforce/camel-salesforce-component/pom.xml | 4 ++--
parent/pom.xml | 7 ++++++-
8 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 2535263ceac5..2e0e368bf2f7 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -34,7 +34,8 @@ updates:
- dependency-name: "org.apache.logging.log4j:*"
# This is a virtual plugin which doesn't really exist
- dependency-name: "org.eclipse.m2e:lifecycle-mapping"
- # Managed manually - gencode version must be <= the lowest runtime
version across Spring Boot and Quarkus
+ # Managed manually - the gencode version (protoc-version) must be <= the
lowest runtime version across Spring Boot and Quarkus,
+ # and the runtime version (protobuf-version) must be >= the gencode
version of the libraries that use it (such as Apicurio Registry)
- dependency-name: "com.google.protobuf:*"
# fugue 7 is compiled for Java 25 and breaks camel-jira on Java 17 and
21 (CAMEL-25401): revisit when Camel's minimum Java is 25
- dependency-name: "io.atlassian.fugue:fugue"
diff --git a/components/camel-ai/camel-kserve/pom.xml
b/components/camel-ai/camel-kserve/pom.xml
index 3c3d62bf4bfe..f26215c7d0cb 100644
--- a/components/camel-ai/camel-kserve/pom.xml
+++ b/components/camel-ai/camel-kserve/pom.xml
@@ -104,7 +104,7 @@
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf-maven-plugin-version}</version>
<configuration>
- <protocVersion>${protobuf-version}</protocVersion>
+ <protocVersion>${protoc-version}</protocVersion>
<sourceDirectories>
<sourceDirectory>${project.basedir}/src/main/proto</sourceDirectory>
</sourceDirectories>
diff --git a/components/camel-ai/camel-tensorflow-serving/pom.xml
b/components/camel-ai/camel-tensorflow-serving/pom.xml
index 1cc37df0cb15..6ba0e02fc603 100644
--- a/components/camel-ai/camel-tensorflow-serving/pom.xml
+++ b/components/camel-ai/camel-tensorflow-serving/pom.xml
@@ -104,7 +104,7 @@
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf-maven-plugin-version}</version>
<configuration>
- <protocVersion>${protobuf-version}</protocVersion>
+ <protocVersion>${protoc-version}</protocVersion>
<sourceDirectories>
<sourceDirectory>${project.basedir}/src/main/proto</sourceDirectory>
</sourceDirectories>
diff --git a/components/camel-grpc/pom.xml b/components/camel-grpc/pom.xml
index 5d488ed42592..e07173dd75df 100644
--- a/components/camel-grpc/pom.xml
+++ b/components/camel-grpc/pom.xml
@@ -158,7 +158,7 @@
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf-maven-plugin-version}</version>
<configuration>
- <protocVersion>${protobuf-version}</protocVersion>
+ <protocVersion>${protoc-version}</protocVersion>
<sourceDirectories>
<sourceDirectory>${project.basedir}/src/test/proto</sourceDirectory>
</sourceDirectories>
diff --git
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaSchemaRegistryVendorClassesTest.java
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaSchemaRegistryVendorClassesTest.java
index 9fdfee1c483a..483454a42134 100644
---
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaSchemaRegistryVendorClassesTest.java
+++
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaSchemaRegistryVendorClassesTest.java
@@ -23,7 +23,9 @@ import org.apache.kafka.common.serialization.Serializer;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
+import org.junit.jupiter.params.provider.ValueSource;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
@@ -53,4 +55,19 @@ class KafkaSchemaRegistryVendorClassesTest {
Class<?> deserializer =
Class.forName(KafkaSchemaRegistry.deserializer(vendor, format));
assertTrue(Deserializer.class.isAssignableFrom(deserializer),
deserializer + " is not a Kafka Deserializer");
}
+
+ /**
+ * The protobuf classes in the Apicurio protobuf serde are generated by
protoc, and check when they are initialised
+ * that the protobuf-java runtime is not older than the protoc that
generated them. This fails when the
+ * protobuf-java version that Camel manages (protobuf-version) is older
than that protoc.
+ */
+ @ParameterizedTest
+ @ValueSource(strings = {
+ "io.apicurio.registry.serde.protobuf.ref.RefOuterClass",
+ "additionalTypes.Decimals",
+ "metadata.ProtobufSchemaMetadata" })
+ void testApicurioProtobufGeneratedClassesInitialize(String className) {
+ assertDoesNotThrow(() -> Class.forName(className, true,
getClass().getClassLoader()),
+ "The protobuf-java runtime is older than the protoc that
generated " + className);
+ }
}
diff --git a/components/camel-protobuf/pom.xml
b/components/camel-protobuf/pom.xml
index 8ed6e59a2512..5903fc08de83 100644
--- a/components/camel-protobuf/pom.xml
+++ b/components/camel-protobuf/pom.xml
@@ -119,7 +119,7 @@
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf-maven-plugin-version}</version>
<configuration>
- <protocVersion>${protobuf-version}</protocVersion>
+ <protocVersion>${protoc-version}</protocVersion>
<sourceDirectories>
<sourceDirectory>${project.basedir}/src/test/proto</sourceDirectory>
</sourceDirectories>
diff --git a/components/camel-salesforce/camel-salesforce-component/pom.xml
b/components/camel-salesforce/camel-salesforce-component/pom.xml
index 82d272ba5235..bc037db6bc5c 100644
--- a/components/camel-salesforce/camel-salesforce-component/pom.xml
+++ b/components/camel-salesforce/camel-salesforce-component/pom.xml
@@ -128,7 +128,7 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
- <!-- the Pub/Sub classes are generated with protoc ${protobuf-version}
and need protobuf-java 4.x at runtime;
+ <!-- the Pub/Sub classes are generated with protoc ${protoc-version}
and need protobuf-java 4.x at runtime;
grpc-protobuf brings 3.x, so declare it here for the users of
this component -->
<dependency>
<groupId>com.google.protobuf</groupId>
@@ -248,7 +248,7 @@
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf-maven-plugin-version}</version>
<configuration>
- <protocVersion>${protobuf-version}</protocVersion>
+ <protocVersion>${protoc-version}</protocVersion>
<sourceDirectories>
<sourceDirectory>${project.basedir}/src/main/proto</sourceDirectory>
</sourceDirectories>
diff --git a/parent/pom.xml b/parent/pom.xml
index d2f47d05a5ef..2ad7787cb924 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -470,8 +470,13 @@
<pooled-jms-version>3.2.5</pooled-jms-version>
<properties-maven-plugin-version>1.3.1</properties-maven-plugin-version>
<proto-google-common-protos-version>2.79.0</proto-google-common-protos-version>
- <protobuf-version>4.35.1</protobuf-version>
+ <!-- the protobuf-java runtime: at least the gencode version of the
protobuf classes in the libraries that Camel manages,
+ such as the Apicurio Registry protobuf serdes -->
+ <protobuf-version>4.36.2</protobuf-version>
<protobuf-maven-plugin-version>4.1.3</protobuf-maven-plugin-version>
+ <!-- the protoc that generates the protobuf classes of Camel (the
gencode version): at most the lowest protobuf-java
+ runtime of Spring Boot and Quarkus, and at most protobuf-version
-->
+ <protoc-version>4.35.1</protoc-version>
<prowide-version>SRU2025-10.4.1</prowide-version>
<pubnub-version>14.2.0</pubnub-version>
<pulsar-version>4.2.4</pulsar-version>