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

RabbitMqIO: NullPointerException raised on getWatermark() first call

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.11.0
    • Component/s: io-java-rabbitmq
    • Labels:
      None

      Description

      I tried to use the RabbitMqIO with the direct runner to generate an unbounded PCollection from a queue. I encounter a NPE :

      java.lang.NullPointerException
      {{ at org.apache.beam.runners.direct.UnboundedReadEvaluatorFactory$UnboundedReadEvaluator.processElement (UnboundedReadEvaluatorFactory.java:169)}}
      ....

      After investigation it looks like it's caused by the fact that no default is given to
      checkpointMark.oldestTimestamp. getWatermark() is called before the mutation of the currentTimestamp variable, raising a NPE. I fixed the problem on my side, reimplementing the class and overriding getWatermark to return Instant.now() if checkpointMark.oldestTimestamp is null :

      @Override
      publicInstantgetWatermark() {
      if (checkpointMark.oldestTimestamp == null)

      Unknown macro: { returnInstant.now(); }

      return checkpointMark.oldestTimestamp;
      }

      It looks likes this bug as already been raised here on the PR for RabbitMqIO.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jbonofre Jean-Baptiste Onofré
                Reporter:
                alafanechere Augustin Lafanechere
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m