Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Tidy up getting client instance ids

...

Code Block
/**
 * @return the client's assigned instance id used for metrics collection.
 * @throws TimeoutException      Indicates that a request timed out
 */
public StringUuid clientInstanceId(Duration timeout);

...

Code Block
/**
 * @return the clients' assigned instance ids used for metrics collection.
 * @throws StreamsNotRunningException  Indicates that Kafka Streams is not running.
 * @throws TimeoutException            Indicates that a request timed out
 */
public ClientInstanceIds clientInstanceIds(Duration timeout);

This method is only permitted when Kafka Streams is in state RUNNING or REBALANCING. In the event that Kafka Streams is not in state RUNNING or REBALANCING, the method throws org.apache.kafka.streams.errors.StreamsNotRunningException , which is a new subclass of InvalidStateStoreException .

In the event that any of the client instance ids cannot be obtained within the timeout, the method throws org.apache.kafka.common.errors.TimeoutException .

...

Code Block
/**
 * Encapsulates the client instance ids used for metrics collection by
 * producers, consumers and admin clients used by Kafka Streams.
 */
public class ClientInstanceIds {
  /**
   * Get the client instance id of the admin client
   *
   * @return the client instance id 
   */
  StringUuid adminInstanceId();

  /**
   * Get the client instance ids of the consumers
   *
   * @return a map from thread key to client instance id
   */
  Map<String, String>Uuid> consumerInstanceIds();

  /**
   * Get the client instance ids of the producers
   *
   * @return a map from thread key to client instance id
   */
  Map<String, String>Uuid> producerInstanceIds();
}

Broker configuration

...