ConnectConfig

Connection settings used to create a ClientV2.

use milvus::v2::ConnectConfig;

let config = ConnectConfig::new()
    .uri("http://localhost:19530")
    .token("root:Milvus")
    .database("books");

Construction

  • ConnectConfig::new() -> ConnectConfig

    Creates a value initialized with the SDK defaults.

PARAMETERS

ParameterTypeDefaultDescription
uriString"http://localhost:19530"URI of the Milvus server, for example http://localhost:19530.
tokenOption<String>NoneAccess token in the form username:password, base64-encoded before being sent as gRPC authorization metadata.
tls_server_nameOption<String>NoneOverrides the DNS name used to verify the Milvus server’s TLS certificate.
ca_certificateOption<String>NonePath to a PEM-encoded custom CA certificate file.
client_certificateOption<String>NonePath to the PEM-encoded client certificate file used for mutual TLS.
client_keyOption<String>NonePath to the PEM-encoded client private-key file used for mutual TLS.
connect_timeoutDuration10sMaximum time ClientV2::new waits for Milvus to become ready.
rpc_timeoutDurationDuration::ZEROTimeout applied to each RPC attempt; ZERO disables the timeout.
keepalive_timeDuration10sTime between HTTP/2 keep-alive probes sent to the server.
keepalive_timeoutDuration5sTimeout for the server to respond to a keep-alive probe.
keepalive_while_idlebooltrueWhether to send keep-alive probes while the connection is idle.
databaseString""Database selected on connection; the default database is used when empty.
retryRetryConfigRetryConfig::new()Retry policy applied to V2 RPC calls. See RetryConfig.

METHODS

Each field has a consuming setter, a mutable setter, and a getter.

  • uri(mut self, uri: impl Into<String>) -> Self — sets the server URI. set_uri(&mut self, uri) and get_uri() -> &str are also available.
  • token(mut self, token: impl Into<String>) -> Self — sets the access token. set_token(&mut self, token) and get_token() -> &Option<String> are also available.
  • tls_server_name(mut self, value: impl Into<String>) -> Self — overrides the TLS certificate verification name. set_tls_server_name(&mut self, value) and get_tls_server_name() -> &Option<String> are also available.
  • ca_certificate(mut self, value: impl Into<String>) -> Self — sets the custom CA certificate file path. set_ca_certificate(&mut self, value) and get_ca_certificate() -> &Option<String> are also available.
  • client_certificate(mut self, value: impl Into<String>) -> Self — sets the client certificate file path for mutual TLS. set_client_certificate(&mut self, value) and get_client_certificate() -> &Option<String> are also available.
  • client_key(mut self, value: impl Into<String>) -> Self — sets the client private-key file path for mutual TLS. set_client_key(&mut self, value) and get_client_key() -> &Option<String> are also available.
  • connect_timeout(mut self, timeout: Duration) -> Self — sets the maximum connect wait. set_connect_timeout(&mut self, timeout) and get_connect_timeout() -> Duration are also available.
  • rpc_timeout(mut self, timeout: Duration) -> Self — sets the per-RPC timeout. set_rpc_timeout(&mut self, timeout) and get_rpc_timeout() -> Duration are also available.
  • keepalive_time(mut self, value: Duration) -> Self — sets the keep-alive probe interval. set_keepalive_time(&mut self, value) and get_keepalive_time() -> Duration are also available.
  • keepalive_timeout(mut self, value: Duration) -> Self — sets the keep-alive probe timeout. set_keepalive_timeout(&mut self, value) and get_keepalive_timeout() -> Duration are also available.
  • keepalive_while_idle(mut self, value: bool) -> Self — sets whether keep-alive probes are sent while idle. set_keepalive_while_idle(&mut self, value) and get_keepalive_while_idle() -> bool are also available.
  • database(mut self, database: impl Into<String>) -> Self — sets the database selected on connection. set_database(&mut self, database) and get_database() -> &str are also available.
  • retry(mut self, retry: RetryConfig) -> Self — sets the retry policy. set_retry(&mut self, retry) and get_retry() -> &RetryConfig are also available.
  • username_password(self, username: &str, password: &str) -> Self — sets the token from a username and password pair.

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?