Copilot commented on code in PR #98:
URL: https://github.com/apache/pulsar-connectors/pull/98#discussion_r3561153070
##########
canal/build.gradle.kts:
##########
@@ -21,6 +21,17 @@ plugins {
id("pulsar-connectors.java-conventions")
id("pulsar-connectors.nar-conventions")
}
+// canal.protocol/canal.client 1.1.7 were generated against protobuf-java
3.6.1: their generated
+// CanalPacket code calls GeneratedMessageV3.makeExtensionsImmutable(), which
was removed in
+// protobuf-java 4.x. The shared dependency platform force-upgrades
protobuf-java to 4.31.1, which
+// makes the canal client throw NoSuchMethodError on connect() and leaves the
connector unable to
+// talk to canal-server at all. Pin protobuf-java back to the version canal
declares so the client
+// (and this module's NAR) works. See CanalStringSourceIntegrationTest.
+configurations.all {
+ resolutionStrategy {
+ force("com.google.protobuf:protobuf-java:3.6.1")
+ }
+}
Review Comment:
`protobuf-java` is forcibly pinned here, but
`pulsar-connectors.nar-conventions` excludes the entire `com.google.protobuf`
group from `runtimeClasspath` when building NARs (see
`build-logic/conventions/.../pulsar-connectors.nar-conventions.gradle.kts`,
which the `canal` module applies). That means the connector NAR will still
*not* bundle protobuf, and at runtime in Pulsar it will continue to pick up the
platform protobuf (the 4.x that triggers the `NoSuchMethodError`), so this
change likely fixes only the Gradle test classpath, not the shipped connector.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]