title: kafka streams store not accesible after rebalance
body: <p>I'm new to kafka streams and faced a problem with Kafka Streams Store. It looks like store is not accesible after rebalancing. Here's my sample code:</p>
  <pre><code>@Bean
  public KafkaStreams kafkaStreams(StreamsBuilder streamsBuilder, KafkaStreamsConfiguration kafkaStreamsConfiguration) {
  
      KStream&lt;String, String&gt; inputTopic = streamsBuilder.stream(&quot;test-topic&quot;);
  
      inputTopic.filter(
          (key, value) -&gt; value.contains(&quot;test&quot;)
      ).toTable(Materialized.&lt;String, String, KeyValueStore&lt;Bytes, byte[]&gt;&gt; as(&quot;test-store&quot;));
  
      KafkaStreams streams = new KafkaStreams(streamsBuilder.build(), kafkaStreamsConfiguration.asProperties());
      streams.cleanUp();
      streams.start();
      return streams;
  }
  </code></pre>
  <pre><code>@Component
  @AllArgsConstructor
  public class TestKafkaStore {
  
      private final KafkaStreams kafkaStreams;
  
      public void readKafka() {
          final ReadOnlyKeyValueStore&lt;String, String&gt; keyValueStore =
              kafkaStreams.store(StoreQueryParameters.fromNameAndType(&quot;test-store&quot;, QueryableStoreTypes.keyValueStore()));
      }
  }
  </code></pre>
  <p>I'm able to access the store and read values from keyValueStore, but after rebalance</p>
  <pre><code>2021-12-09 00:16:52,968 INFO org.apache.kafka.streams.KafkaStreams [test-stream-a8da1f15-1742-4256-8515-f36de8eae941-StreamThread-1] [] stream-client [test-stream-a8da1f15-1742-4256-8515-f36de8eae941] State transition from RUNNING to REBALANCING
  2021-12-09 00:16:53,032 INFO org.apache.kafka.streams.KafkaStreams [test-stream-621d13d3-78cf-413e-b6cc-3e46f24bf731-StreamThread-1] [] stream-client [test-stream-621d13d3-78cf-413e-b6cc-3e46f24bf731] State transition from REBALANCING to RUNNING
  </code></pre>
  <p>when I'm trying to run readKafka() again i'm getting error:</p>
  <pre><code>org.apache.kafka.streams.errors.InvalidStateStoreException: The state store, test-store, may have migrated to another instance.
      at org.apache.kafka.streams.state.internals.QueryableStoreProvider.getStore(QueryableStoreProvider.java:76)
      at org.apache.kafka.streams.KafkaStreams.store(KafkaStreams.java:1202)
  </code></pre>