title: InvalidGroupIdException: in Kafka scala consumer program even after setting group.id
body: <p>I am facing the </p>
  
  <blockquote>
    <p>org.apache.kafka.common.errors.InvalidGroupIdException: To use the
    group management or offset commit APIs, you must provide a valid
    group.id in the consumer configuration.</p>
  </blockquote>
  
  <p>error when running the below kafka consumer API from command line written in scala. what could be be the issue?</p>
  
  <pre><code>    object KafkaAggregateConsumerApp extends App{
    try {
      val properties: Properties = new Properties()
      properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "0:9092") 
  properties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer")
  properties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.IntegerDeserializer")
      properties.put("group.id", "console-consumer-myapp")
  
      val consumerApp = new KafkaConsumer[String, Int](properties)
      consumerApp.subscribe(Pattern.compile("kafkaaggregationsource1"))
  
      try {
        while (true) {
          val consumerRecord: ConsumerRecords[String, Int] = consumerApp.poll(Duration.ofMinutes(10))
          consumerRecord.forEach((each) =&gt; println(each.key() + " " + each.value()))
        }
      } finally {
        consumerApp.close()
      }
    }
    catch{
      case e: Exception =&gt; e.printStackTrace()
    }
  }
  </code></pre>