Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2018-2024 OVO Energy Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
package fs2.kafka
import scala.concurrent.duration.*
import cats.Show
import fs2.kafka.security.KafkaCredentialStore
import org.apache.kafka.clients.admin.AdminClientConfig
/**
* [[AdminClientSettings]] contain settings necessary to create a [[KafkaAdminClient]]. Several
* convenience functions are provided so that you don't have to work with `String` values and keys
* from `AdminClientConfig`. It's still possible to set `AdminClientConfig` values with functions
* like [[withProperty]].
*
* [[AdminClientSettings]] instances are immutable and all modification functions return a new
* [[AdminClientSettings]] instance.
*
* Use [[AdminClientSettings#apply]] for the default settings, and then apply any desired
* modifications on top of that instance.
*/
sealed abstract class AdminClientSettings {
/**
* Properties which can be provided when creating a Java `KafkaAdminClient` instance. Numerous
* functions in [[AdminClientSettings]] add properties here if the settings are used by the Java
* `KafkaAdminClient`.
*/
def properties: Map[String, String]
/**
* Returns a new [[AdminClientSettings]] instance with the specified bootstrap servers. This is
* equivalent to setting the following property using the [[withProperty]] function.
*
* {{{
* AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG
* }}}
*/
def withBootstrapServers(bootstrapServers: String): AdminClientSettings
/**
* Returns a new [[AdminClientSettings]] instance with the specified client id. This is
* equivalent to setting the following property using the [[withProperty]] function.
*
* {{{
* AdminClientConfig.CLIENT_ID_CONFIG
* }}}
*/
def withClientId(clientId: String): AdminClientSettings
/**
* Returns a new [[AdminClientSettings]] instance with the specified reconnect backoff. This is
* equivalent to setting the following property using the [[withProperty]] function, except you
* can specify it with a `FiniteDuration` instead of a `String`.
*
* {{{
* AdminClientConfig.RECONNECT_BACKOFF_MS_CONFIG
* }}}
*/
def withReconnectBackoff(reconnectBackoff: FiniteDuration): AdminClientSettings
/**
* Returns a new [[AdminClientSettings]] instance with the specified max reconnect backoff. This
* is equivalent to setting the following property using the [[withProperty]] function, except
* you can specify it with a `FiniteDuration` instead of a `String`.
*
* {{{
* AdminClientConfig.RECONNECT_BACKOFF_MAX_MS_CONFIG
* }}}
*/
def withReconnectBackoffMax(reconnectBackoffMax: FiniteDuration): AdminClientSettings
/**
* Returns a new [[AdminClientSettings]] instance with the specified retry backoff. This is
* equivalent to setting the following property using the [[withProperty]] function, except you
* can specify it with a `FiniteDuration` instead of a `String`.
*
* {{{
* AdminClientConfig.RETRY_BACKOFF_MS_CONFIG
* }}}
*/
def withRetryBackoff(retryBackoff: FiniteDuration): AdminClientSettings
/**
* Returns a new [[AdminClientSettings]] instance with the specified max connection idle time.
* This is equivalent to setting the following property using the [[withProperty]] function,
* except you can specify it with a `FiniteDuration` instead of a `String`.
*
* {{{
* AdminClientConfig.CONNECTIONS_MAX_IDLE_MS_CONFIG
* }}}
*/
def withConnectionsMaxIdle(connectionsMaxIdle: FiniteDuration): AdminClientSettings
/**
* Returns a new [[AdminClientSettings]] instance with the specified request timeout. This is
* equivalent to setting the following property using the [[withProperty]] function, except you
* can specify it with a `FiniteDuration` instead of a `String`.
*
* {{{
* AdminClientConfig.REQUEST_TIMEOUT_MS_CONFIG
* }}}
*/
def withRequestTimeout(requestTimeout: FiniteDuration): AdminClientSettings
/**
* Returns a new [[AdminClientSettings]] instance with the specified max metadata age. This is
* equivalent to setting the following property using the [[withProperty]] function, except you
* can specify it with a `FiniteDuration` instead of a `String`.
*
* {{{
* AdminClientConfig.METADATA_MAX_AGE_CONFIG
* }}}
*/
def withMetadataMaxAge(metadataMaxAge: FiniteDuration): AdminClientSettings
/**
* Returns a new [[AdminClientSettings]] instance with the specified retries. This is equivalent
* to setting the following property using the [[withProperty]] function, except you can specify
* it with an `Int` instead of a `String`.
*
* {{{
* AdminClientConfig.RETRIES_CONFIG
* }}}
*/
def withRetries(retries: Int): AdminClientSettings
/**
* Includes a property with the specified `key` and `value`. The key should be one of the keys in
* `AdminClientConfig`, and the value should be a valid choice for the key.
*/
def withProperty(key: String, value: String): AdminClientSettings
/**
* Includes the specified keys and values as properties. The keys should be part of the
* `AdminClientConfig` keys, and the values should be valid choices for the keys.
*/
def withProperties(properties: (String, String)*): AdminClientSettings
/**
* Includes the specified keys and values as properties. The keys should be part of the
* `AdminClientConfig` keys, and the values should be valid choices for the keys.
*/
def withProperties(properties: Map[String, String]): AdminClientSettings
/**
* The time to wait for the Java `KafkaAdminClient` to shutdown.