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

Move the decoding logic from ConsumerIterator.makeNext to next

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.1
    • Component/s: None
    • Labels:
      None

      Description

      Usually people will write code around consumer like

      while(iter.hasNext()) {
      try {
      msg = iter.next()
      // do something
      }
      catch{
      }
      }


      However, the iter.hasNext() call itself can throw exceptions due to decoding failures. It would be better to move the decoding to the next function call.

        Attachments

        1. KAFKA-1140.patch
          8 kB
          Guozhang Wang
        2. KAFKA-1140_2013-11-25_12:53:17.patch
          10 kB
          Guozhang Wang
        3. KAFKA-1140_2013-11-25_12:55:34.patch
          10 kB
          Guozhang Wang
        4. KAFKA-1140_2013-11-26_14:41:00.patch
          18 kB
          Guozhang Wang
        5. KAFKA-1140_2013-11-26_18:29:53.patch
          4 kB
          Guozhang Wang

          Activity

            People

            • Assignee:
              guozhang Guozhang Wang
              Reporter:
              guozhang Guozhang Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: