Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-3754

KAFKA - Can't set commitOffsetsInFinalizeEnabled to false with KafkaIO.readBytes()

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0
    • io-java-kafka
    • 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

          Activity

            People

              rangadi Raghu Angadi
              benjben Benjamin BENOIST (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Time Spent - 0.5h Remaining Estimate - 1.5h
                  1.5h
                  Logged:
                  Time Spent - 0.5h Remaining Estimate - 1.5h
                  0.5h