Bird
0
0

How do you correctly obtain a ReadOnlyKeyValueStore named sessionStore from a Kafka Streams instance?

easy📝 Syntax Q3 of 15
Kafka - Advanced Stream Processing

How do you correctly obtain a ReadOnlyKeyValueStore named sessionStore from a Kafka Streams instance?

Astreams.store("sessionStore", QueryableStoreTypes.keyValueStore())
Bstreams.getStore("sessionStore", ReadOnlyKeyValueStore.class)
Cstreams.fetchStore("sessionStore", QueryableStoreTypes.keyValueStore())
Dstreams.retrieveStore("sessionStore")
Step-by-Step Solution
Solution:
  1. Step 1: Use the store method

    The correct method to access a state store is streams.store().
  2. Step 2: Specify the store name and type

    You must provide the store name and the store type using QueryableStoreTypes.keyValueStore() for a key-value store.
  3. Final Answer:

    streams.store("sessionStore", QueryableStoreTypes.keyValueStore()) -> Option A
  4. Quick Check:

    Method and type must match [OK]
Quick Trick: Use streams.store with QueryableStoreTypes [OK]
Common Mistakes:
MISTAKES
  • Using incorrect method names like getStore or fetchStore
  • Not specifying QueryableStoreTypes
  • Passing class types directly instead of QueryableStoreTypes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes