Details
-
Bug
-
Status: Resolved
-
P3
-
Resolution: Fixed
-
2.3.0
-
Dataflow pipeline using Kafka as a Sink
-
Patch
Description
Beam v2.3 introduces finalized offsets, in order to reduce the gaps or duplicate processing of records while restarting a pipeline.
read() sets this parameter to false by default but readBytes() doesn't, thus creating an exception:
Exception in thread "main" java.lang.IllegalStateException: Missing required properties: commitOffsetsInFinalizeEnabled at org.apache.beam.sdk.io.kafka.AutoValue_KafkaIO_Read$Builder.build(AutoValue_KafkaIO_Read.java:344) at org.apache.beam.sdk.io.kafka.KafkaIO.readBytes(KafkaIO.java:291)
The parameter can be set to true with commitOffsetsInFinalize() but never to false.
Using read() in the definition of readBytes() could prevent this kind of error in the future:
public static Read<byte[], byte[]> readBytes() { return read() .setKeyDeserializer(ByteArrayDeserializer.class) .setValueDeserializer(ByteArrayDeserializer.class) .build(); }
Attachments
Issue Links
- links to