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

Consider moving validation in KafkaConsumer ahead of call to acquireAndEnsureOpen()

Agile BoardAttach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.0
    • None
    • None

    Description

      In several methods, parameter validation is done after calling acquireAndEnsureOpen() :

          public void seek(TopicPartition partition, long offset) {
              acquireAndEnsureOpen();
              try {
                  if (offset < 0)
                      throw new IllegalArgumentException("seek offset must not be a negative number");
      

      Since the value of parameter would not change per invocation, it seems performing validation ahead of acquireAndEnsureOpen() call would be better.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            sssanthalingam siva santhalingam
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment