You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2025/01/08 21:49:52 UTC

(beam) branch master updated: Pin protobuf 3 for debezium (#33541)

This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new a19466ad93e Pin protobuf 3 for debezium (#33541)
a19466ad93e is described below

commit a19466ad93e39abb8d3c9527b1cff617a188a9e3
Author: Danny McCormick <da...@google.com>
AuthorDate: Wed Jan 8 16:49:45 2025 -0500

    Pin protobuf 3 for debezium (#33541)
    
    * Pin protobuf 3 for debezium
    
    * CHANGES
---
 CHANGES.md                                                    |  2 ++
 sdks/java/io/debezium/build.gradle                            | 11 +++++++++++
 .../org/apache/beam/sdk/io/gcp/pubsub/PubsubGrpcClient.java   |  1 -
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/CHANGES.md b/CHANGES.md
index ac3992a872d..189bd8c1f71 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -67,10 +67,12 @@
 ## New Features / Improvements
 
 * X feature added (Java/Python) ([#X](https://github.com/apache/beam/issues/X)).
+* Upgraded to protobuf 4 (Java) ([#33192](https://github.com/apache/beam/issues/33192)).
 
 ## Breaking Changes
 
 * AWS V1 I/Os have been removed (Java). As part of this, x-lang Python Kinesis I/O has been updated to consume the V2 IO and it also no longer supports setting producer_properties ([#33430](https://github.com/apache/beam/issues/33430)).
+* Upgraded to protobuf 4 (Java) ([#33192](https://github.com/apache/beam/issues/33192)), but forced Debezium IO to use protobuf 3 ([#33541](https://github.com/apache/beam/issues/33541) because Debezium clients are not protobuf 4 compatible. This may cause conflicts when using clients which are only compatible with protobuf 4.
 
 ## Deprecations
 
diff --git a/sdks/java/io/debezium/build.gradle b/sdks/java/io/debezium/build.gradle
index e3b88e22607..d8ab954b447 100644
--- a/sdks/java/io/debezium/build.gradle
+++ b/sdks/java/io/debezium/build.gradle
@@ -89,3 +89,14 @@ task integrationTest(type: Test, dependsOn: processTestResources) {
   useJUnit {
   }
 }
+
+configurations.all (Configuration it) -> {
+  resolutionStrategy {
+    // Force protobuf 3 because debezium is currently incompatible with protobuf 4.
+    // TODO - remove this and upgrade the version of debezium once a proto-4 compatible version is available
+    // https://github.com/apache/beam/pull/33526 does some of this, but was abandoned because it still doesn't
+    // work with protobuf 4.
+    force "com.google.protobuf:protobuf-java:3.25.5"
+    force "com.google.protobuf:protobuf-java-util:3.25.5"
+  }
+}
diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubGrpcClient.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubGrpcClient.java
index de6c1472289..7fb30a1099a 100644
--- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubGrpcClient.java
+++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubGrpcClient.java
@@ -17,7 +17,6 @@
  */
 package org.apache.beam.sdk.io.gcp.pubsub;
 
-import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkArgument;
 import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkState;
 
 import com.google.auth.Credentials;