title: KafkaTemplate Producer error unwanted red highlighting using Intellij
body: <p>I'm using Intellij to run a springboot app using Kafka. I am new to java and kafka so please bare with me. The problem might be Intellij I'm not sure but the line with
  --- kafkaTemplate.send(&quot;t_hello&quot; + name);-- Is under lined red and when i hover over it i get this message &quot;Cannot resolve method 'send(java.lang.String)&quot; Does anyone know how to get rid of the Darn Red underline. The app does not send the the message, it just gives me a red line error that I cant get rid of. The bottom of the output should have the message Hello Timotius and a random number</p>
  <pre><code>package com.course.kafkaproducer.producer;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.kafka.core.KafkaTemplate;
  import org.springframework.stereotype.Service;
  
  @Service
  public class HelloKafkaProducer {
  
      @Autowired
      private KafkaTemplate&lt;String, String&gt; kafkaTemplate;
      public void sendHello(String name) {
          kafkaTemplate.send(&quot;t_hello&quot; + name);
      }
  }
  </code></pre>
  <pre><code>package com.course.kafkaproducer;
  
  import com.course.kafkaproducer.producer.HelloKafkaProducer;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.boot.CommandLineRunner;
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class KafkaProducerApplication implements CommandLineRunner {
  
      @Autowired
      private HelloKafkaProducer helloKafkaProducer;
  
      public static void main(String[] args) {
          SpringApplication.run(KafkaProducerApplication.class, args);
      }
  
      @Override
      public void run(String... args) throws Exception {
          helloKafkaProducer.sendHello(&quot;Timotius&quot; + Math.random());
      }
  }
  
  </code></pre>
  <p>The POM</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.3.1.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;com.course&lt;/groupId&gt;
      &lt;artifactId&gt;kafka-producer&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;kafka-producer&lt;/name&gt;
      &lt;description&gt;Kafka producer&lt;/description&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;14&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.kafka&lt;/groupId&gt;
              &lt;artifactId&gt;spring-kafka&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.junit.vintage&lt;/groupId&gt;
                      &lt;artifactId&gt;junit-vintage-engine&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.kafka&lt;/groupId&gt;
              &lt;artifactId&gt;spring-kafka-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-jpa&lt;/artifactId&gt;
              &lt;version&gt;2.3.1.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  
  </code></pre>
  <p>the out put is:</p>
  <pre><code>com.course.kafkaconsumer.KafkaConsumerApplication
  OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
  
    .   ____          _            __ _ _
   /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
  ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
   \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
    '  |____| .__|_| |_|_| |_\__, | / / / /
   =========|_|==============|___/=/_/_/_/
   :: Spring Boot ::        (v2.3.1.RELEASE)
  
  2020-06-27 18:25:08.418  INFO 73588 --- [           main] c.c.k.KafkaConsumerApplication           : Starting KafkaConsumerApplication on justins-MacBook-Pro-2.local with PID 73588 (/Users/justinmeskan/Downloads/kafkaJustin/kafka-consumer/target/classes started by justinmeskan in /Users/justinmeskan/Downloads/kafkaJustin)
  2020-06-27 18:25:08.420  INFO 73588 --- [           main] c.c.k.KafkaConsumerApplication           : No active profile set, falling back to default profiles: default
  2020-06-27 18:25:09.502  INFO 73588 --- [           main] o.a.k.clients.consumer.ConsumerConfig    : ConsumerConfig values: 
      allow.auto.create.topics = true
      auto.commit.interval.ms = 5000
      auto.offset.reset = latest
      bootstrap.servers = [localhost:9092]
      check.crcs = true
      client.dns.lookup = default
      client.id = 
      client.rack = 
      connections.max.idle.ms = 540000
      default.api.timeout.ms = 60000
      enable.auto.commit = false
      exclude.internal.topics = true
      fetch.max.bytes = 52428800
      fetch.max.wait.ms = 500
      fetch.min.bytes = 1
      group.id = default-spring-consumer
      group.instance.id = null
      heartbeat.interval.ms = 3000
      interceptor.classes = []
      internal.leave.group.on.close = true
      isolation.level = read_uncommitted
      key.deserializer = class org.apache.kafka.common.serialization.StringDeserializer
      max.partition.fetch.bytes = 1048576
      max.poll.interval.ms = 300000
      max.poll.records = 500
      metadata.max.age.ms = 300000
      metric.reporters = []
      metrics.num.samples = 2
      metrics.recording.level = INFO
      metrics.sample.window.ms = 30000
      partition.assignment.strategy = [class org.apache.kafka.clients.consumer.RangeAssignor]
      receive.buffer.bytes = 65536
      reconnect.backoff.max.ms = 1000
      reconnect.backoff.ms = 50
      request.timeout.ms = 30000
      retry.backoff.ms = 100
      sasl.client.callback.handler.class = null
      sasl.jaas.config = null
      sasl.kerberos.kinit.cmd = /usr/bin/kinit
      sasl.kerberos.min.time.before.relogin = 60000
      sasl.kerberos.service.name = null
      sasl.kerberos.ticket.renew.jitter = 0.05
      sasl.kerberos.ticket.renew.window.factor = 0.8
      sasl.login.callback.handler.class = null
      sasl.login.class = null
      sasl.login.refresh.buffer.seconds = 300
      sasl.login.refresh.min.period.seconds = 60
      sasl.login.refresh.window.factor = 0.8
      sasl.login.refresh.window.jitter = 0.05
      sasl.mechanism = GSSAPI
      security.protocol = PLAINTEXT
      security.providers = null
      send.buffer.bytes = 131072
      session.timeout.ms = 10000
      ssl.cipher.suites = null
      ssl.enabled.protocols = [TLSv1.2]
      ssl.endpoint.identification.algorithm = https
      ssl.key.password = null
      ssl.keymanager.algorithm = SunX509
      ssl.keystore.location = null
      ssl.keystore.password = null
      ssl.keystore.type = JKS
      ssl.protocol = TLSv1.2
      ssl.provider = null
      ssl.secure.random.implementation = null
      ssl.trustmanager.algorithm = PKIX
      ssl.truststore.location = null
      ssl.truststore.password = null
      ssl.truststore.type = JKS
      value.deserializer = class org.apache.kafka.common.serialization.StringDeserializer
  
  2020-06-27 18:25:09.579  INFO 73588 --- [           main] o.a.kafka.common.utils.AppInfoParser     : Kafka version: 2.5.0
  2020-06-27 18:25:09.581  INFO 73588 --- [           main] o.a.kafka.common.utils.AppInfoParser     : Kafka commitId: 66563e712b0b9f84
  2020-06-27 18:25:09.581  INFO 73588 --- [           main] o.a.kafka.common.utils.AppInfoParser     : Kafka startTimeMs: 1593307509575
  2020-06-27 18:25:09.586  INFO 73588 --- [           main] o.a.k.clients.consumer.KafkaConsumer     : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Subscribed to topic(s): t_hello
  2020-06-27 18:25:09.588  INFO 73588 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService
  2020-06-27 18:25:09.605  INFO 73588 --- [           main] c.c.k.KafkaConsumerApplication           : Started KafkaConsumerApplication in 1.691 seconds (JVM running for 2.803)
  2020-06-27 18:25:10.123  INFO 73588 --- [ntainer#0-0-C-1] org.apache.kafka.clients.Metadata        : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Cluster ID: Xyqqb0-GSmeTFFgfgPfuGw
  2020-06-27 18:25:10.130  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Discovered group coordinator 127.0.0.1:9092 (id: 2147483646 rack: null)
  2020-06-27 18:25:10.139  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] (Re-)joining group
  2020-06-27 18:25:10.196  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Join group failed with org.apache.kafka.common.errors.MemberIdRequiredException: The group member needs to have a valid member id before actually entering a consumer group
  2020-06-27 18:25:10.196  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] (Re-)joining group
  2020-06-27 18:25:10.221  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Finished assignment for group at generation 1: {consumer-default-spring-consumer-1-d7748fca-38eb-4a75-97fc-64c0b145d290=Assignment(partitions=[t_hello-0])}
  2020-06-27 18:25:10.241  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Successfully joined group with generation 1
  2020-06-27 18:25:10.245  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Adding newly assigned partitions: t_hello-0
  2020-06-27 18:25:10.257  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Found no committed offset for partition t_hello-0
  2020-06-27 18:25:10.269  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Found no committed offset for partition t_hello-0
  2020-06-27 18:25:10.294  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.SubscriptionState    : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Resetting offset for partition t_hello-0 to offset 0.
  2020-06-27 18:25:10.314  INFO 73588 --- [ntainer#0-0-C-1] o.s.k.l.KafkaMessageListenerContainer    : default-spring-consumer: partitions assigned: [t_hello-0]
  2020-06-27 18:27:43.424  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Attempt to heartbeat failed since coordinator 127.0.0.1:9092 (id: 2147483646 rack: null) is either not started or not valid
  2020-06-27 18:27:43.424  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Group coordinator 127.0.0.1:9092 (id: 2147483646 rack: null) is unavailable or invalid, will attempt rediscovery
  2020-06-27 18:27:45.152  INFO 73588 --- [spring-consumer] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Discovered group coordinator 127.0.0.1:9092 (id: 2147483646 rack: null)
  2020-06-27 18:27:45.166  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Attempt to heartbeat failed for since member id consumer-default-spring-consumer-1-d7748fca-38eb-4a75-97fc-64c0b145d290 is not valid.
  2020-06-27 18:27:45.167  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Giving away all assigned partitions as lost since generation has been reset,indicating that consumer is no longer part of the group
  2020-06-27 18:27:45.167  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Lost previously assigned partitions t_hello-0
  2020-06-27 18:27:45.167  INFO 73588 --- [ntainer#0-0-C-1] o.s.k.l.KafkaMessageListenerContainer    : default-spring-consumer: partitions lost: [t_hello-0]
  2020-06-27 18:27:45.167  INFO 73588 --- [ntainer#0-0-C-1] o.s.k.l.KafkaMessageListenerContainer    : default-spring-consumer: partitions revoked: [t_hello-0]
  2020-06-27 18:27:45.168  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] (Re-)joining group
  2020-06-27 18:27:45.174  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Join group failed with org.apache.kafka.common.errors.MemberIdRequiredException: The group member needs to have a valid member id before actually entering a consumer group
  2020-06-27 18:27:45.175  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] (Re-)joining group
  2020-06-27 18:27:45.183  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Finished assignment for group at generation 1: {consumer-default-spring-consumer-1-9449779f-5ce7-4139-8bf8-20ddfb75e8f7=Assignment(partitions=[t_hello-0])}
  2020-06-27 18:27:45.190  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Successfully joined group with generation 1
  2020-06-27 18:27:45.191  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Adding newly assigned partitions: t_hello-0
  2020-06-27 18:27:45.194  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Found no committed offset for partition t_hello-0
  2020-06-27 18:27:45.198  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Found no committed offset for partition t_hello-0
  2020-06-27 18:27:45.656  INFO 73588 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.SubscriptionState    : [Consumer clientId=consumer-default-spring-consumer-1, groupId=default-spring-consumer] Resetting offset for partition t_hello-0 to offset 0.
  2020-06-27 18:27:45.670  INFO 73588 --- [ntainer#0-0-C-1] o.s.k.l.KafkaMessageListenerContainer    : default-spring-consumer: partitions assigned: [t_hello-0]
  
  </code></pre>