Skip to main content

AdminClientConfig

Struct AdminClientConfig 

Source
pub struct AdminClientConfig { /* private fields */ }
Expand description

The AdminClient configuration class, which also contains constants for configuration entry names.

Implementations§

Source§

impl AdminClientConfig

Source

pub const BOOTSTRAP_SERVERS_CONFIG: &'static str = "bootstrap.servers"

bootstrap.servers

Source

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.

Source

pub const CLIENT_DNS_LOOKUP_CONFIG: &'static str = CommonClientConfigs::CLIENT_DNS_LOOKUP_CONFIG

client.dns.lookup

Source

pub const CLIENT_ID_CONFIG: &'static str = "client.id"

client.id

Source

pub const REQUEST_TIMEOUT_MS_CONFIG: &'static str = "request.timeout.ms"

request.timeout.ms

Source

pub const DEFAULT_API_TIMEOUT_MS_CONFIG: &'static str = "default.api.timeout.ms"

default.api.timeout.ms

Source

pub const RETRIES_CONFIG: &'static str = "retries"

retries

Source

pub const RETRY_BACKOFF_MS_CONFIG: &'static str = "retry.backoff.ms"

retry.backoff.ms

Source

pub const RETRY_BACKOFF_MAX_MS_CONFIG: &'static str = "retry.backoff.max.ms"

retry.backoff.max.ms

Source

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.

Source

pub const RECONNECT_BACKOFF_MS_CONFIG: &'static str = "reconnect.backoff.ms"

reconnect.backoff.ms

Source

pub const RECONNECT_BACKOFF_MAX_MS_CONFIG: &'static str = "reconnect.backoff.max.ms"

reconnect.backoff.max.ms

Source

pub const CONNECTIONS_MAX_IDLE_MS_CONFIG: &'static str = "connections.max.idle.ms"

connections.max.idle.ms

Source

pub const METADATA_MAX_AGE_CONFIG: &'static str = "metadata.max.age.ms"

metadata.max.age.ms

Source

pub const SOCKET_CONNECTION_SETUP_TIMEOUT_MS_CONFIG: &'static str = "socket.connection.setup.timeout.ms"

socket.connection.setup.timeout.ms

Source

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.

Source

pub const SECURITY_PROTOCOL_CONFIG: &'static str = CommonClientConfigs::SECURITY_PROTOCOL_CONFIG

security.protocol

Source

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_error if a value fails to parse or validate, with ConfigDef’s message, or if a SASL security.protocol has an empty sasl.mechanism or one other than PLAIN. Any combination of bootstrap.servers and bootstrap.controllers is 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.

Source

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_error with Java’s Unknown configuration '<key>' if key is not a configuration this class defines.
  • Error::is_local_illegal_argument_error if key is a configuration of another type, where Java’s cast fails with a ClassCastException.
Source

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_error with Java’s Unknown configuration '<key>' if key is not a configuration this class defines.
  • Error::is_local_illegal_argument_error if key is a configuration of another type, where Java’s cast fails with a ClassCastException.
Source

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_error with Java’s Unknown configuration '<key>' if key is not a configuration this class defines.
  • Error::is_local_illegal_argument_error if key is a configuration of another type, where Java’s cast fails with a ClassCastException.
Source

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_error with Java’s Unknown configuration '<key>' if key is not a configuration this class defines.
  • Error::is_local_illegal_argument_error if key is a configuration of another type, where Java’s cast fails with a ClassCastException.
Source

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_error with Java’s Unknown configuration '<key>' if key is not a configuration this class defines.
  • Error::is_local_illegal_argument_error if key is a configuration of another type, where Java’s cast fails with a ClassCastException.
Source

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_error with Java’s Unknown configuration '<key>' if key is not a configuration this class defines.
  • Error::is_local_illegal_argument_error if key is a configuration of another type, where Java’s cast fails with a ClassCastException.
Source

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_error with Java’s Unknown configuration '<key>' if key is not a configuration this class defines.
  • Error::is_local_illegal_argument_error if key is a configuration of another type (a set PASSWORD key is not a STRING), where Java’s cast fails with a ClassCastException.
Source

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.

Source

pub fn ignore(&self, key: &str)

Marks the configuration key used without reading it.

§Arguments
  • key - the configuration name
Source

pub fn log_unused(&self)

Info level log for any unused configurations

Source

pub fn config_names() -> HashSet<String>

The names of the configurations this class defines.

§Returns

The set of configuration keys

Trait Implementations§

Source§

impl Debug for AdminClientConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for AdminClientConfig

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for AdminClientConfig

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for AdminClientConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V