Skip to content

Commit

Permalink
Makr kafka dependency for runner-google-cloud-dataflow-java
Browse files Browse the repository at this point in the history
  • Loading branch information
Abacn committed Feb 13, 2024
1 parent b5cfd95 commit ec6a758
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion runners/google-cloud-dataflow-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ dependencies {
implementation project(path: ":sdks:java:core", configuration: "shadow")
implementation project(":sdks:java:extensions:avro")
implementation project(":sdks:java:extensions:google-cloud-platform-core")
implementation project(":sdks:java:io:kafka")
// io-kafka is only used in PTransform override so it is optional
provided project(":sdks:java:io:kafka")
implementation project(":sdks:java:io:google-cloud-platform")
implementation project(":runners:core-construction-java")
implementation library.java.avro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,13 @@ private List<PTransformOverride> getOverrides(boolean streaming) {
new StreamingPubsubIOWriteOverrideFactory(this)));
}

overridesBuilder.add(KafkaIO.Read.KAFKA_READ_OVERRIDE);
try {
overridesBuilder.add(KafkaIO.Read.KAFKA_READ_OVERRIDE);
} catch (NoClassDefFoundError e) {
// Do nothing. io-kafka is an optional dependency of runners-google-cloud-dataflow-java
// and only needed when KafkaIO is used in the pipeline.
}

overridesBuilder.add(SubscribeTransform.V1_READ_OVERRIDE);

if (!hasExperiment(options, "enable_file_dynamic_sharding")) {
Expand Down

0 comments on commit ec6a758

Please sign in to comment.