Skip to content

Continued consumption with next event after exception was thrown #346

@ePaul

Description

@ePaul

We are using nakadi-java-client 0.9.17.

We've observed a problematic case where we had two events in the same partition.
Due to batch size of 1, they will be both handed to the StreamObserver's onNext() method in separate batches.
The processing of the first event caused an exception (in our code), which was logged by nakadi-java as StreamBatchRecordSubscriber.detected_retryable_exception, without committing any cursor changes.

But then the StreamObserver's onNext() method was called again, with the second event (in a new 1-event batch). (We have the max_uncommitted_events at a higher setting than 1 – the default is 10, I think.) This one could be processed without problems, and our code committed the cursor. As the new cursor was after the first one, we now got both events committed, and Nakadi won't resend either of them. The first failed event is effectively lost now.

This seems not to happen if there is no later event in the partition – then the first event is retried a bit later.

(I didn't succeed to dig into nakadi-java's code to see what is happening when a retryable exception is caught and more events are available on the same partition.)

Is this behavior expected? What should we have done differently?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions