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

RabbitMqIO: NullPointerException raised on getWatermark() first call

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • None
    • 2.11.0
    • io-java-rabbitmq
    • 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

              jbonofre Jean-Baptiste Onofré
              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