Class KafkaStreamsInteractiveQueryService

java.lang.Object
org.springframework.kafka.streams.KafkaStreamsInteractiveQueryService

public class KafkaStreamsInteractiveQueryService extends Object
Provide a wrapper API around the interactive query stores in Kafka Streams. Using this API, an application can gain access to a named state store in the KafkaStreams under consideration.
Since:
3.2
Author:
Soby Chacko
  • Constructor Details

  • Method Details

    • setRetryTemplate

      public void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
      Custom RetryTemplate provided by the end users.
      Parameters:
      retryTemplate - RetryTemplate
    • retrieveQueryableStore

      public <T> T retrieveQueryableStore(String storeName, org.apache.kafka.streams.state.QueryableStoreType<T> storeType)
      Retrieve and return a queryable store by name created in the application.
      Type Parameters:
      T - generic type for the queryable store
      Parameters:
      storeName - name of the queryable store
      storeType - type of the queryable store
      Returns:
      queryable store.
    • getCurrentKafkaStreamsApplicationHostInfo

      @Nullable public org.apache.kafka.streams.state.HostInfo getCurrentKafkaStreamsApplicationHostInfo()
      Retrieve the current HostInfo where this Kafka Streams application is running on. This {link @HostInfo} is different from the Kafka `bootstrap.server` property, and is based on the Kafka Streams configuration property `application.server` where user-defined REST endpoints can be invoked per each Kafka Streams application instance. If this property - `application.server` - is not available from the end-user application, then null is returned.
      Returns:
      the current HostInfo
    • getKafkaStreamsApplicationHostInfo

      public <K> org.apache.kafka.streams.state.HostInfo getKafkaStreamsApplicationHostInfo(String store, K key, org.apache.kafka.common.serialization.Serializer<K> serializer)
      Retrieve the HostInfo where the provided store and key are hosted on. This may not be the current host that is running the application. Kafka Streams will look through all the consumer instances under the same application id and retrieves the proper host. Note that the end user applications must provide `application.server` as a configuration property for all the application instances when calling this method. If this is not available, then null maybe returned.
      Type Parameters:
      K - generic type for key
      Parameters:
      store - store name
      key - key to look for
      serializer - Serializer for the key
      Returns:
      the HostInfo where the key for the provided store is hosted currently