pub struct AdminClientConfig { /* private fields */ }Expand description
The AdminClient configuration class, which also contains constants for configuration entry names.
Implementations§
Source§impl AdminClientConfig
impl AdminClientConfig
Sourcepub const BOOTSTRAP_SERVERS_CONFIG: &'static str = "bootstrap.servers"
pub const BOOTSTRAP_SERVERS_CONFIG: &'static str = "bootstrap.servers"
bootstrap.servers
Sourcepub const BOOTSTRAP_CONTROLLERS_CONFIG: &'static str = "bootstrap.controllers"
pub const BOOTSTRAP_CONTROLLERS_CONFIG: &'static str = "bootstrap.controllers"
bootstrap.controllers (KIP-919): a list of host/port pairs to use for
establishing the initial connection to the KRaft controller quorum. This
list should be in the form host1:port1,host2:port2,....
Set it in place of bootstrap.servers: the client then talks to the
controllers directly, and fails at once every call the controllers
cannot serve. Setting both, or neither, fails client creation, as
Java’s KafkaAdminClient.determineBootstrapType does.
Sourcepub const CLIENT_DNS_LOOKUP_CONFIG: &'static str = CommonClientConfigs::CLIENT_DNS_LOOKUP_CONFIG
pub const CLIENT_DNS_LOOKUP_CONFIG: &'static str = CommonClientConfigs::CLIENT_DNS_LOOKUP_CONFIG
client.dns.lookup
Sourcepub const CLIENT_ID_CONFIG: &'static str = "client.id"
pub const CLIENT_ID_CONFIG: &'static str = "client.id"
client.id
Sourcepub const REQUEST_TIMEOUT_MS_CONFIG: &'static str = "request.timeout.ms"
pub const REQUEST_TIMEOUT_MS_CONFIG: &'static str = "request.timeout.ms"
request.timeout.ms
Sourcepub const DEFAULT_API_TIMEOUT_MS_CONFIG: &'static str = "default.api.timeout.ms"
pub const DEFAULT_API_TIMEOUT_MS_CONFIG: &'static str = "default.api.timeout.ms"
default.api.timeout.ms
Sourcepub const RETRIES_CONFIG: &'static str = "retries"
pub const RETRIES_CONFIG: &'static str = "retries"
retries
Sourcepub const RETRY_BACKOFF_MS_CONFIG: &'static str = "retry.backoff.ms"
pub const RETRY_BACKOFF_MS_CONFIG: &'static str = "retry.backoff.ms"
retry.backoff.ms
Sourcepub const RETRY_BACKOFF_MAX_MS_CONFIG: &'static str = "retry.backoff.max.ms"
pub const RETRY_BACKOFF_MAX_MS_CONFIG: &'static str = "retry.backoff.max.ms"
retry.backoff.max.ms
Sourcepub const BOOTSTRAP_RESOLVE_TIMEOUT_MS_CONFIG: &'static str = CommonClientConfigs::BOOTSTRAP_RESOLVE_TIMEOUT_MS_CONFIG
pub const BOOTSTRAP_RESOLVE_TIMEOUT_MS_CONFIG: &'static str = CommonClientConfigs::BOOTSTRAP_RESOLVE_TIMEOUT_MS_CONFIG
bootstrap.resolve.timeout.ms (KIP-909): 0 (the default) resolves
bootstrap.servers synchronously when the client is created; a
positive value resolves asynchronously, retrying for at most this long.
Sourcepub const RECONNECT_BACKOFF_MS_CONFIG: &'static str = "reconnect.backoff.ms"
pub const RECONNECT_BACKOFF_MS_CONFIG: &'static str = "reconnect.backoff.ms"
reconnect.backoff.ms
Sourcepub const RECONNECT_BACKOFF_MAX_MS_CONFIG: &'static str = "reconnect.backoff.max.ms"
pub const RECONNECT_BACKOFF_MAX_MS_CONFIG: &'static str = "reconnect.backoff.max.ms"
reconnect.backoff.max.ms
Sourcepub const CONNECTIONS_MAX_IDLE_MS_CONFIG: &'static str = "connections.max.idle.ms"
pub const CONNECTIONS_MAX_IDLE_MS_CONFIG: &'static str = "connections.max.idle.ms"
connections.max.idle.ms
Sourcepub const METADATA_MAX_AGE_CONFIG: &'static str = "metadata.max.age.ms"
pub const METADATA_MAX_AGE_CONFIG: &'static str = "metadata.max.age.ms"
metadata.max.age.ms
Sourcepub const SOCKET_CONNECTION_SETUP_TIMEOUT_MS_CONFIG: &'static str = "socket.connection.setup.timeout.ms"
pub const SOCKET_CONNECTION_SETUP_TIMEOUT_MS_CONFIG: &'static str = "socket.connection.setup.timeout.ms"
socket.connection.setup.timeout.ms
Sourcepub const METADATA_CLUSTER_CHECK_ENABLE_CONFIG: &'static str = CommonClientConfigs::METADATA_CLUSTER_CHECK_ENABLE_CONFIG
pub const METADATA_CLUSTER_CHECK_ENABLE_CONFIG: &'static str = CommonClientConfigs::METADATA_CLUSTER_CHECK_ENABLE_CONFIG
metadata.cluster.check.enable (KIP-1242).
Whether the client should send cluster and node information when
connecting to a broker to enable it to check for a misrouted
connection. This configuration is ignored if rebootstrapping is
disabled by setting the configuration metadata.recovery.strategy=none.
If the client is connecting to a broker older than Apache Kafka 4.4, no
checking is performed and this configuration has no effect.
Sourcepub const SECURITY_PROTOCOL_CONFIG: &'static str = CommonClientConfigs::SECURITY_PROTOCOL_CONFIG
pub const SECURITY_PROTOCOL_CONFIG: &'static str = CommonClientConfigs::SECURITY_PROTOCOL_CONFIG
security.protocol
Sourcepub fn new(props: &HashMap<String, String>) -> Result<Self, Error>
pub fn new(props: &HashMap<String, String>) -> Result<Self, Error>
Creates a config from a property map.
§Arguments
props- The admin client configuration properties
§Errors
Error::is_config_errorif a value fails to parse or validate, withConfigDef’s message, or if a SASLsecurity.protocolhas an emptysasl.mechanismor one other thanPLAIN. Any combination ofbootstrap.serversandbootstrap.controllersis accepted here, as in Java: exactly one of them must be set, but the client checks it when it is created (AdminClient::create).
WARNING: sasl.mechanism must be PLAIN.
Sourcepub fn get_short(&self, key: &str) -> Result<Option<i16>, Error>
pub fn get_short(&self, key: &str) -> Result<Option<i16>, Error>
The SHORT configuration key. Reading a key marks it used
(Self::unused).
§Arguments
key- the configuration name
§Returns
The value, None for Java’s null.
§Errors
Error::is_config_errorwith Java’sUnknown configuration '<key>'ifkeyis not a configuration this class defines.Error::is_local_illegal_argument_errorifkeyis a configuration of another type, where Java’s cast fails with aClassCastException.
Sourcepub fn get_int(&self, key: &str) -> Result<Option<i32>, Error>
pub fn get_int(&self, key: &str) -> Result<Option<i32>, Error>
The INT configuration key. Reading a key marks it used
(Self::unused).
§Arguments
key- the configuration name
§Returns
The value, None for Java’s null.
§Errors
Error::is_config_errorwith Java’sUnknown configuration '<key>'ifkeyis not a configuration this class defines.Error::is_local_illegal_argument_errorifkeyis a configuration of another type, where Java’s cast fails with aClassCastException.
Sourcepub fn get_long(&self, key: &str) -> Result<Option<i64>, Error>
pub fn get_long(&self, key: &str) -> Result<Option<i64>, Error>
The LONG configuration key. Reading a key marks it used
(Self::unused).
§Arguments
key- the configuration name
§Returns
The value, None for Java’s null.
§Errors
Error::is_config_errorwith Java’sUnknown configuration '<key>'ifkeyis not a configuration this class defines.Error::is_local_illegal_argument_errorifkeyis a configuration of another type, where Java’s cast fails with aClassCastException.
Sourcepub fn get_double(&self, key: &str) -> Result<Option<f64>, Error>
pub fn get_double(&self, key: &str) -> Result<Option<f64>, Error>
The DOUBLE configuration key. Reading a key marks it used
(Self::unused).
§Arguments
key- the configuration name
§Returns
The value, None for Java’s null.
§Errors
Error::is_config_errorwith Java’sUnknown configuration '<key>'ifkeyis not a configuration this class defines.Error::is_local_illegal_argument_errorifkeyis a configuration of another type, where Java’s cast fails with aClassCastException.
Sourcepub fn get_list(&self, key: &str) -> Result<Option<&[String]>, Error>
pub fn get_list(&self, key: &str) -> Result<Option<&[String]>, Error>
The LIST configuration key, borrowed from the parsed values.
Reading a key marks it used (Self::unused).
§Arguments
key- the configuration name
§Returns
The value, None for Java’s null.
§Errors
Error::is_config_errorwith Java’sUnknown configuration '<key>'ifkeyis not a configuration this class defines.Error::is_local_illegal_argument_errorifkeyis a configuration of another type, where Java’s cast fails with aClassCastException.
Sourcepub fn get_boolean(&self, key: &str) -> Result<Option<bool>, Error>
pub fn get_boolean(&self, key: &str) -> Result<Option<bool>, Error>
The BOOLEAN configuration key. Reading a key marks it used
(Self::unused).
§Arguments
key- the configuration name
§Returns
The value, None for Java’s null.
§Errors
Error::is_config_errorwith Java’sUnknown configuration '<key>'ifkeyis not a configuration this class defines.Error::is_local_illegal_argument_errorifkeyis a configuration of another type, where Java’s cast fails with aClassCastException.
Sourcepub fn get_string(&self, key: &str) -> Result<Option<&str>, Error>
pub fn get_string(&self, key: &str) -> Result<Option<&str>, Error>
The STRING configuration key, trimmed. Reading a key marks it used
(Self::unused).
§Arguments
key- the configuration name
§Returns
The value, None for Java’s null (also what an unset PASSWORD key
such as ssl.keystore.key answers, as Java’s cast of null succeeds).
§Errors
Error::is_config_errorwith Java’sUnknown configuration '<key>'ifkeyis not a configuration this class defines.Error::is_local_illegal_argument_errorifkeyis a configuration of another type (a setPASSWORDkey is not aSTRING), where Java’s cast fails with aClassCastException.
Sourcepub fn unused(&self) -> HashSet<String>
pub fn unused(&self) -> HashSet<String>
Returns the keys of the properties this configuration was built from that were never read: through a getter, or by the client built from it.
Sourcepub fn log_unused(&self)
pub fn log_unused(&self)
Info level log for any unused configurations
Sourcepub fn config_names() -> HashSet<String>
pub fn config_names() -> HashSet<String>
Trait Implementations§
Source§impl Debug for AdminClientConfig
impl Debug for AdminClientConfig
Source§impl Hash for AdminClientConfig
impl Hash for AdminClientConfig
Source§impl PartialEq for AdminClientConfig
impl PartialEq for AdminClientConfig
impl Eq for AdminClientConfig
Auto Trait Implementations§
impl !Freeze for AdminClientConfig
impl RefUnwindSafe for AdminClientConfig
impl Send for AdminClientConfig
impl Sync for AdminClientConfig
impl Unpin for AdminClientConfig
impl UnsafeUnpin for AdminClientConfig
impl UnwindSafe for AdminClientConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.