spring-cloud / spring-cloud-stream-binder-kafka

Spring Cloud Stream binders for Apache Kafka and Kafka Streams
Apache License 2.0
331 stars 301 forks source link

#1161 Make InteractiveQueryService respect Streams context #1169

Closed nico-javadev closed 2 years ago

nico-javadev commented 2 years ago

This PR Safe Guards State Store Instances in case there are multiple KafkaStreams instances present that have distinct application IDs but share State Store Names.

Change is backwards compatible: in case no KafkaStreams association of the Thread can be found, all Local State Stores are queried as before. In case an associated KafkaStreams Instance is found, but required StateStore is not found in this instance, a Warning is issued but backwards compatibility is preserved by looking up all State Stores.

The main benefit here is to get rid of randomly selecting stores across all KafkaStreams instances in case a store is contained within multiple Streams Instances with same name.

Fixes #1161

nico-javadev commented 2 years ago

@sobychacko : Sorry for the hazzle with Git. Did some mistake initially when forking the repo which I had to reset now

sobychacko commented 2 years ago

Thank you @nico-javadev for re-submitting the PR. Looks good to me and this is now merged upstream, after squashing the commits and some polishing on the commit message. I also backported the changes to the 3.1.x branch. You are welcome to contribute more PR's!

nico-javadev commented 2 years ago

@sobychacko 👍