Closed hanrw closed 6 years ago
The issue with here. If we have two streams A stream store name a-store B stream store name b-store
We are going to query b-store but we got A stream in the loop but A-stream.store(b-store, storeType) not return null
public <T> T getQueryableStoreType(String storeName, QueryableStoreType<T> storeType) {
for (KafkaStreams kafkaStream : kafkaStreams) {
T store = kafkaStream.store(storeName, storeType);
if (store != null) {
return store;
}
}
return null;
}
instead of thow InvalidStateStoreException in QueryableStoreProvider
if (allStores.isEmpty()) {
throw new InvalidStateStoreException("the state store, " + storeName + ", may have migrated to another instance.");
}
I have two classes UserRegisterStoreController and GameTransactionStoreController in the same project But only one can got data random from queryableStoreRegistry and got exception Seems that QueryableStoreRegistry could bind one instance?
Exception
btw if the classes are in different projects, no exceptions and it works.
Reproduce codes on https://github.com/MadeInChina/spring-cloud-streams-kafka-streams-example