title: kafka client getting TOPIC_AUTHORIZATION_FAILED on cluster restart
body: <p>I am using an SSL enabled kafka cluster to connect to consumer and publish messages. Below is the tech stack.</p>
  <pre><code>spring-kafka : 2.6.6
  spring-boot  :  2.4.3
  </code></pre>
  <blockquote>
  <p>Kafka properties</p>
  </blockquote>
  <pre><code>kafka:
   bootstrap-servers: ${BOOTSTRAP-SERVERS-HOST}
   subscription-topic: TEST
   properties:
     security.protocol: SSL
     ssl.truststore.location: ${SUBSCRIPTION_TRUSTSTORE_PATH}
     ssl.truststore.password: ${SUBSCRIPTION_TRUSTSTORE_PWD}
     ssl.keystore.location: ${SUBSCRIPTION_KEYSTORE_PATH}
     ssl.keystore.password: ${SUBSCRIPTION_KEYSTORE_PWD}
  </code></pre>
  <p><strong>Issue:</strong>
  Kafka Client application is up connected to the kafka cluster consumer and publishing messages as expected.<br />
  Now  we stop the kafka broker/cluster below error is logged.</p>
  <pre><code>could not be established. Broker may not be available.
  </code></pre>
  <p>This is fine and expected as broker/cluster is down.</p>
  <p>Now We start the broker/cluster and below error start appearing and kafka consumer stops consuming messages from topic however kafka publisher is able to send message to the topic.  [application restart resolves this issue]</p>
  <p><em>Trying to understand the root cause any help is much appreciated.</em></p>
  <pre><code>2022-01-13 13:34:52.078 [TEST.CONSUMER-GROUP-0-C-1] ERROR--SUBSCRIPTION -  -org.apache.kafka.clients.Metadata.checkUnauthorizedTopics - [Consumer clientId=consumer-TEST.CONSUMER-GROUP-1, groupId=TEST.CONSUMER-GROUP] Topic authorization failed for topics [TEST]
  2022-01-13 13:34:52.078 [TEST.CONSUMER-GROUP-0-C-1] ERROR- -SUBSCRIPTION -  -org.springframework.core.log.LogAccessor.error - Authorization Exception and no authorizationExceptionRetryInterval set
  org.apache.kafka.common.errors.TopicAuthorizationException: Not authorized to access topics: [TEST]
  
  2022-01-13 13:34:52.081 [TEST.CONSUMER-GROUP-0-C-1] ERROR- IRVS-SUBSCRIPTION -  -org.springframework.core.log.LogAccessor.error - Fatal consumer exception; stopping container
  2022-01-13 13:34:52.083 [TEST.CONSUMER-GROUP-0-C-1] INFO - IRVS-SUBSCRIPTION -  -org.springframework.scheduling.concurrent.ExecutorConfigurationSupport.shutdown - Shutting down ExecutorService
  </code></pre>