Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-10315

Consider to throw exception for failed fetch requests

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • consumer

    Description

      The current `Consumer#poll(Duration)` method is designed to block until data is available or the provided poll timeout expires. This implies, that if fetch requests fail the consumer retries them internally and eventually returns an empty set of records. – Thus, from a user point of view, returning an empty set of records can mean that no data is available broker side or that the broker cannot be reached.

      For Kafka Streams, this behavior is problematic as its runtime would like to distinguish both cases, to apply its own timeouts (cf https://issues.apache.org/jira/browse/KAFKA-9274).

      One idea to address this issue is to add a new method `Consumer#pollOnce()` that would throw an exception if a fetch request fails instead of retrying internally.

      Attachments

        Issue Links

          Activity

            People

              showuon Luke Chen
              mjsax Matthias J. Sax
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: