Uploaded image for project: 'Samza'
  1. Samza
  2. SAMZA-935

hello-samza add kafka wait for dependent services

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.1
    • Component/s: hello-samza
    • Labels:

      Description

      When working with a modified bin/grid script found in https://github.com/theduderog/hello-samza-confluent we found that attempting to start confluent's schemaregistry service immediately after starting the other services resulted in failure since schemaregistry is dependent on kafka which takes a couple seconds to start up.

      Would it make sense to add a wait option for kafka like we have added here: https://github.com/theduderog/hello-samza-confluent/blob/master/bin/grid#L118-L132 ?

      wait_kafka() {
        echo "Waiting for kafka broker to start..."
        until $(nc -w 2 localhost 9092); do
          printf '.'
          sleep 1
        done
        printf '\n'
        echo "Kafka broker is listening";
      }
      

      This way, dependent services started right after ./bin/grid bootsrap won't fail intermittently.

      I don't mind adding this if it can be considered useful.

        Attachments

        1. diff4.patch
          2 kB
          Vishal Kuo
        2. diff3.patch
          2 kB
          Vishal Kuo
        3. SAMZA-935.patch
          1 kB
          Vishal Kuo

          Activity

            People

            • Assignee:
              vishalkuo Vishal Kuo
              Reporter:
              vishalkuo Vishal Kuo
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: