If Apache Iggy is useful to you, give it a star on GitHubStar apache/iggy
Skip to Content
Apache Iggy
SDK
These docs describe the upcoming release. They follow the master branches of apache/iggy and apache/iggy-connectors. For the last release, read the 0.10 release docs, or select a version at the top of the sidebar.

Connection Strings

The canonical reference for Iggy connection strings, covering every scheme, credential form and option.

A connection string configures an Iggy client in a single line: transport, credentials, server address, and options. This page is the canonical reference for every scheme, credential form, and option key.

The tables below describe the Rust SDK and its Python, C++ and PHP bindings. Native Go, Node.js, C# and Swift clients also accept TCP connection strings, but their supported option names and validation rules may differ. Java supports a smaller subset, described below.

Format

iggy[+transport]://credentials@host:port[?option=value&option=value]

The host and port are always required. Use a hostname, IPv4 address or bracketed IPv6 address such as [::1]:8090. Options are appended as key=value pairs separated by &. Scheme names and option keys are case-sensitive.

The parser does not percent-decode credentials or option values. Reserved separators such as : and @ cannot be escaped inside a username or password. Use a PAT for credentials that contain them. In Rust TCP, QUIC and WebSocket connection strings, Boolean options accept only the case-sensitive literals true and false. Other values, including TRUE, 1 and empty values, are rejected with InvalidConnectionString. Valid duplicate options use the last occurrence, including canonical names and their deprecated aliases. Each occurrence of a parsed Boolean, numeric or duration option must be valid; a later valid value does not rescue an earlier malformed value. For example, tls=TRUE&tls=true is rejected.

Unknown option keys are hard errors. The parser rejects the whole string with InvalidConnectionString instead of ignoring the key, so a typo fails fast rather than silently falling back to a default.

Transport selection

The scheme picks the transport. Each transport has its own default server port:

SchemeTransportDefault server port
iggy://TCP (default)8090
iggy+tcp://TCP8090
iggy+quic://QUIC8080
iggy+http://HTTP3000
iggy+ws://WebSocket8092

Credentials

Two forms are accepted:

Username and password, separated by a colon. Both parts must be non-empty:

iggy://username:password@127.0.0.1:8090

Personal Access Token: any credential without a colon is treated as a PAT. Server-minted tokens are plain base64 strings with no prefix, so paste the token exactly as the server returned it:

iggy://<personal-access-token>@127.0.0.1:8090

Do not prepend anything to the token. Strings like iggypat-... appear only in Iggy's own test code. A real token with a prefix added will fail to log in.

The examples use iggy/iggy. For a new local development instance, with no IGGY_ROOT_USERNAME or IGGY_ROOT_PASSWORD overrides, use:

cargo run --bin iggy-server -- --fresh --with-default-root-credentials

The environment takes precedence over the flag. Stored or recovered root credentials are not replaced by bootstrap settings. --fresh deletes this replica's local data. In a cluster it can recover committed state, including credentials, from another replica. Use this reset only for disposable development data. A fresh standalone server requires credentials. Provision root credentials on every replica for a new cluster.

TCP, QUIC, and WebSocket apply connection-string credentials during connect(). HTTP requires an explicit login, as described below.

Duration values

Options typed as durations take human-readable values such as 5s, 500ms, or 1m, unless a table below says the value is a plain number. Heartbeat and reconnection intervals must be greater than zero. The reconnection cooldown can be zero.

Shared binary transport options

Rust TCP, QUIC and WebSocket use the same canonical keys for reconnection and certificate validation:

Canonical keyDeprecated aliasTransports accepting the alias
reconnection_max_retriesreconnection_retriesTCP, WebSocket
reestablish_afterreconnection_reestablish_afterQUIC
tls_validate_certificatevalidate_certificateQUIC

Deprecated aliases remain accepted and emit a deprecation warning for each occurrence through Rust's tracing system. Applications need a configured subscriber to display these warnings. Canonical and deprecated names for the same option share last-occurrence precedence when their values are valid. QUIC does not accept reconnection_retries, and TCP and WebSocket do not accept the QUIC-specific aliases.

Retry counts accept a non-negative 32-bit unsigned integer or unlimited. Malformed retry counts now return InvalidConnectionString rather than InvalidNumberValue in the updated Rust parsers. Certificate-validation defaults remain transport-specific: true for TCP and false for QUIC and WebSocket. For native SDK compatibility, see the section below.

TCP options

KeyDescriptionDefault
tlsEnable TLS (true/false)false
tls_domainName for TLS validation. When empty, use the dialed hostname or IPempty
tls_ca_filePEM file of trusted CA certificates, replacing the built-in roots when validation is enablednone
tls_validate_certificateValidate the server certificate (true/false) when TLS is enabledtrue
reconnection_max_retriesRetry passes over known endpoints after the initial pass, or unlimitedunlimited
reconnection_intervalBase of exponential backoff with full jitter, capped at ten seconds1s
reestablish_afterStable connection duration that resets retry backoff5s
heartbeat_intervalDuration between heartbeats5s
nodelayEnable TCP_NODELAY (true/false)false
iggy://iggy:iggy@127.0.0.1:8090?tls=true&tls_domain=localhost&tls_ca_file=core/certs/iggy_ca_cert.pem&reconnection_max_retries=5&heartbeat_interval=3s&nodelay=true

With tls=true, TCP validates the server certificate by default. When validation is enabled, it uses the built-in Mozilla roots unless tls_ca_file supplies an explicit CA file to trust a private CA. Setting tls_validate_certificate=false disables server certificate validation, including use of tls_ca_file, and emits a fixed-text warning once when the TCP client is created. Reconnects and replica dials do not repeat this warning. This warning does not contain connection-string contents. Disabling validation exposes the connection to man-in-the-middle attacks; use it only in controlled testing environments. Setting tls_validate_certificate does not enable TLS by itself. The example above runs from the repository root against a TLS-enabled listener using the test certificate and key in core/certs/iggy_cert.pem and core/certs/iggy_key.pem. Those certificates are for local testing. See Security for TLS configuration.

QUIC options

QUIC shares the canonical reconnection and certificate-validation keys with TCP and WebSocket. It accepts the deprecated QUIC aliases listed above, but still rejects reconnection_retries.

KeyDescriptionDefault
response_buffer_sizeMaximum bytes read for one responseProtocol maximum record reply size
max_concurrent_bidi_streamsMaximum concurrent peer-initiated bidirectional streams10000
datagram_send_buffer_sizeDatagram send buffer size in bytes100000
initial_mtuInitial UDP payload size in bytes, clamped to at least 12001200
send_windowSend window size in bytes100000
receive_windowConnection receive window size in bytes100000
keep_alive_intervalKeep-alive interval in milliseconds. 0 disables it5000
max_idle_timeoutIdle timeout in milliseconds. 0 leaves Quinn's 30000 ms default10000
tls_validate_certificateValidate the server certificate (true/false)false
heartbeat_intervalDuration between heartbeats5s
reconnection_max_retriesNumber of reconnection attempts, or unlimitedunlimited
reconnection_intervalBase of exponential backoff with full jitter, capped at ten seconds1s
reestablish_afterStable connection duration that resets retry backoff5s
iggy+quic://iggy:iggy@127.0.0.1:8080?tls_validate_certificate=false&reconnection_max_retries=5

QUIC certificate validation is disabled by default, as shown in the local testing example. Enable it with tls_validate_certificate=true for connections that require server identity verification. When enabled, it uses the platform verifier and the connection-string configuration's server name, localhost. For a different certificate name, use the Rust QUIC configuration builder's with_server_name() method. Values above QUIC's 62-bit limit for max_concurrent_bidi_streams, receive_window, or max_idle_timeout are rejected with InvalidConfiguration.

WebSocket options

KeyDescriptionDefault
heartbeat_intervalDuration between heartbeats5s
reconnection_max_retriesNumber of reconnection attempts, or unlimitedunlimited
reconnection_intervalBase of exponential backoff with full jitter, capped at ten seconds1s
reestablish_afterStable connection duration that resets retry backoff5s
read_buffer_sizeRead buffer size in bytes131072
write_buffer_sizeTarget write buffer size in bytes131072
max_write_buffer_sizeMaximum write buffer size in bytes. Must exceed write_buffer_sizeusize::MAX
max_message_sizeMaximum incoming WebSocket message size in bytes67108864
max_frame_sizeMaximum incoming frame payload size in bytesProtocol maximum record reply size
accept_unmasked_framesHas no effect on client connectionsfalse
tlsEnable TLS (true/false)false
tls_domainName for TLS validation. When empty, use the connected IPempty
tls_ca_filePEM file of trusted CA certificates when validation is enablednone
tls_validate_certificateValidate the server certificate (true/false)false
iggy+ws://iggy:iggy@127.0.0.1:8092?heartbeat_interval=5s&reconnection_max_retries=5&max_message_size=1048576

WebSocket TLS does not validate the server certificate unless tls_validate_certificate=true. Enable validation for connections that require server identity verification. With validation enabled, tls_ca_file replaces the built-in Mozilla roots. Size limits cannot be removed through connection strings. Use the WebSocket configuration object for an unlimited message or frame size.

HTTP options

KeyDescriptionDefault
heartbeat_intervalDuration between heartbeats5s
retriesMaximum retries for transient request failures3
iggy+http://iggy:iggy@127.0.0.1:3000?retries=5

The HTTP scheme constructs a plain http:// API URL. Use the Rust HTTP builder's with_api_url() for HTTPS. HTTP parses the credential field but does not log in with it. In Rust, call login_user() or login_with_personal_access_token() explicitly before protected requests.

Usage

In Rust, construct clients inside a Tokio runtime, which QUIC needs even before connect(). The following snippet assumes an async function returning Result<_, IggyError> and the matching Rust SDK setup.

use iggy::prelude::*;

// TCP with default options
let client = IggyClient::from_connection_string("iggy://iggy:iggy@127.0.0.1:8090")?;

// QUIC
let client = IggyClient::from_connection_string("iggy+quic://iggy:iggy@127.0.0.1:8080")?;

// WebSocket
let client = IggyClient::from_connection_string("iggy+ws://iggy:iggy@127.0.0.1:8092")?;

// HTTP
let client = IggyClient::from_connection_string("iggy+http://iggy:iggy@127.0.0.1:3000")?;
client.login_user("iggy", "iggy").await?;
from apache_iggy import IggyClient

client = IggyClient.from_connection_string("iggy://iggy:iggy@127.0.0.1:8090")

When you need settings a connection string cannot express (client-side encryption, a custom Partitioner, and similar), start from IggyClientBuilder::from_connection_string() and extend the builder on top.

Pending-operation limits

Rust binary transport strings accept max_pending_operations and max_pending_operation_bytes. Defaults are 256 operations and 67108864 bytes. Both must be positive. The byte budget includes frozen headers and bodies, so it must fit the largest mutation you need to send.

Committing fetches use a separate pool with the same configured limits. That pool stores target metadata, not reply bodies, and retains unknown progress across sessions. Exhausting a limit rejects or delays further work according to the operation path. See Client failover.

Native SDK differences

Java accepts only TCP schemes, username/password credentials, tls and tls_ca_file. It rejects PAT connection strings and other options. Go's client.ParseConnectionString returns options for client.WithTcp. Node.js constructors accept a string except SimpleClient, which wraps an existing raw client. C# exposes its connection-string factory described in the C# guide.

Native Go, Node.js, C# and Swift parsers are not yet aligned with the updated Rust TCP option names: reconnection_max_retries and tls_validate_certificate are not supported by those parsers. Use their SDK-specific options, including reconnection_retries where supported, rather than assuming Rust's canonical names are portable. Go and Swift also retain their previous invalid-retry-count error behavior. Cross-SDK option and error compatibility is tracked in #4883.

Swift checks and then ignores pending mutation limits because it has no retained mutation pool. Its reconnect interval is a full pause between endpoint rounds. Node.js accepts reestablish_after for format compatibility without applying a Node equivalent. Do not assume one SDK's parser and timing behavior across all languages.

On this page