You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/antora/modules/ROOT/pages/streams.adoc
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -365,6 +365,28 @@ When calling this method, the user can specifially ask for the proper state stor
365
365
366
366
NOTE: `KafkaStreamsInteractiveQueryService` API in Spring for Apache Kafka only supports providing access to local key-value stores at the moment.
367
367
368
+
==== Retrying State Store Retrieval
369
+
370
+
When trying to retrieve the state store using the `KafkaStreamsInteractiveQueryService`, there is a chance that the state store might not be found for various reasons.
371
+
If those reasons are transitory, `KafkaStreamsInteractiveQueryService` provides an option to retry the retrieval of the state store by allowing to inject a custom `RetryTemplate`.
372
+
By default, the `RetryTemmplate` that is used in `KafkaStreamsInteractiveQueryService` uses a maximum attempts of three with a fixed backoff of one second.
373
+
374
+
Here is how you can inject a custom `RetryTemmplate` into `KafkaStreamsInteractiveQueryService` with the maximum attempts of ten.
375
+
376
+
[source, java]
377
+
----
378
+
@Bean
379
+
public KafkaStreamsInteractiveQueryService kafkaStreamsInteractiveQueryService(StreamsBuilderFactoryBean streamsBuilderFactoryBean) {
380
+
final KafkaStreamsInteractiveQueryService kafkaStreamsInteractiveQueryService =
381
+
new KafkaStreamsInteractiveQueryService(streamsBuilderFactoryBean);
382
+
RetryTemplate retryTemplate = new RetryTemplate();
0 commit comments