You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "haubur (via GitHub)" <gi...@apache.org> on 2026/08/03 14:05:29 UTC

[PR] chore(docs): proposal core/sdk lib.rs and IggyClient docs [iggy]

haubur opened a new pull request, #3809:
URL: https://github.com/apache/iggy/pull/3809

   Draft PR as discussed here: https://discord.com/channels/1144142576266530928/1144142825630474360/1507361396382240839
   
   Would be nice to get some feedback on:
   - language (tone towards the user)
   - understandability (level of detail)
   - guidance (easy to follow examples)
   
   If the general direction is good and supported, happy to clean and merge.
   Would suggest to continue with IggyConsumer and IggyProducer in a next PR.
   
   ## Which issue does this PR address?
   `Closes #3306`
   
   ## Rationale
   Adding User facing docs for the Rust SDK.
   
   ## What changed?
   - proposal for crate level docs in lib.rs
   - docs for the IggyClient type
   
   ## Local Execution
   - prek run (specifically typo and rust fmt)
   
   ## AI Usage
   Everything is manually written or at least re-written in cases I had claude suggest a formulation. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "haubur (via GitHub)" <gi...@apache.org>.
haubur commented on code in PR #3809:
URL: https://github.com/apache/iggy/pull/3809#discussion_r3906237109


##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,173 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Every operation takes a shared read
+/// guard.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can

Review Comment:
   Not a fan of this, because its type-level and clarified in `create()` and `producer()`.
   This is the third paragraph someone reads and already welcomed with behavior.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on code in PR #3809:
URL: https://github.com/apache/iggy/pull/3809#discussion_r3906133348


##########
core/sdk/src/clients/client.rs:
##########
@@ -75,19 +239,211 @@ impl Default for IggyClient {
 }
 
 impl IggyClient {
-    /// Creates a new `IggyClientBuilder`.
+    /// Returns an empty [`IggyClientBuilder`].
+    ///
+    /// The returned builder is not ready to be [`IggyClientBuilder::build()`].
+    /// It sill needs to configure a mode of transport.
     pub fn builder() -> IggyClientBuilder {
         IggyClientBuilder::new()
     }
 
-    /// Creates a new `IggyClientBuilder` from the provided connection string.
+    /// Creates an [`IggyClientBuilder`] with the transport preconfigured from a
+    /// connection string.
+    ///
+    /// The transport is selected from the scheme:
+    /// - `iggy://` defaults to TCP.
+    /// - `iggy+tcp://` for TCP.
+    /// - `iggy+quic://` for QUIC.
+    /// - `iggy+http://` for HTTP.
+    /// - `iggy+ws://` for WebSocket.
+    ///
+    /// Authentication at the server is mandatory.
+    /// - user + password: `<user>:<password>@<host>:<port>`
+    /// - personal access token: `<personal_access_token>@host:port`
+    ///
+    /// Optional `?key=value&key=value` queries carry transport specific
+    /// configuration. The query is parsed per transport, so the accepted keys differ
+    /// by scheme. An unknown key is rejected.
+    /// If no queries are provided optional configurations are automatically set to their default values.
+    ///
+    /// # Examples
+    ///
+    /// Each example lists configuration options per transport mode and shows
+    /// one concrete example.
+    ///
+    /// If the value of an option is
+    /// - a duration pass a `humantime` string such as `5s`, `500ms`, or `1h 1m 1s`.
+    ///   These are cast into an [`IggyDuration`]/[`NonZeroIggyDuration`].
+    ///   Note, `unlimited`, `none`, `disabled`, and `0` parse to zero.
+    /// - a retry count use either the literal `unlimited` or a number such as `5`.
+    /// - a bool use the literal `true` or `false`.
+    /// - bytes and millisecond options provide a number such as `1024`.
+    ///
+    /// ## TCP
+    ///
+    /// The same options apply for `iggy://` and `iggy+tcp://`.
+    ///
+    /// - `tls`: bool. Enable/disable TLS. Default: `false`.
+    /// - `tls_domain`: string. Server name to validate the certificate against. Default: unset.
+    /// - `tls_ca_file`: filesystem path. Extra CA certificate to trust. Default: unset.
+    /// - `reconnection_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`NonZeroIggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `heartbeat_interval`: [`NonZeroIggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `nodelay`: `bool`. Disable Nagle's algorithm (`TCP_NODELAY`). Default: `false`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+tcp://user:secret@localhost:8090\
+    ///      ?tls=true&tls_domain=localhost&tls_ca_file=/etc/iggy/ca.pem\
+    ///      &reconnection_retries=unlimited&reconnection_interval=1s&reestablish_after=5s\
+    ///      &heartbeat_interval=5s&nodelay=true",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## QUIC
+    ///
+    /// - `validate_certificate`: bool. Verify the server certificate. Default: `false`.
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `reconnection_max_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`IggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reconnection_reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `response_buffer_size`: u64. Number of bytes in the response receive buffer. Default: `10000000`.
+    /// - `max_concurrent_bidi_streams`: u64. Number of concurrent bidirectional streams. Default: `10000`.
+    /// - `datagram_send_buffer_size`: u64. Number of bytes in the datagram send buffer. Default: `100000`.
+    /// - `initial_mtu`: u16. Initial MTU estimate (in bytes). Default: `1200`.
+    /// - `send_window`: u64. Number of bytes bytes of the flow-control send window. Default: `100000`.
+    /// - `receive_window`: u64. Number of bytes of the flow-control receive window. Default: `100000`.
+    /// - `keep_alive_interval`: u64. QUIC keep-alive period (in milliseconds). Default: `5000`.
+    /// - `max_idle_timeout`: u64. Close after this much idle time (in middleseconds). Default: `10000`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+quic://user:secret@localhost:8080\
+    ///      ?validate_certificate=true&heartbeat_interval=5s\
+    ///      &reconnection_max_retries=unlimited&reconnection_interval=1s&reconnection_reestablish_after=5s\
+    ///      &response_buffer_size=10000000&max_concurrent_bidi_streams=10000\
+    ///      &datagram_send_buffer_size=100000&initial_mtu=1200\
+    ///      &send_window=100000&receive_window=100000\
+    ///      &keep_alive_interval=5000&max_idle_timeout=10000",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## HTTP
+    ///
+    /// A REST transport. Iggy uses the `reqwest` crate to manage the HTTP client.
+    /// Hence, transport specific configuration is abstracted away.
+    ///
+    /// Configurable options are:
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `retries`: u32. Number of retries when sending a request. Default: `3`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # async fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+http://localhost:3000?heartbeat_interval=5s&retries=3",
+    /// )?
+    /// .build()?;
+    /// client.login_user("user", "password").await?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## WebSocket
+    ///
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `reconnection_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`IggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `read_buffer_size`: usize. Size of the read buffer in bytes. Default: `131072`.
+    /// - `write_buffer_size`: usize. Size of the write buffer in bytes. Default: `131072`.
+    /// - `max_write_buffer_size`: usize. Maximum size of the write buffer in bytes. Default: `usize::MAX`.
+    /// - `max_message_size`: usize. Maximum accepted message size in bytes. Default: `67108864`.
+    /// - `max_frame_size`: usize. Maximum accepted frame size in bytes. Default: `16777216`.
+    /// - `accept_unmasked_frames`: bool. Accept/ decline unmasked frames. Default: `false`.
+    /// - `tls`: `bool`. Enable/disbale TLS. Default: `false`.
+    /// - `tls_domain`: string. Server name to validate the certificate against. Default: unset.
+    /// - `tls_ca_file`: filesystem path. Extra CA certificate to trust. Default: unset.
+    /// - `tls_validate_certificate`: bool. Whether to verify the server certificate. Default: `false`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+ws://user:secret@localhost:8092\
+    ///      ?heartbeat_interval=5s&reconnection_retries=unlimited&reconnection_interval=1s&reestablish_after=5s\
+    ///      &read_buffer_size=131072&write_buffer_size=131072&\

Review Comment:
   the trailing `&` here plus the leading one on the next line gives `131072&&max_message_size`, which `websocket_connection_string_options.rs:109` rejects as an empty segment.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): proposal core/sdk lib.rs and IggyClient docs [iggy]

Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3809:
URL: https://github.com/apache/iggy/pull/3809#discussion_r3707430413


##########
core/common/src/types/message/partitioning.rs:
##########
@@ -25,11 +25,17 @@ use std::{
     hash::{Hash, Hasher},
 };
 
-/// `Partitioning` is used to specify to which partition the messages should be sent.
-/// It has the following kinds:
+/// A type that defines a what strategy the server should choose to partition the messages.
+///
+/// Iggy uses a hierarchical model for append-only logs. A stream contains topics which hold partitions. Each partition is an append-only log.[^note]
+/// A producer of messages such as an [`IggyProducer`], that appends messages to the log can choose between three partitioning strategies.
 /// - `Balanced` - the partition ID is calculated by the server using the round-robin algorithm.
-/// - `PartitionId` - the partition ID is provided by the client.
 /// - `MessagesKey` - the partition ID is calculated by the server using the hash of the provided messages key.
+/// - `PartitionId` - the partition ID is provided by the client.
+///
+/// Note, that using a [`Partitioner`] on top of [`Partitioning`] sets the strategy to [`PartitioningKind::PartitionId`] and the value to whatever [`Partitioner::calculate_partition_id()`] computes.

Review Comment:
   "to whatever [`Partitioner::calculate_partition_id()`] computes." implies that the calculation is non-deterministic. It would be better to phrase this in a way that allows the user to understand how `calculate_partition_id` calculates the partition



##########
core/common/src/traits/partitioner.rs:
##########
@@ -21,8 +21,18 @@ use crate::types::message::IggyMessage;
 use std::fmt::Debug;
 
 /// The trait represent the logic responsible for calculating the partition ID and is used by the `IggyClient`.
-/// This might be especially useful when the partition ID is not constant and might be calculated based on the stream ID, topic ID and other parameters.
+///
+/// Iggy uses a hierarchical model for append-only logs. A stream contains topics which hold partitions. Each partition is an append-only log.[^note]
+/// A producer of messages such as an [`IggyProducer`], that appends messages to the log, might want to choose to which partition to write the messages.
+/// To do that, a producer can take a type that implements this trait.
+/// This might be especially useful when computing the partition ID requires some client side info, i.e. stream ID, topic ID and [`IggyMessage`] attributes.
+///
+/// Note, that the [`Partitioning`] of a producer defines what _partitioning strategy_ is triggered on the server.
+/// Using a [`Partitioner`] in a producer sets the strategy in to request a specific partition [`PartitioningKind::PartitionID`] calculated with [`Partitioner::calculate_partition_id()`].

Review Comment:
   The usage of [`Partitioner`] in a producer allows the user to set a strategy that will request a specific partition [...] calculated using [...].
   
   
   While I think the above is a better formulation, I think it would be better to completely change the sentence since it is difficult to understand and is missing information



##########
core/sdk/src/clients/client.rs:
##########
@@ -55,9 +55,159 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that one connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (producers, consumers, the background heartbeat), and they all talk
+/// over the same connection. The lock keeps that safe. Many operations can read
+/// from the connection at the same time, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access. It is
+/// also async-aware, so holding it across a call to the server never blocks the
+/// runtime.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, routing
+/// can depend on the stream, topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The [`IggyClient`] provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk binary to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both are essentially backdoors for low-level control. You need to know the server codes and the wire format.

Review Comment:
   > /// Additionally, you can bypass invoking methods from these traits and directly talk binary to the server with [`send_binary_request`] and [`send_http_request`] for http.
   
   Additionally, you can bypass invoking methods from these traits and directly talk to the server with [`send_binary_request`] and [`send_http_request`] for http.
   
   > /// Both are essentially backdoors for low-level control. You need to know the server codes and the wire format.
   
   The "backdoor" framing looks wrong. Maybe think of another way of saying this?



##########
core/common/src/traits/partitioner.rs:
##########
@@ -21,8 +21,18 @@ use crate::types::message::IggyMessage;
 use std::fmt::Debug;
 
 /// The trait represent the logic responsible for calculating the partition ID and is used by the `IggyClient`.
-/// This might be especially useful when the partition ID is not constant and might be calculated based on the stream ID, topic ID and other parameters.
+///
+/// Iggy uses a hierarchical model for append-only logs. A stream contains topics which hold partitions. Each partition is an append-only log.[^note]
+/// A producer of messages such as an [`IggyProducer`], that appends messages to the log, might want to choose to which partition to write the messages.
+/// To do that, a producer can take a type that implements this trait.
+/// This might be especially useful when computing the partition ID requires some client side info, i.e. stream ID, topic ID and [`IggyMessage`] attributes.

Review Comment:
   > stream ID, topic ID and [`IggyMessage`] attributes.
   
   stream ID, topic ID or [`IggyMessage`] attributes.



##########
core/common/src/traits/partitioner.rs:
##########
@@ -21,8 +21,18 @@ use crate::types::message::IggyMessage;
 use std::fmt::Debug;
 
 /// The trait represent the logic responsible for calculating the partition ID and is used by the `IggyClient`.
-/// This might be especially useful when the partition ID is not constant and might be calculated based on the stream ID, topic ID and other parameters.
+///
+/// Iggy uses a hierarchical model for append-only logs. A stream contains topics which hold partitions. Each partition is an append-only log.[^note]
+/// A producer of messages such as an [`IggyProducer`], that appends messages to the log, might want to choose to which partition to write the messages.
+/// To do that, a producer can take a type that implements this trait.
+/// This might be especially useful when computing the partition ID requires some client side info, i.e. stream ID, topic ID and [`IggyMessage`] attributes.

Review Comment:
   > This might be especially useful
   
   This may be especially useful



##########
core/sdk/src/clients/client.rs:
##########
@@ -55,9 +55,159 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that one connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (producers, consumers, the background heartbeat), and they all talk
+/// over the same connection. The lock keeps that safe. Many operations can read
+/// from the connection at the same time, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access. It is
+/// also async-aware, so holding it across a call to the server never blocks the
+/// runtime.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, routing
+/// can depend on the stream, topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create`].
+///
+/// # What you can do

Review Comment:
   What you can do -> What can be done



##########
core/sdk/src/clients/client.rs:
##########
@@ -55,9 +55,159 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that one connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (producers, consumers, the background heartbeat), and they all talk
+/// over the same connection. The lock keeps that safe. Many operations can read
+/// from the connection at the same time, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access. It is
+/// also async-aware, so holding it across a call to the server never blocks the
+/// runtime.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, routing
+/// can depend on the stream, topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The [`IggyClient`] provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk binary to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both are essentially backdoors for low-level control. You need to know the server codes and the wire format.
+///
+/// # Usage
+///
+/// The typical lifecycle of an [`IggyClient`] is construct [`connect`], use, and finally [`shutdown`].
+///
+/// 1. Construct a client from a connection string ([`from_connection_string`]),
+///    from the [`builder`], or by wrapping an existing transport client with
+///    [`new`] / [`create`].
+/// 2. Call [`connect`] to establish the connection. If the transport was
+///    configured with auto-login, this also authenticates. Otherwise call
+///    [`UserClient::login_user`] afterwards.
+/// 3. Spawn [`IggyConsumer`]s and [`IggyProducers`] to write and consume messages
+///    to and from the server.

Review Comment:
   > 3. Spawn [`IggyConsumer`]s and [`IggyProducers`] to write and consume messages to and from the server.
   
   Spawn [`IggyConsumer`]s and [`IggyProducer`]s to write to, and consume messages from, the server.



##########
core/sdk/src/clients/client.rs:
##########
@@ -55,9 +55,159 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that one connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (producers, consumers, the background heartbeat), and they all talk
+/// over the same connection. The lock keeps that safe. Many operations can read
+/// from the connection at the same time, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access. It is
+/// also async-aware, so holding it across a call to the server never blocks the
+/// runtime.

Review Comment:
   I'd ideally rephrase this paragraph. There is a lot of repetition here and the paragraph can be shortened.



##########
core/common/src/traits/partitioner.rs:
##########
@@ -21,8 +21,18 @@ use crate::types::message::IggyMessage;
 use std::fmt::Debug;
 
 /// The trait represent the logic responsible for calculating the partition ID and is used by the `IggyClient`.
-/// This might be especially useful when the partition ID is not constant and might be calculated based on the stream ID, topic ID and other parameters.
+///
+/// Iggy uses a hierarchical model for append-only logs. A stream contains topics which hold partitions. Each partition is an append-only log.[^note]
+/// A producer of messages such as an [`IggyProducer`], that appends messages to the log, might want to choose to which partition to write the messages.

Review Comment:
   >  might want to choose to which partition to write the messages.
   
   might want to choose which partition to write the messages into.



##########
core/sdk/src/clients/client.rs:
##########
@@ -55,9 +55,159 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that one connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (producers, consumers, the background heartbeat), and they all talk
+/// over the same connection. The lock keeps that safe. Many operations can read

Review Comment:
   "The lock keeps that safe" is not required.



##########
core/sdk/src/clients/client.rs:
##########
@@ -55,9 +55,159 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that one connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (producers, consumers, the background heartbeat), and they all talk
+/// over the same connection. The lock keeps that safe. Many operations can read
+/// from the connection at the same time, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access. It is
+/// also async-aware, so holding it across a call to the server never blocks the
+/// runtime.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, routing
+/// can depend on the stream, topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The [`IggyClient`] provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk binary to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both are essentially backdoors for low-level control. You need to know the server codes and the wire format.
+///
+/// # Usage
+///
+/// The typical lifecycle of an [`IggyClient`] is construct [`connect`], use, and finally [`shutdown`].
+///
+/// 1. Construct a client from a connection string ([`from_connection_string`]),
+///    from the [`builder`], or by wrapping an existing transport client with
+///    [`new`] / [`create`].
+/// 2. Call [`connect`] to establish the connection. If the transport was
+///    configured with auto-login, this also authenticates. Otherwise call
+///    [`UserClient::login_user`] afterwards.

Review Comment:
   > Otherwise call [`UserClient::login_user`] afterwards.
   
   "Otherwise call [`login_user`] afterwards." seems better



##########
core/sdk/src/clients/client.rs:
##########
@@ -55,9 +55,159 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that one connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (producers, consumers, the background heartbeat), and they all talk
+/// over the same connection. The lock keeps that safe. Many operations can read
+/// from the connection at the same time, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access. It is
+/// also async-aware, so holding it across a call to the server never blocks the
+/// runtime.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, routing
+/// can depend on the stream, topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The [`IggyClient`] provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk binary to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both are essentially backdoors for low-level control. You need to know the server codes and the wire format.
+///
+/// # Usage
+///
+/// The typical lifecycle of an [`IggyClient`] is construct [`connect`], use, and finally [`shutdown`].

Review Comment:
   > construct [`connect`], use, and finally [`shutdown`].
   
   construct, [`connect`], use, and finally [`shutdown`].



##########
core/sdk/src/clients/client.rs:
##########
@@ -55,9 +55,159 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that one connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (producers, consumers, the background heartbeat), and they all talk
+/// over the same connection. The lock keeps that safe. Many operations can read
+/// from the connection at the same time, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access. It is
+/// also async-aware, so holding it across a call to the server never blocks the
+/// runtime.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, routing
+/// can depend on the stream, topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The [`IggyClient`] provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk binary to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both are essentially backdoors for low-level control. You need to know the server codes and the wire format.
+///
+/// # Usage
+///
+/// The typical lifecycle of an [`IggyClient`] is construct [`connect`], use, and finally [`shutdown`].
+///
+/// 1. Construct a client from a connection string ([`from_connection_string`]),
+///    from the [`builder`], or by wrapping an existing transport client with
+///    [`new`] / [`create`].
+/// 2. Call [`connect`] to establish the connection. If the transport was
+///    configured with auto-login, this also authenticates. Otherwise call
+///    [`UserClient::login_user`] afterwards.
+/// 3. Spawn [`IggyConsumer`]s and [`IggyProducers`] to write and consume messages
+///    to and from the server.
+/// 4. Call [`shutdown`] (or drop the client) to release resources; drop also
+///    leaves any consumer groups the client had joined.

Review Comment:
   You talk about drop leaving any consumer groups behind here, but do not talk about what shutdown does to consumer groups. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3809:
URL: https://github.com/apache/iggy/pull/3809#discussion_r3839676353


##########
core/sdk/src/lib.rs:
##########
@@ -15,6 +15,237 @@
 // specific language governing permissions and limitations
 // under the License.
 
+//! Apache Iggy is a high-performance, persistent message streaming platform written in Rust,
+//! capable of processing millions of messages per second with ultra-low latency.
+//! It is part of the [`Apache Incubating Program`] of the [`Apache Software Foundation`] (ASF).
+//!
+//! **This library is the Apache Iggy SDK.**
+//! It exposes a low-level and a high-level API for the Apache Iggy message streaming infrastructure for the Rust programming language.
+//! SDKs for other programming languages can be found in [`core/foreign`] of the root repository on GitHub.
+//!
+//! The core of the Iggy server is a persisted append-only log data structure.
+//! It is concerned with allowing read and writes in the most efficient way.
+//! Reading and writing to the server is the domain of this SDK.
+//! The server exposes *commands* that can be triggered to change its state.
+//! These commands allow administrative tasks, such as handling users, permissions and setting up streams and topics
+//! or writing and reading messages from the log.
+//! A comprehensive overview of commands can be found in the [`schema spec`] on the website or checking the [`server command enum`] within the source code.
+//!
+//! The SDK provides tools to build production ready message-streaming applications.
+//! It exposes its functionality at two levels. The [high-level API](#high-level-api)
+//! is transport-agnostic and ships with the batching, retry, offset-tracking, and
+//! connection-management machinery a production application needs. The
+//! [low-level API](#low-level-api) is the set of concrete transport clients that
+//! speak the wire protocol directly and that the high-level API is built on top of.
+//! It is recommended to start with the high-level API, and utilize the low level API
+//! in case the high-level API cannot satisfy your requirements.
+//!
+//! # High-level API
+//!
+//! The high-level API is most likely what you are looking for, especially if you are new to building
+//! message-streaming applications with Iggy.
+//! Clients provided by the high-level API already provide common message-streaming features that
+//! you would otherwise need to build yourself.
+//!
+//! There are three client types:
+//! - [`IggyClient`] is the entry point and the full API surface. It owns the
+//!   connection and implements every domain trait, including [`MessageClient`]
+//!   with the raw [`send_messages`] and [`poll_messages`] primitives. Each call
+//!   is a single, stateless request: no batching, retries, offset tracking, or
+//!   polling loop.
+//! - [`IggyProducer`] is a stateful helper for high-throughput sending, built on
+//!   [`send_messages`].
+//! - [`IggyConsumer`] is a stateful helper for continuous consumption, built on
+//!   [`poll_messages`].
+//!
+//! You do not construct the producer and consumer independently. Spawn them
+//! from an [`IggyClient`] with [`IggyClient::producer`] and
+//! [`IggyClient::consumer`] so they share its connection.
+//!
+//! ## When to use each
+//!
+//! Reach for [`IggyClient`] directly for administrative tasks such as
+//! creating streams, topics, users, and consumer groups, reading or storing
+//! offsets, or sending and polling a handful of messages in a script.
+//! Reach for [`IggyProducer`] and [`IggyConsumer`] when producing and consuming messages.
+//!
+//! The [`IggyProducer`] adds, on top of [`send_messages`]:
+//! - **Background batching** that flushes by size, message count, or a linger
+//!   interval, instead of one network round-trip per send.
+//! - **Retries** with a configurable count and interval (three attempts one
+//!   second apart by default).
+//! - A pluggable **partitioning strategy**, so the target partition is not
+//!   passed on every call.
+//! - **In-flight and ordering control**, optional payload **encryption**, and
+//!   `create_stream_if_not_exists` / `create_topic_if_not_exists` convenience.
+//!
+//! The [`IggyConsumer`] adds, on top of [`poll_messages`]:
+//! - A [`futures::Stream`] implementation, so a `while let Some(message) =
+//!   consumer.next().await` loop drives polling, paging, and the poll interval
+//!   for you.
+//! - A **polling strategy** (`next`, `offset`, or `timestamp`) that tracks
+//!   position instead of taking an offset on every call.
+//! - **Auto-commit** and offset storage on an interval or after a number of
+//!   messages, so a restart resumes where it left off.
+//! - **Auto-join** of consumer groupsa and assignment refresh should the server have
+//!   assigned the consumer another partition
+//! - Reconnection handling should the client disconnect

Review Comment:
   groups -> groups



##########
core/sdk/src/lib.rs:
##########
@@ -15,6 +15,237 @@
 // specific language governing permissions and limitations
 // under the License.
 
+//! Apache Iggy is a high-performance, persistent message streaming platform written in Rust,
+//! capable of processing millions of messages per second with ultra-low latency.
+//! It is part of the [`Apache Incubating Program`] of the [`Apache Software Foundation`] (ASF).
+//!
+//! **This library is the Apache Iggy SDK.**
+//! It exposes a low-level and a high-level API for the Apache Iggy message streaming infrastructure for the Rust programming language.
+//! SDKs for other programming languages can be found in [`core/foreign`] of the root repository on GitHub.
+//!
+//! The core of the Iggy server is a persisted append-only log data structure.
+//! It is concerned with allowing read and writes in the most efficient way.
+//! Reading and writing to the server is the domain of this SDK.
+//! The server exposes *commands* that can be triggered to change its state.
+//! These commands allow administrative tasks, such as handling users, permissions and setting up streams and topics
+//! or writing and reading messages from the log.
+//! A comprehensive overview of commands can be found in the [`schema spec`] on the website or checking the [`server command enum`] within the source code.
+//!
+//! The SDK provides tools to build production ready message-streaming applications.
+//! It exposes its functionality at two levels. The [high-level API](#high-level-api)
+//! is transport-agnostic and ships with the batching, retry, offset-tracking, and
+//! connection-management machinery a production application needs. The
+//! [low-level API](#low-level-api) is the set of concrete transport clients that
+//! speak the wire protocol directly and that the high-level API is built on top of.
+//! It is recommended to start with the high-level API, and utilize the low level API
+//! in case the high-level API cannot satisfy your requirements.
+//!
+//! # High-level API
+//!
+//! The high-level API is most likely what you are looking for, especially if you are new to building
+//! message-streaming applications with Iggy.
+//! Clients provided by the high-level API already provide common message-streaming features that
+//! you would otherwise need to build yourself.
+//!
+//! There are three client types:
+//! - [`IggyClient`] is the entry point and the full API surface. It owns the
+//!   connection and implements every domain trait, including [`MessageClient`]
+//!   with the raw [`send_messages`] and [`poll_messages`] primitives. Each call
+//!   is a single, stateless request: no batching, retries, offset tracking, or
+//!   polling loop.
+//! - [`IggyProducer`] is a stateful helper for high-throughput sending, built on
+//!   [`send_messages`].
+//! - [`IggyConsumer`] is a stateful helper for continuous consumption, built on
+//!   [`poll_messages`].
+//!
+//! You do not construct the producer and consumer independently. Spawn them
+//! from an [`IggyClient`] with [`IggyClient::producer`] and
+//! [`IggyClient::consumer`] so they share its connection.
+//!
+//! ## When to use each
+//!
+//! Reach for [`IggyClient`] directly for administrative tasks such as
+//! creating streams, topics, users, and consumer groups, reading or storing
+//! offsets, or sending and polling a handful of messages in a script.
+//! Reach for [`IggyProducer`] and [`IggyConsumer`] when producing and consuming messages.
+//!
+//! The [`IggyProducer`] adds, on top of [`send_messages`]:
+//! - **Background batching** that flushes by size, message count, or a linger
+//!   interval, instead of one network round-trip per send.
+//! - **Retries** with a configurable count and interval (three attempts one
+//!   second apart by default).
+//! - A pluggable **partitioning strategy**, so the target partition is not
+//!   passed on every call.
+//! - **In-flight and ordering control**, optional payload **encryption**, and
+//!   `create_stream_if_not_exists` / `create_topic_if_not_exists` convenience.
+//!
+//! The [`IggyConsumer`] adds, on top of [`poll_messages`]:
+//! - A [`futures::Stream`] implementation, so a `while let Some(message) =
+//!   consumer.next().await` loop drives polling, paging, and the poll interval
+//!   for you.
+//! - A **polling strategy** (`next`, `offset`, or `timestamp`) that tracks
+//!   position instead of taking an offset on every call.
+//! - **Auto-commit** and offset storage on an interval or after a number of
+//!   messages, so a restart resumes where it left off.
+//! - **Auto-join** of consumer groupsa and assignment refresh should the server have
+//!   assigned the consumer another partition
+//! - Reconnection handling should the client disconnect
+//! - Payload **decryption**
+//!
+//! # Stream builder API
+//!
+//! The stream builder API is a convenient way to use the high-level API.
+//! [`IggyStream`], [`IggyStreamProducer`], and
+//! [`IggyStreamConsumer`] construct everything at once.
+//! You can pass an [`IggyClient`] (or just a connection string) together with a config,
+//! and they hand back a ready, connected [`IggyProducer`] / [`IggyConsumer`].
+//! Compared to the **high-level API**, it changes how you construct
+//! producers and consumers, not what they can do. Instead of chaining an
+//! [`IggyProducerBuilder`] / [`IggyConsumerBuilder`] and setting each option
+//! with a method call, you describe the whole setup once in an
+//! [`IggyStreamConfig`] and build from it. The result is
+//! the same [`IggyProducer`] and [`IggyConsumer`] the builders produce, backed
+//! by the same [`IggyClient`].

Review Comment:
   change to
   ```rust
   //! Compared to the **high-level API**, the stream builder simplifies construction
   //! but exposes a smaller configuration surface. It returns the same
   //! [`IggyProducer`] and [`IggyConsumer`] types, backed by the same [`IggyClient`],
   //! but configures the producer in direct mode. Use [`IggyProducerBuilder`] when
   //! you need background batching, sharding, backpressure, or in-flight controls.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on PR #3809:
URL: https://github.com/apache/iggy/pull/3809#issuecomment-5388641427

   /author


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "haubur (via GitHub)" <gi...@apache.org>.
haubur commented on PR #3809:
URL: https://github.com/apache/iggy/pull/3809#issuecomment-5491032834

   /ready


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "haubur (via GitHub)" <gi...@apache.org>.
haubur commented on PR #3809:
URL: https://github.com/apache/iggy/pull/3809#issuecomment-5497723631

   /ready


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): proposal core/sdk lib.rs and IggyClient docs [iggy]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #3809:
URL: https://github.com/apache/iggy/pull/3809#issuecomment-5170060875

   ## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/3809?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 74.57%. Comparing base ([`01e7210`](https://app.codecov.io/gh/apache/iggy/commit/01e721028f752ccb868d0a0b71a56806665c254a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`5e7a5db`](https://app.codecov.io/gh/apache/iggy/commit/5e7a5dbff9ff66c0693abe0a14a9431c4d84fa96?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3809      +/-   ##
   ============================================
   - Coverage     75.78%   74.57%   -1.22%     
     Complexity      969      969              
   ============================================
     Files          1323     1321       -2     
     Lines        159751   159423     -328     
     Branches     133139   133007     -132     
   ============================================
   - Hits         121071   118887    -2184     
   - Misses        35045    36983    +1938     
   + Partials       3635     3553      -82     
   ```
   
   | [Components](https://app.codecov.io/gh/apache/iggy/pull/3809/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [Rust Core](https://app.codecov.io/gh/apache/iggy/pull/3809/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `75.68% <ø> (-0.01%)` | :arrow_down: |
   | [Java SDK](https://app.codecov.io/gh/apache/iggy/pull/3809/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `62.71% <ø> (ø)` | |
   | [C# SDK](https://app.codecov.io/gh/apache/iggy/pull/3809/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `72.28% <ø> (ø)` | |
   | [Python SDK](https://app.codecov.io/gh/apache/iggy/pull/3809/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `93.10% <ø> (ø)` | |
   | [PHP SDK](https://app.codecov.io/gh/apache/iggy/pull/3809/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `84.52% <ø> (ø)` | |
   | [Node SDK](https://app.codecov.io/gh/apache/iggy/pull/3809/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.57% <ø> (-6.58%)` | :arrow_down: |
   | [Go SDK](https://app.codecov.io/gh/apache/iggy/pull/3809/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `18.18% <ø> (-24.91%)` | :arrow_down: |
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iggy/pull/3809?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [core/common/src/types/message/partitioning.rs](https://app.codecov.io/gh/apache/iggy/pull/3809?src=pr&el=tree&filepath=core%2Fcommon%2Fsrc%2Ftypes%2Fmessage%2Fpartitioning.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9jb21tb24vc3JjL3R5cGVzL21lc3NhZ2UvcGFydGl0aW9uaW5nLnJz) | `75.18% <ø> (ø)` | |
   | [core/sdk/src/clients/client.rs](https://app.codecov.io/gh/apache/iggy/pull/3809?src=pr&el=tree&filepath=core%2Fsdk%2Fsrc%2Fclients%2Fclient.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zZGsvc3JjL2NsaWVudHMvY2xpZW50LnJz) | `89.22% <ø> (ø)` | |
   
   ... and [94 files with indirect coverage changes](https://app.codecov.io/gh/apache/iggy/pull/3809/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "haubur (via GitHub)" <gi...@apache.org>.
haubur commented on PR #3809:
URL: https://github.com/apache/iggy/pull/3809#issuecomment-5496894272

   /ready


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on code in PR #3809:
URL: https://github.com/apache/iggy/pull/3809#discussion_r3902704837


##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,166 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Many operations can read
+/// from the connection concurrently, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can
+/// configure routing to partitions within a topic yourself dependent on the stream,
+/// topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create()`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The `IggyClient` provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk to the server with [`send_binary_request`] and [`send_http_request`] for http.

Review Comment:
   also at lines 199, 457, 488, 587, 594, 650, 659, 717, 719, and partitioner.rs:26,30,31, partitioning.rs:31,36,37.
   
   none of these links resolve, so `cargo doc` with `-D warnings` (the CI doctest job) fails on both crates. the variant is `PartitionId`, `iggy_common` can't link `IggyProducer`, and link defs don't carry across doc blocks.



##########
core/sdk/src/clients/client.rs:
##########
@@ -182,7 +707,55 @@ impl IggyClient {
         ))
     }
 
-    /// Returns the builder for the producer.
+    /// Returns an [`IggyProducerBuilder`].
+    ///
+    /// Copies the client and the encryptor registered with the [`IggyClient`]
+    /// into a [`IggyProducerBuilder`] and returns it.
+    /// The [`Partitioner`] is applied by the client when messages are sent without

Review Comment:
   also at lines 74-77, 485-488, 501 and partitioner.rs:23.
   
   this partitioner never runs - `producer()` passes `None` at line 767 and `send_messages` never reads the field. either say it's inert and point at `IggyProducerBuilder::partitioner`, or drop these paragraphs.



##########
core/common/src/traits/partitioner.rs:
##########
@@ -21,8 +21,19 @@ use crate::types::message::IggyMessage;
 use std::fmt::Debug;
 
 /// The trait represent the logic responsible for calculating the partition ID and is used by the `IggyClient`.
-/// This might be especially useful when the partition ID is not constant and might be calculated based on the stream ID, topic ID and other parameters.
+///
+/// Iggy uses a hierarchical model for append-only logs. A stream contains topics which hold partitions. Each partition is an append-only log.[^note]
+/// A producer of messages such as an [`IggyProducer`], that appends messages to the log, may want to choose which partition to write the messages into.
+/// To do that, a producer can take a type that implements this trait.
+/// This is especially useful when computing the partition ID requires some client side info, i.e. stream ID, topic ID and/ or [`IggyMessage`] attributes.
+///
+/// Note the difference between [`Partitioning`] and [`Partitioner`]. [`Partitioning`] is a type used to set the _partitioning strategy_ for a producer.
+/// If you use both, the [`Partitioner`] overwrites the strategy, sets it to [`PartitioningKind::PartitionID`] and the partition ID is

Review Comment:
   a producer-level partitioner also overrides the `Partitioning` passed to `send_with_partitioning` / `send_to` (`producer.rs:356-359` ignores the argument), not only the builder one. say 'overrides any partitioning, including per send'.



##########
core/sdk/src/clients/client.rs:
##########
@@ -75,19 +232,209 @@ impl Default for IggyClient {
 }
 
 impl IggyClient {
-    /// Creates a new `IggyClientBuilder`.
+    /// Returns an empty [`IggyClientBuilder`].
+    ///
+    /// The returned builder is not ready to be [`IggyClientBuilder::build()`].
+    /// It sill needs to configure a mode of transport.
     pub fn builder() -> IggyClientBuilder {
         IggyClientBuilder::new()
     }
 
-    /// Creates a new `IggyClientBuilder` from the provided connection string.
+    /// Creates an [`IggyClientBuilder`] with the transport preconfigured from a
+    /// connection string.
+    ///
+    /// The transport is selected from the scheme:
+    /// - `iggy://` defaults to TCP.
+    /// - `iggy+tcp://` for TCP.
+    /// - `iggy+quic://` for QUIC.
+    /// - `iggy+http://` for HTTP.
+    /// - `iggy+ws://` for WebSocket.
+    ///
+    /// Authentication at the server is mandatory.
+    /// - user + password: `<user>:<password>@<host>:<port>`
+    /// - personal access token: `<personal_access_token>@host:port`
+    ///
+    /// Optional `?key=value&key=value` queries carry transport specific
+    /// configuration. The query is parsed per transport, so the accepted keys differ
+    /// by scheme. An unknown key is rejected.
+    /// If no queries are provided optional configurations are automatically set to their default values.
+    ///
+    /// # Examples
+    ///
+    /// Each example lists configuration options per transport mode and shows
+    /// one concrete example.
+    ///
+    /// If the value of an option is
+    /// - a duration pass a `humantime` string such as `5s`, `500ms`, or `1h 1m 1s`.
+    ///   These are cast into an [`IggyDuration`].
+    ///   Note, `unlimited`, `none`, `disabled`, and `0` parse to zero.
+    /// - a retry count use either the literal `unlimited` or a number such as `5`.
+    /// - a bool use the literal `true` or `false`.
+    /// - bytes and millisecond options provide a number such as `1024`.
+    ///
+    /// ## TCP
+    ///
+    /// The same options apply for `iggy://` and `iggy+tcp://`.
+    ///
+    /// - `tls`: bool. Enable/disable TLS. Default: `false`.
+    /// - `tls_domain`: string. Server name to validate the certificate against. Default: unset.
+    /// - `tls_ca_file`: filesystem path. Extra CA certificate to trust. Default: unset.
+    /// - `reconnection_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`IggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `nodelay`: `bool`. Disable Nagle's algorithm (`TCP_NODELAY`). Default: `false`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+tcp://user:secret@localhost:8090\
+    ///      ?tls=true&tls_domain=localhost&tls_ca_file=/etc/iggy/ca.pem\
+    ///      &reconnection_retries=unlimited&reconnection_interval=1s&reestablish_after=5s\
+    ///      &heartbeat_interval=5s&nodelay=true",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## QUIC
+    ///
+    /// - `validate_certificate`: bool. Verify the server certificate. Default: `false`.
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `reconnection_max_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`IggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reconnection_reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `response_buffer_size`: u64. Number of bytes in the response receive buffer. Default: `10000000`.
+    /// - `max_concurrent_bidi_streams`: u64. Number of concurrent bidirectional streams. Default: `10000`.
+    /// - `datagram_send_buffer_size`: u64. Number of bytes in the datagram send buffer. Default: `100000`.
+    /// - `initial_mtu`: u16. Initial MTU estimate (in bytes). Default: `1200`.
+    /// - `send_window`: u64. Number of bytes bytes of the flow-control send window. Default: `100000`.
+    /// - `receive_window`: u64. Number of bytes of the flow-control receive window. Default: `100000`.
+    /// - `keep_alive_interval`: u64. QUIC keep-alive period (in milliseconds). Default: `5000`.
+    /// - `max_idle_timeout`: u64. Close after this much idle time (in middleseconds). Default: `10000`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+quic://user:secret@localhost:8080\
+    ///      ?validate_certificate=true&heartbeat_interval=5s\
+    ///      &reconnection_max_retries=unlimited&reconnection_interval=1s&reconnection_reestablish_after=5s\
+    ///      &response_buffer_size=10000000&max_concurrent_bidi_streams=10000\
+    ///      &datagram_send_buffer_size=100000&initial_mtu=1200\
+    ///      &send_window=100000&receive_window=100000\
+    ///      &keep_alive_interval=5000&max_idle_timeout=10000",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## HTTP
+    ///
+    /// A REST transport. Iggy uses the `reqwest` crate to manage the HTTP client.
+    /// Hence, transport specific configuration is abstracted away.
+    ///
+    /// Configurable options are:
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `retries`: u32. Number of retries when sending a request. Default: `3`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+http://user:secret@localhost:3000?heartbeat_interval=5s&retries=3",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## WebSocket
+    ///
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `reconnection_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`IggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `read_buffer_size`: usize. Size of the read buffer in bytes. Default: unset.

Review Comment:
   these buffer sizes aren't unset, the tungstenite defaults apply: 131072 read/write, `usize::MAX` max write, 67108864 message, 16777216 frame. the example at line 382 sets `max_write_buffer_size=131072`, which panics tungstenite on connect - drop that key.



##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,166 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Many operations can read
+/// from the connection concurrently, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can
+/// configure routing to partitions within a topic yourself dependent on the stream,
+/// topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create()`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The `IggyClient` provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both trade typed API's safety for low-level control. You need to know the server codes and the wire format.
+///
+/// # Usage
+///
+/// The typical lifecycle of an `IggyClient` is construct, [`connect()`], use, and finally shutdown.
+///
+/// 1. Construct a client from a connection string ([`from_connection_string()`]),
+///    from the [`builder()`], or by wrapping an existing transport client with
+///    [`new()`] / [`create()`].
+/// 2. Call [`connect()`] to establish the connection. If the transport was
+///    configured with auto-login, this also authenticates. Otherwise call
+///    [`login_user()`] afterwards.
+/// 3. Spawn [`IggyConsumer`]s and [`IggyProducer`]s to write to, and consume messages
+///    from, the server.
+/// 4. To shut everything down, call [`IggyConsumer::shutdown()`] on each consumer to store their
+///    final offset and leave consumer groups. Then, call [`IggyProducer::shutdown()`] on each
+///    [`IggyProducer`] so that _background_ producers flush the latest state. Finally,
+///    call [`shutdown()`] on the [`IggyClient`] which closes the connection and stops the heartbeat.
+///    Use [`disconnect()`] rather than [`shutdown()`] to close the connection but keep the client usable, as a
+///    client that has been shut down cannot reconnect.
+///
+/// # Examples
+///
+/// Build a client from a connection string, connect, publish through a
+/// background batching producer, consume with a standalone consumer, and shut down cleanly.
+///
+/// ```no_run
+/// use iggy::prelude::*;
+/// use futures_util::StreamExt;
+/// use std::str::FromStr;
+///
+/// # async fn run() -> Result<(), IggyError> {
+/// // Auto-logs in from the credentials in the string and retries forever on disconnect.
+/// let client = IggyClient::builder_from_connection_string(
+///     "iggy+tcp://user:secret@localhost:8090\
+///      ?reconnection_retries=unlimited&reconnection_interval=1s&heartbeat_interval=5s&nodelay=true",
+/// )?
+/// .build()?;
+/// client.connect().await?;
+///
+/// // A background producer batches in the background, retries failed sends,
+/// // and creates a topic.
+/// let producer = client
+///     .producer("orders", "created")?
+///     .background(
+///         BackgroundConfig::builder()
+///             .batch_length(1000)
+///             .linger_time(IggyDuration::ONE_SECOND)
+///             .build(),
+///     )
+///     .partitioning(Partitioning::balanced())
+///     .send_retries(Some(3), Some(NonZeroIggyDuration::ONE_SECOND))
+///     .create_topic_if_not_exists(
+///         3,
+///         IggyExpiry::ServerDefault,
+///         MaxTopicSize::ServerDefault,
+///     )
+///     .build();
+/// producer.init().await?;
+/// producer
+///     .send(vec![IggyMessage::from_str("our-first-message")?])
+///     .await?;
+///
+/// // A consumer pinned to one partition, committing its offset

Review Comment:
   also at lines 600, 613, 665, 678 and lib.rs:116-118.
   
   `PollingMessages` commits on the poll request, before the app sees the batch, so a crash mid-batch skips those messages - that isn't 'resume where it left off'. use `ConsumingAllMessages` or say it's at-most-once; the builder default behaves the same.



##########
core/sdk/src/lib.rs:
##########
@@ -15,6 +15,284 @@
 // specific language governing permissions and limitations
 // under the License.
 
+//! Apache Iggy is a high-performance, persistent message streaming platform written in
+//! Rust, capable of processing millions of messages per second with ultra-low latency.
+//! It is part of the [`Apache Software Foundation`] (ASF).
+//!
+//! **This library is the Apache Iggy SDK.**
+//! It exposes a low-level and a high-level API for the Apache Iggy message streaming
+//! infrastructure for the Rust programming language.
+//! SDKs for other programming languages can be found in [`foreign`] of the root
+//! repository on GitHub.
+//!
+//! The core of Iggy is the message streaming server.
+//! In essence it is a persisted append-only log data structure concerned with making
+//! reads and writes highly efficient.
+//! For that, the server exposes *commands* that can be triggered to change its state,
+//! such as adding users, setting permissions, adding new streams and topics or reading
+//! and writing messages to and from the log.
+//! A comprehensive overview of commands can be found in the [`schema spec`] on the
+//! website, or in the [`server command enum`] within the source code.
+//!
+//! The SDK provides tools to build production ready message-streaming applications.
+//! It exposes its functionality at two levels. The [high-level API](#high-level-api)
+//! is transport-agnostic and already ships with useful features that a production
+//! application needs, such as message batching, retry policies and offset-tracking.
+//! The [low-level API](#low-level-api) is the set of concrete transport clients that
+//! speak the wire protocol directly and that the high-level API is built on top of.
+//! It is recommended to start with the high-level API, and utilize the low-level API
+//! in case the high-level API cannot satisfy your requirements.
+//!
+//! # High-level API
+//!
+//! The high-level API is most likely what you are looking for, especially if you are new
+//! to building message-streaming applications with Iggy.
+//! High-level API clients already provide common message-streaming features that
+//! you would otherwise need to build yourself.
+//!
+//! There are three client types:
+//! - [`IggyClient`] is the entry point and the full API surface. It owns the
+//!   connection and implements every domain trait, including [`MessageClient`]
+//!   with the raw [`send_messages`] and [`poll_messages`] primitives. For both, each call
+//!   is a single, stateless request, i.e. there is no batching, retries, offset tracking,
+//!   or polling loop.
+//! - [`IggyProducer`] exposes all configuration and functionality to produce (send)
+//!   messages to a specific topic in a stream. It shares the connection from the
+//!   [`IggyClient`].
+//! - [`IggyConsumer`] exposes all configuration and functionality to consume (read)
+//!   messages from a specific topic and stream. It also shares the connection from the
+//!   [`IggyClient`].
+//!
+//! You do not construct the producer and consumer independently. Spawn their builders
+//! from an [`IggyClient`] with [`IggyClient::producer`] and
+//! [`IggyClient::consumer`] so they share its connection.
+//!
+//! ## When to use each
+//!
+//! Reach for [`IggyClient`] directly for administrative tasks such as
+//! creating streams, topics, users, and consumer groups, reading or storing
+//! offsets, or sending and polling a handful of messages in a script.
+//! Reach for [`IggyProducer`] and [`IggyConsumer`] when producing and consuming messages.
+//!
+//! The [`IggyProducer`] has two modes you can pick from when building it:
+//! **direct** ([`DirectConfig`]), where a send goes out on the calling task, or
+//! **background** ([`BackgroundConfig`]), where a send is buffered and sending
+//! is offloaded to worker tasks.
+//!
+//! Additionally it provides the following features:
+//!
+//! - **Retries** with a configurable count and interval.
+//! - A pluggable **partitioning strategy** ([`Partitioner`]).
+//! - **Encryption** of message payloads before they leave the process.
+//! - **Auto-creation** of the stream and topic if they do not exist yet.
+//!
+//! Only in **direct** mode:
+//! - **Chunking** splits an input larger than `batch_length` into several
+//!   requests, and `linger_time` sets a minimum delay between them.
+//!
+//! Only in **background** mode:
+//! - **Batching** collects messages until the batch size in bytes, the message
+//!   count, or the linger interval is reached, whichever comes first.
+//! - **Shard workers** run several send loops in parallel (`num_shards`), which
+//!   helps when one producer writes to several streams or topics.
+//! - A **sharding strategy** ([`Sharding`]) decides which worker a batch goes to:
+//!   [`OrderedSharding`] keeps messages for the same stream and topic in order,
+//!   [`BalancedSharding`] spreads them round-robin for throughput.
+//! - **Backpressure** bounds the bytes buffered across all workers and the number
+//!   of in-flight batches. With a [`BackpressureMode`] you can decide whether a full buffer
+//!   blocks, blocks with a timeout, or fails immediately.
+//! - **Ordering control** through `max_in_flight`.
+//! - An **error callback** ([`ErrorCallback`]) receives the messages a background
+//!   send could not deliver, together with the confirmations that did commit.
+//! - **Graceful shutdown** flushes what is still buffered, which dropping the
+//!   producer does not.
+//!
+//! The [`IggyConsumer`] has:
+//! - A [`futures::Stream`] implementation, so a `while let Some(message) =
+//!   consumer.next().await` loop drives polling, paging, and the poll interval
+//!   for you.
+//! - A **polling strategy** ([`PollingStrategy`]: `next`, `offset`, or
+//!   `timestamp`) that tracks position.
+//! - **Auto-commit** ([`AutoCommit`]) stores the offset on an interval, or when
+//!   messages are polled, consumed one by one, consumed in full, or every Nth
+//!   message, so a restart resumes where it left off.
+//! - **Manual offset control** to store, read, or delete the offset of any
+//!   partition yourself when auto-commit is disabled or not enough.
+//! - A **shared state handle** ([`IggyConsumerState`]) that another task can clone
+//!   to read offsets or commit while the consuming loop holds the consumer.
+//! - **Replay control** drops messages this consumer already consumed, unless you
+//!   opt into replaying them with `allow_replay`.
+//! - **Auto-join** of the consumer group, optionally creating it, plus a rejoin
+//!   once the server revokes membership or the connection comes back.
+//! - **Reconnection handling** pauses polling while the client is disconnected and
+//!   resumes it after the reconnect and the rejoin have gone through.
+//! - **Init retries** wait for the stream and topic to appear instead of failing
+//!   right away when the consumer starts before they exist.
+//! - Payload **decryption**.
+//! - **Graceful shutdown** flushes pending offsets and leaves the consumer group.
+//!
+//! For details on the specific behavior of each feature, reach for the type-level
+//! documentation.
+//!
+//! # Stream builder API
+//!
+//! The stream builder API is a convenient way to use the high-level API.
+//! [`IggyStream`], [`IggyStreamProducer`], and [`IggyStreamConsumer`] construct
+//! everything at once. You can pass an [`IggyClient`] (or just a connection string)
+//! together with a config, and they hand back a ready, connected
+//! [`IggyProducer`] / [`IggyConsumer`].
+//! Compared to the **high-level API**, it changes how you construct
+//! producers and consumers, not what they can do. Instead of chaining an
+//! [`IggyProducerBuilder`] / [`IggyConsumerBuilder`] and setting each option
+//! with a method call, you describe the whole setup once in an
+//! [`IggyStreamConfig`] (or in a single [`IggyProducerConfig`] /
+//! [`IggyConsumerConfig`] when you only need one side) and build from it. The result is
+//! the same [`IggyProducer`] and [`IggyConsumer`] the builders produce, backed
+//! by the same [`IggyClient`].
+//!
+//! # Low-level API
+//!
+//! The low-level API is the set of concrete transport clients: [`TcpClient`],
+//! [`QuicClient`], [`WebSocketClient`], and [`HttpClient`]. Each one implements
+//! [`Client`], the supertrait that pulls in every domain-specific trait, so a
+//! transport client on its own can already drive the full server API. The
+//! high-level [`IggyClient`] is one more layer over exactly these types.
+//!
+//! ## Differences to the high-level API
+//!
+//! - **Transport is fixed at compile time.** You name a concrete type
+//!   ([`TcpClient`], [`QuicClient`], and so on) instead of configuring a
+//!   transport-agnostic [`IggyClient`]. Swapping transports means swapping the
+//!   type, not changing a connection-string scheme.
+//! - **No managed connection.** [`IggyClient`] owns a shared connection and
+//!   spawns a heartbeat task to keep it alive. A transport client does neither.
+//!   You own the connection lifecycle and must ping the server

Review Comment:
   transport clients do manage the connection: `TcpClient` (quic and ws too) reconnects with unlimited retries by default and re-logs-in. without `IggyClient` you lose the heartbeat task and the shared handle, nothing else.



##########
core/sdk/src/lib.rs:
##########
@@ -15,6 +15,284 @@
 // specific language governing permissions and limitations
 // under the License.
 
+//! Apache Iggy is a high-performance, persistent message streaming platform written in
+//! Rust, capable of processing millions of messages per second with ultra-low latency.
+//! It is part of the [`Apache Software Foundation`] (ASF).
+//!
+//! **This library is the Apache Iggy SDK.**
+//! It exposes a low-level and a high-level API for the Apache Iggy message streaming
+//! infrastructure for the Rust programming language.
+//! SDKs for other programming languages can be found in [`foreign`] of the root
+//! repository on GitHub.
+//!
+//! The core of Iggy is the message streaming server.
+//! In essence it is a persisted append-only log data structure concerned with making
+//! reads and writes highly efficient.
+//! For that, the server exposes *commands* that can be triggered to change its state,
+//! such as adding users, setting permissions, adding new streams and topics or reading
+//! and writing messages to and from the log.
+//! A comprehensive overview of commands can be found in the [`schema spec`] on the
+//! website, or in the [`server command enum`] within the source code.
+//!
+//! The SDK provides tools to build production ready message-streaming applications.
+//! It exposes its functionality at two levels. The [high-level API](#high-level-api)
+//! is transport-agnostic and already ships with useful features that a production
+//! application needs, such as message batching, retry policies and offset-tracking.
+//! The [low-level API](#low-level-api) is the set of concrete transport clients that
+//! speak the wire protocol directly and that the high-level API is built on top of.
+//! It is recommended to start with the high-level API, and utilize the low-level API
+//! in case the high-level API cannot satisfy your requirements.
+//!
+//! # High-level API
+//!
+//! The high-level API is most likely what you are looking for, especially if you are new
+//! to building message-streaming applications with Iggy.
+//! High-level API clients already provide common message-streaming features that
+//! you would otherwise need to build yourself.
+//!
+//! There are three client types:
+//! - [`IggyClient`] is the entry point and the full API surface. It owns the
+//!   connection and implements every domain trait, including [`MessageClient`]
+//!   with the raw [`send_messages`] and [`poll_messages`] primitives. For both, each call
+//!   is a single, stateless request, i.e. there is no batching, retries, offset tracking,
+//!   or polling loop.
+//! - [`IggyProducer`] exposes all configuration and functionality to produce (send)
+//!   messages to a specific topic in a stream. It shares the connection from the
+//!   [`IggyClient`].
+//! - [`IggyConsumer`] exposes all configuration and functionality to consume (read)
+//!   messages from a specific topic and stream. It also shares the connection from the
+//!   [`IggyClient`].
+//!
+//! You do not construct the producer and consumer independently. Spawn their builders
+//! from an [`IggyClient`] with [`IggyClient::producer`] and
+//! [`IggyClient::consumer`] so they share its connection.
+//!
+//! ## When to use each
+//!
+//! Reach for [`IggyClient`] directly for administrative tasks such as
+//! creating streams, topics, users, and consumer groups, reading or storing
+//! offsets, or sending and polling a handful of messages in a script.
+//! Reach for [`IggyProducer`] and [`IggyConsumer`] when producing and consuming messages.
+//!
+//! The [`IggyProducer`] has two modes you can pick from when building it:
+//! **direct** ([`DirectConfig`]), where a send goes out on the calling task, or
+//! **background** ([`BackgroundConfig`]), where a send is buffered and sending
+//! is offloaded to worker tasks.
+//!
+//! Additionally it provides the following features:
+//!
+//! - **Retries** with a configurable count and interval.
+//! - A pluggable **partitioning strategy** ([`Partitioner`]).
+//! - **Encryption** of message payloads before they leave the process.
+//! - **Auto-creation** of the stream and topic if they do not exist yet.
+//!
+//! Only in **direct** mode:
+//! - **Chunking** splits an input larger than `batch_length` into several
+//!   requests, and `linger_time` sets a minimum delay between them.
+//!
+//! Only in **background** mode:
+//! - **Batching** collects messages until the batch size in bytes, the message
+//!   count, or the linger interval is reached, whichever comes first.

Review Comment:
   `batch_length` counts buffered `send()` calls, not messages - `producer_sharding.rs:182` compares `buffer.len()` and each entry holds a whole `Vec<IggyMessage>`. say 'number of buffered sends'.



##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,166 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Many operations can read
+/// from the connection concurrently, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can
+/// configure routing to partitions within a topic yourself dependent on the stream,
+/// topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create()`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The `IggyClient` provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both trade typed API's safety for low-level control. You need to know the server codes and the wire format.
+///
+/// # Usage
+///
+/// The typical lifecycle of an `IggyClient` is construct, [`connect()`], use, and finally shutdown.
+///
+/// 1. Construct a client from a connection string ([`from_connection_string()`]),
+///    from the [`builder()`], or by wrapping an existing transport client with
+///    [`new()`] / [`create()`].
+/// 2. Call [`connect()`] to establish the connection. If the transport was
+///    configured with auto-login, this also authenticates. Otherwise call
+///    [`login_user()`] afterwards.
+/// 3. Spawn [`IggyConsumer`]s and [`IggyProducer`]s to write to, and consume messages
+///    from, the server.
+/// 4. To shut everything down, call [`IggyConsumer::shutdown()`] on each consumer to store their
+///    final offset and leave consumer groups. Then, call [`IggyProducer::shutdown()`] on each
+///    [`IggyProducer`] so that _background_ producers flush the latest state. Finally,
+///    call [`shutdown()`] on the [`IggyClient`] which closes the connection and stops the heartbeat.
+///    Use [`disconnect()`] rather than [`shutdown()`] to close the connection but keep the client usable, as a
+///    client that has been shut down cannot reconnect.

Review Comment:
   with auto-login the heartbeat reconnects and re-logs-in within one interval, so an explicit `disconnect()` gets undone. say so, or point readers at `shutdown()` (tcp/quic/ws only, http `shutdown` does nothing).



##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,166 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Many operations can read
+/// from the connection concurrently, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can
+/// configure routing to partitions within a topic yourself dependent on the stream,
+/// topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create()`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The `IggyClient` provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both trade typed API's safety for low-level control. You need to know the server codes and the wire format.
+///
+/// # Usage
+///
+/// The typical lifecycle of an `IggyClient` is construct, [`connect()`], use, and finally shutdown.
+///
+/// 1. Construct a client from a connection string ([`from_connection_string()`]),
+///    from the [`builder()`], or by wrapping an existing transport client with
+///    [`new()`] / [`create()`].
+/// 2. Call [`connect()`] to establish the connection. If the transport was
+///    configured with auto-login, this also authenticates. Otherwise call

Review Comment:
   also at lines 350-353 and 875-891 (both http examples).
   
   http ignores the connection-string credentials - `HttpClientConfig::from` drops them and `connect()` is a no-op - so both http examples send an empty bearer and get unauthorized. call `login_user()` first, and say http needs it.



##########
core/sdk/src/clients/client.rs:
##########
@@ -163,7 +643,52 @@ impl IggyClient {
         ))
     }
 
-    /// Returns the builder for the consumer group.
+    /// Returns an [`IggyConsumerBuilder`] for a member of a consumer group.
+    ///
+    /// Copies the client and the encryptor registered with the [`IggyClient`]
+    /// into a [`IggyConsumerBuilder`] and returns it.
+    /// Sets the consumer to [`ConsumerKind::ConsumerGroup`], i.e. a member of a
+    /// load-balanced group. The provided name identifies the group.
+    /// Registers the member for every partition of `topic` in `stream`. The
+    /// group then balances those partitions across its members, so each message is

Review Comment:
   delivery is at-least-once, not exactly one member - a rebalance moves polled-but-uncommitted partitions to another member, which re-reads them (`consumer_group.rs:141-148` spells this out). say 'each partition is served by one member at a time; uncommitted messages can be redelivered'.



##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,166 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Many operations can read
+/// from the connection concurrently, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can
+/// configure routing to partitions within a topic yourself dependent on the stream,
+/// topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create()`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The `IggyClient` provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both trade typed API's safety for low-level control. You need to know the server codes and the wire format.
+///
+/// # Usage
+///
+/// The typical lifecycle of an `IggyClient` is construct, [`connect()`], use, and finally shutdown.
+///
+/// 1. Construct a client from a connection string ([`from_connection_string()`]),
+///    from the [`builder()`], or by wrapping an existing transport client with
+///    [`new()`] / [`create()`].
+/// 2. Call [`connect()`] to establish the connection. If the transport was
+///    configured with auto-login, this also authenticates. Otherwise call
+///    [`login_user()`] afterwards.
+/// 3. Spawn [`IggyConsumer`]s and [`IggyProducer`]s to write to, and consume messages
+///    from, the server.
+/// 4. To shut everything down, call [`IggyConsumer::shutdown()`] on each consumer to store their
+///    final offset and leave consumer groups. Then, call [`IggyProducer::shutdown()`] on each
+///    [`IggyProducer`] so that _background_ producers flush the latest state. Finally,
+///    call [`shutdown()`] on the [`IggyClient`] which closes the connection and stops the heartbeat.
+///    Use [`disconnect()`] rather than [`shutdown()`] to close the connection but keep the client usable, as a
+///    client that has been shut down cannot reconnect.
+///
+/// # Examples
+///
+/// Build a client from a connection string, connect, publish through a
+/// background batching producer, consume with a standalone consumer, and shut down cleanly.
+///
+/// ```no_run
+/// use iggy::prelude::*;
+/// use futures_util::StreamExt;
+/// use std::str::FromStr;
+///
+/// # async fn run() -> Result<(), IggyError> {
+/// // Auto-logs in from the credentials in the string and retries forever on disconnect.
+/// let client = IggyClient::builder_from_connection_string(
+///     "iggy+tcp://user:secret@localhost:8090\
+///      ?reconnection_retries=unlimited&reconnection_interval=1s&heartbeat_interval=5s&nodelay=true",
+/// )?
+/// .build()?;
+/// client.connect().await?;
+///
+/// // A background producer batches in the background, retries failed sends,
+/// // and creates a topic.
+/// let producer = client
+///     .producer("orders", "created")?
+///     .background(
+///         BackgroundConfig::builder()
+///             .batch_length(1000)
+///             .linger_time(IggyDuration::ONE_SECOND)
+///             .build(),
+///     )
+///     .partitioning(Partitioning::balanced())
+///     .send_retries(Some(3), Some(NonZeroIggyDuration::ONE_SECOND))
+///     .create_topic_if_not_exists(
+///         3,
+///         IggyExpiry::ServerDefault,
+///         MaxTopicSize::ServerDefault,
+///     )
+///     .build();
+/// producer.init().await?;
+/// producer
+///     .send(vec![IggyMessage::from_str("our-first-message")?])
+///     .await?;
+///
+/// // A consumer pinned to one partition, committing its offset
+/// // automatically so a restart resumes where it left off.
+/// let mut consumer = client
+///     .consumer("consumer_name", "stream_name", "topic_name", 1)?
+///     .auto_commit(AutoCommit::When(AutoCommitWhen::PollingMessages))
+///     .polling_strategy(PollingStrategy::next())
+///     .poll_interval(IggyDuration::ONE_SECOND)
+///     .batch_length(1000)
+///     .build();
+/// consumer.init().await?;
+///
+/// while let Some(message) = consumer.next().await {
+///     let message = message?;
+///     // Handle `message.message.payload` here however required
+///     break;
+/// }
+///
+/// client.shutdown().await?;

Review Comment:
   background producer with only `client.shutdown()` skips the drain step 4 above requires. add `consumer.shutdown().await?; producer.shutdown().await;` before this.



##########
core/sdk/src/clients/client.rs:
##########
@@ -75,19 +232,209 @@ impl Default for IggyClient {
 }
 
 impl IggyClient {
-    /// Creates a new `IggyClientBuilder`.
+    /// Returns an empty [`IggyClientBuilder`].
+    ///
+    /// The returned builder is not ready to be [`IggyClientBuilder::build()`].
+    /// It sill needs to configure a mode of transport.
     pub fn builder() -> IggyClientBuilder {
         IggyClientBuilder::new()
     }
 
-    /// Creates a new `IggyClientBuilder` from the provided connection string.
+    /// Creates an [`IggyClientBuilder`] with the transport preconfigured from a
+    /// connection string.
+    ///
+    /// The transport is selected from the scheme:
+    /// - `iggy://` defaults to TCP.
+    /// - `iggy+tcp://` for TCP.
+    /// - `iggy+quic://` for QUIC.
+    /// - `iggy+http://` for HTTP.
+    /// - `iggy+ws://` for WebSocket.
+    ///
+    /// Authentication at the server is mandatory.
+    /// - user + password: `<user>:<password>@<host>:<port>`
+    /// - personal access token: `<personal_access_token>@host:port`
+    ///
+    /// Optional `?key=value&key=value` queries carry transport specific
+    /// configuration. The query is parsed per transport, so the accepted keys differ
+    /// by scheme. An unknown key is rejected.
+    /// If no queries are provided optional configurations are automatically set to their default values.
+    ///
+    /// # Examples
+    ///
+    /// Each example lists configuration options per transport mode and shows
+    /// one concrete example.
+    ///
+    /// If the value of an option is
+    /// - a duration pass a `humantime` string such as `5s`, `500ms`, or `1h 1m 1s`.
+    ///   These are cast into an [`IggyDuration`].
+    ///   Note, `unlimited`, `none`, `disabled`, and `0` parse to zero.
+    /// - a retry count use either the literal `unlimited` or a number such as `5`.
+    /// - a bool use the literal `true` or `false`.
+    /// - bytes and millisecond options provide a number such as `1024`.
+    ///
+    /// ## TCP
+    ///
+    /// The same options apply for `iggy://` and `iggy+tcp://`.
+    ///
+    /// - `tls`: bool. Enable/disable TLS. Default: `false`.
+    /// - `tls_domain`: string. Server name to validate the certificate against. Default: unset.
+    /// - `tls_ca_file`: filesystem path. Extra CA certificate to trust. Default: unset.
+    /// - `reconnection_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`IggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `nodelay`: `bool`. Disable Nagle's algorithm (`TCP_NODELAY`). Default: `false`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+tcp://user:secret@localhost:8090\
+    ///      ?tls=true&tls_domain=localhost&tls_ca_file=/etc/iggy/ca.pem\
+    ///      &reconnection_retries=unlimited&reconnection_interval=1s&reestablish_after=5s\
+    ///      &heartbeat_interval=5s&nodelay=true",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## QUIC
+    ///
+    /// - `validate_certificate`: bool. Verify the server certificate. Default: `false`.
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `reconnection_max_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`IggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reconnection_reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `response_buffer_size`: u64. Number of bytes in the response receive buffer. Default: `10000000`.
+    /// - `max_concurrent_bidi_streams`: u64. Number of concurrent bidirectional streams. Default: `10000`.
+    /// - `datagram_send_buffer_size`: u64. Number of bytes in the datagram send buffer. Default: `100000`.
+    /// - `initial_mtu`: u16. Initial MTU estimate (in bytes). Default: `1200`.
+    /// - `send_window`: u64. Number of bytes bytes of the flow-control send window. Default: `100000`.
+    /// - `receive_window`: u64. Number of bytes of the flow-control receive window. Default: `100000`.
+    /// - `keep_alive_interval`: u64. QUIC keep-alive period (in milliseconds). Default: `5000`.
+    /// - `max_idle_timeout`: u64. Close after this much idle time (in middleseconds). Default: `10000`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+quic://user:secret@localhost:8080\
+    ///      ?validate_certificate=true&heartbeat_interval=5s\
+    ///      &reconnection_max_retries=unlimited&reconnection_interval=1s&reconnection_reestablish_after=5s\
+    ///      &response_buffer_size=10000000&max_concurrent_bidi_streams=10000\
+    ///      &datagram_send_buffer_size=100000&initial_mtu=1200\
+    ///      &send_window=100000&receive_window=100000\
+    ///      &keep_alive_interval=5000&max_idle_timeout=10000",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## HTTP
+    ///
+    /// A REST transport. Iggy uses the `reqwest` crate to manage the HTTP client.
+    /// Hence, transport specific configuration is abstracted away.
+    ///
+    /// Configurable options are:
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `retries`: u32. Number of retries when sending a request. Default: `3`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+http://user:secret@localhost:3000?heartbeat_interval=5s&retries=3",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## WebSocket
+    ///
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `reconnection_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`IggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `read_buffer_size`: usize. Size of the read buffer in bytes. Default: unset.
+    /// - `write_buffer_size`: usize. Size of the write buffer in bytes. Default: unset.
+    /// - `max_write_buffer_size`: usize. Maximum size of the write buffer in bytes. Default: unset.
+    /// - `max_message_size`: usize. Maximum accepted message size in bytes. Default: unset.
+    /// - `max_frame_size`: usize. Maximum accepted frame size in bytes. Default: unset.
+    /// - `accept_unmasked_frames`: bool. Accept/ decline unmasked frames. Default: `false`.
+    /// - `tls`: `bool`. Enable/disbale TLS. Default: `false`.
+    /// - `tls_domain`: string. Server name to validate the certificate against. Default: unset.
+    /// - `tls_ca_file`: filesystem path. Extra CA certificate to trust. Default: unset.
+    /// - `tls_validate_certificate`: bool. Whether to verify the server certificate. Default: `false`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+ws://user:secret@localhost:8090\

Review Comment:
   ws default port is 8092, 8090 is tcp.



##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,166 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Many operations can read
+/// from the connection concurrently, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can
+/// configure routing to partitions within a topic yourself dependent on the stream,
+/// topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create()`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The `IggyClient` provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both trade typed API's safety for low-level control. You need to know the server codes and the wire format.
+///
+/// # Usage
+///
+/// The typical lifecycle of an `IggyClient` is construct, [`connect()`], use, and finally shutdown.
+///
+/// 1. Construct a client from a connection string ([`from_connection_string()`]),
+///    from the [`builder()`], or by wrapping an existing transport client with
+///    [`new()`] / [`create()`].
+/// 2. Call [`connect()`] to establish the connection. If the transport was
+///    configured with auto-login, this also authenticates. Otherwise call
+///    [`login_user()`] afterwards.
+/// 3. Spawn [`IggyConsumer`]s and [`IggyProducer`]s to write to, and consume messages
+///    from, the server.
+/// 4. To shut everything down, call [`IggyConsumer::shutdown()`] on each consumer to store their
+///    final offset and leave consumer groups. Then, call [`IggyProducer::shutdown()`] on each
+///    [`IggyProducer`] so that _background_ producers flush the latest state. Finally,
+///    call [`shutdown()`] on the [`IggyClient`] which closes the connection and stops the heartbeat.
+///    Use [`disconnect()`] rather than [`shutdown()`] to close the connection but keep the client usable, as a
+///    client that has been shut down cannot reconnect.
+///
+/// # Examples
+///
+/// Build a client from a connection string, connect, publish through a
+/// background batching producer, consume with a standalone consumer, and shut down cleanly.
+///
+/// ```no_run
+/// use iggy::prelude::*;
+/// use futures_util::StreamExt;
+/// use std::str::FromStr;
+///
+/// # async fn run() -> Result<(), IggyError> {
+/// // Auto-logs in from the credentials in the string and retries forever on disconnect.
+/// let client = IggyClient::builder_from_connection_string(
+///     "iggy+tcp://user:secret@localhost:8090\
+///      ?reconnection_retries=unlimited&reconnection_interval=1s&heartbeat_interval=5s&nodelay=true",
+/// )?
+/// .build()?;
+/// client.connect().await?;
+///
+/// // A background producer batches in the background, retries failed sends,
+/// // and creates a topic.
+/// let producer = client
+///     .producer("orders", "created")?
+///     .background(
+///         BackgroundConfig::builder()
+///             .batch_length(1000)
+///             .linger_time(IggyDuration::ONE_SECOND)
+///             .build(),
+///     )
+///     .partitioning(Partitioning::balanced())
+///     .send_retries(Some(3), Some(NonZeroIggyDuration::ONE_SECOND))
+///     .create_topic_if_not_exists(
+///         3,
+///         IggyExpiry::ServerDefault,
+///         MaxTopicSize::ServerDefault,
+///     )
+///     .build();
+/// producer.init().await?;
+/// producer
+///     .send(vec![IggyMessage::from_str("our-first-message")?])
+///     .await?;
+///
+/// // A consumer pinned to one partition, committing its offset
+/// // automatically so a restart resumes where it left off.
+/// let mut consumer = client
+///     .consumer("consumer_name", "stream_name", "topic_name", 1)?

Review Comment:
   the producer above writes `orders`/`created` but this consumer reads `stream_name`/`topic_name`, so `init()` fails with `StreamNameNotFound`. use the same stream and topic.



##########
core/sdk/src/lib.rs:
##########
@@ -15,6 +15,284 @@
 // specific language governing permissions and limitations
 // under the License.
 
+//! Apache Iggy is a high-performance, persistent message streaming platform written in
+//! Rust, capable of processing millions of messages per second with ultra-low latency.
+//! It is part of the [`Apache Software Foundation`] (ASF).
+//!
+//! **This library is the Apache Iggy SDK.**
+//! It exposes a low-level and a high-level API for the Apache Iggy message streaming
+//! infrastructure for the Rust programming language.
+//! SDKs for other programming languages can be found in [`foreign`] of the root
+//! repository on GitHub.
+//!
+//! The core of Iggy is the message streaming server.
+//! In essence it is a persisted append-only log data structure concerned with making
+//! reads and writes highly efficient.
+//! For that, the server exposes *commands* that can be triggered to change its state,
+//! such as adding users, setting permissions, adding new streams and topics or reading
+//! and writing messages to and from the log.
+//! A comprehensive overview of commands can be found in the [`schema spec`] on the
+//! website, or in the [`server command enum`] within the source code.
+//!
+//! The SDK provides tools to build production ready message-streaming applications.
+//! It exposes its functionality at two levels. The [high-level API](#high-level-api)
+//! is transport-agnostic and already ships with useful features that a production
+//! application needs, such as message batching, retry policies and offset-tracking.
+//! The [low-level API](#low-level-api) is the set of concrete transport clients that
+//! speak the wire protocol directly and that the high-level API is built on top of.
+//! It is recommended to start with the high-level API, and utilize the low-level API
+//! in case the high-level API cannot satisfy your requirements.
+//!
+//! # High-level API
+//!
+//! The high-level API is most likely what you are looking for, especially if you are new
+//! to building message-streaming applications with Iggy.
+//! High-level API clients already provide common message-streaming features that
+//! you would otherwise need to build yourself.
+//!
+//! There are three client types:
+//! - [`IggyClient`] is the entry point and the full API surface. It owns the
+//!   connection and implements every domain trait, including [`MessageClient`]
+//!   with the raw [`send_messages`] and [`poll_messages`] primitives. For both, each call
+//!   is a single, stateless request, i.e. there is no batching, retries, offset tracking,
+//!   or polling loop.
+//! - [`IggyProducer`] exposes all configuration and functionality to produce (send)
+//!   messages to a specific topic in a stream. It shares the connection from the
+//!   [`IggyClient`].
+//! - [`IggyConsumer`] exposes all configuration and functionality to consume (read)
+//!   messages from a specific topic and stream. It also shares the connection from the
+//!   [`IggyClient`].
+//!
+//! You do not construct the producer and consumer independently. Spawn their builders
+//! from an [`IggyClient`] with [`IggyClient::producer`] and
+//! [`IggyClient::consumer`] so they share its connection.
+//!
+//! ## When to use each
+//!
+//! Reach for [`IggyClient`] directly for administrative tasks such as
+//! creating streams, topics, users, and consumer groups, reading or storing
+//! offsets, or sending and polling a handful of messages in a script.
+//! Reach for [`IggyProducer`] and [`IggyConsumer`] when producing and consuming messages.
+//!
+//! The [`IggyProducer`] has two modes you can pick from when building it:
+//! **direct** ([`DirectConfig`]), where a send goes out on the calling task, or
+//! **background** ([`BackgroundConfig`]), where a send is buffered and sending
+//! is offloaded to worker tasks.
+//!
+//! Additionally it provides the following features:
+//!
+//! - **Retries** with a configurable count and interval.
+//! - A pluggable **partitioning strategy** ([`Partitioner`]).
+//! - **Encryption** of message payloads before they leave the process.
+//! - **Auto-creation** of the stream and topic if they do not exist yet.
+//!
+//! Only in **direct** mode:
+//! - **Chunking** splits an input larger than `batch_length` into several
+//!   requests, and `linger_time` sets a minimum delay between them.

Review Comment:
   `linger_time` spaces consecutive `send()` calls, not chunks - the wait runs once before the first chunk and the chunks of one send go back to back (`producer.rs:429-457`).



##########
core/sdk/src/clients/client.rs:
##########
@@ -75,19 +232,209 @@ impl Default for IggyClient {
 }
 
 impl IggyClient {
-    /// Creates a new `IggyClientBuilder`.
+    /// Returns an empty [`IggyClientBuilder`].
+    ///
+    /// The returned builder is not ready to be [`IggyClientBuilder::build()`].
+    /// It sill needs to configure a mode of transport.
     pub fn builder() -> IggyClientBuilder {
         IggyClientBuilder::new()
     }
 
-    /// Creates a new `IggyClientBuilder` from the provided connection string.
+    /// Creates an [`IggyClientBuilder`] with the transport preconfigured from a
+    /// connection string.
+    ///
+    /// The transport is selected from the scheme:
+    /// - `iggy://` defaults to TCP.
+    /// - `iggy+tcp://` for TCP.
+    /// - `iggy+quic://` for QUIC.
+    /// - `iggy+http://` for HTTP.
+    /// - `iggy+ws://` for WebSocket.
+    ///
+    /// Authentication at the server is mandatory.
+    /// - user + password: `<user>:<password>@<host>:<port>`
+    /// - personal access token: `<personal_access_token>@host:port`
+    ///
+    /// Optional `?key=value&key=value` queries carry transport specific
+    /// configuration. The query is parsed per transport, so the accepted keys differ
+    /// by scheme. An unknown key is rejected.
+    /// If no queries are provided optional configurations are automatically set to their default values.
+    ///
+    /// # Examples
+    ///
+    /// Each example lists configuration options per transport mode and shows
+    /// one concrete example.
+    ///
+    /// If the value of an option is
+    /// - a duration pass a `humantime` string such as `5s`, `500ms`, or `1h 1m 1s`.
+    ///   These are cast into an [`IggyDuration`].
+    ///   Note, `unlimited`, `none`, `disabled`, and `0` parse to zero.

Review Comment:
   also at lines 283, 285, 306, 308, 343, 360, 362.
   
   `heartbeat_interval` and `reconnection_interval` are `NonZeroIggyDuration` on every transport, so `0`/`none`/`unlimited` fail with `InvalidConnectionString` instead of parsing to zero. only `reestablish_after` takes zero.



##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,166 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Many operations can read

Review Comment:
   nothing takes the write lock - `connect`, `login_user` and `shutdown` all go through `read()`, the transports guard their own state. say every operation takes a shared read guard.



##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,166 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Many operations can read
+/// from the connection concurrently, while actions that reshape it, like
+/// connecting, reconnecting, or logging in, briefly take exclusive access.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can
+/// configure routing to partitions within a topic yourself dependent on the stream,
+/// topic, and/ or message contents.
+///
+/// The [`EncryptorKind`] encrypts each message payload before it leaves the client and decrypts it on
+/// the way back, keeping payloads opaque to the server. Attach either through
+/// [`create()`].
+///
+/// # What you can do
+///
+/// Configure a connection with an Iggy server and interact with it.
+/// The `IggyClient` provides various methods to setup the connection using connection strings,
+/// builder patterns or an already existing [`ClientWrapper`].
+/// You can spawn [`IggyConsumer`]s and [`IggyProducer`]s that share that connection.
+///
+/// The full server API is split into domain-specific traits.
+/// `IggyClient` implements [`Client`], the supertrait, which pulls every domain-specific trait.
+/// Bring the one you need into scope to call its methods.
+/// `use iggy::prelude::*` brings all of them in at once.
+///
+/// - [`SystemClient`]: ping, server statistics, snapshots, and connected-client info.
+/// - [`UserClient`]: create, inspect, update, and delete users and their permissions.
+/// - [`PersonalAccessTokenClient`]: create, list, and delete personal access tokens, log in with one.
+/// - [`StreamClient`]: create, get, update, delete, and purge streams.
+/// - [`TopicClient`]: create, get, update, delete, and purge topics within a stream.
+/// - [`PartitionClient`]: add and remove partitions on a topic.
+/// - [`SegmentClient`]: delete closed segments from a partition.
+/// - [`ConsumerGroupClient`]: create, get, delete, and join or leave consumer groups.
+/// - [`ConsumerOffsetClient`]: store, read, and delete consumer offsets.
+/// - [`MessageClient`]: send and poll messages, and flush the unsaved buffer.
+///
+/// Additionally, you can bypass invoking methods from these traits and directly talk to the server with [`send_binary_request`] and [`send_http_request`] for http.
+/// Both trade typed API's safety for low-level control. You need to know the server codes and the wire format.
+///
+/// # Usage
+///
+/// The typical lifecycle of an `IggyClient` is construct, [`connect()`], use, and finally shutdown.
+///
+/// 1. Construct a client from a connection string ([`from_connection_string()`]),
+///    from the [`builder()`], or by wrapping an existing transport client with
+///    [`new()`] / [`create()`].
+/// 2. Call [`connect()`] to establish the connection. If the transport was
+///    configured with auto-login, this also authenticates. Otherwise call
+///    [`login_user()`] afterwards.
+/// 3. Spawn [`IggyConsumer`]s and [`IggyProducer`]s to write to, and consume messages
+///    from, the server.
+/// 4. To shut everything down, call [`IggyConsumer::shutdown()`] on each consumer to store their
+///    final offset and leave consumer groups. Then, call [`IggyProducer::shutdown()`] on each
+///    [`IggyProducer`] so that _background_ producers flush the latest state. Finally,
+///    call [`shutdown()`] on the [`IggyClient`] which closes the connection and stops the heartbeat.

Review Comment:
   `shutdown()` doesn't stop the heartbeat, the task exits on its next tick when `ping` returns `ClientShutdown`. on http `shutdown` is a no-op and it runs until drop.



##########
core/sdk/src/lib.rs:
##########
@@ -15,6 +15,284 @@
 // specific language governing permissions and limitations
 // under the License.
 
+//! Apache Iggy is a high-performance, persistent message streaming platform written in
+//! Rust, capable of processing millions of messages per second with ultra-low latency.
+//! It is part of the [`Apache Software Foundation`] (ASF).
+//!
+//! **This library is the Apache Iggy SDK.**
+//! It exposes a low-level and a high-level API for the Apache Iggy message streaming
+//! infrastructure for the Rust programming language.
+//! SDKs for other programming languages can be found in [`foreign`] of the root
+//! repository on GitHub.
+//!
+//! The core of Iggy is the message streaming server.
+//! In essence it is a persisted append-only log data structure concerned with making
+//! reads and writes highly efficient.
+//! For that, the server exposes *commands* that can be triggered to change its state,
+//! such as adding users, setting permissions, adding new streams and topics or reading
+//! and writing messages to and from the log.
+//! A comprehensive overview of commands can be found in the [`schema spec`] on the
+//! website, or in the [`server command enum`] within the source code.
+//!
+//! The SDK provides tools to build production ready message-streaming applications.
+//! It exposes its functionality at two levels. The [high-level API](#high-level-api)
+//! is transport-agnostic and already ships with useful features that a production
+//! application needs, such as message batching, retry policies and offset-tracking.
+//! The [low-level API](#low-level-api) is the set of concrete transport clients that
+//! speak the wire protocol directly and that the high-level API is built on top of.
+//! It is recommended to start with the high-level API, and utilize the low-level API
+//! in case the high-level API cannot satisfy your requirements.
+//!
+//! # High-level API
+//!
+//! The high-level API is most likely what you are looking for, especially if you are new
+//! to building message-streaming applications with Iggy.
+//! High-level API clients already provide common message-streaming features that
+//! you would otherwise need to build yourself.
+//!
+//! There are three client types:
+//! - [`IggyClient`] is the entry point and the full API surface. It owns the
+//!   connection and implements every domain trait, including [`MessageClient`]
+//!   with the raw [`send_messages`] and [`poll_messages`] primitives. For both, each call
+//!   is a single, stateless request, i.e. there is no batching, retries, offset tracking,

Review Comment:
   not stateless either - http retries transient failures (default 3, can resend a `POST /messages`), tcp reconnects and replays safe requests, and `auto_commit: true` stores the offset server-side. say 'no producer/consumer-level policy' instead.



##########
core/sdk/src/lib.rs:
##########
@@ -15,6 +15,284 @@
 // specific language governing permissions and limitations
 // under the License.
 
+//! Apache Iggy is a high-performance, persistent message streaming platform written in
+//! Rust, capable of processing millions of messages per second with ultra-low latency.
+//! It is part of the [`Apache Software Foundation`] (ASF).
+//!
+//! **This library is the Apache Iggy SDK.**
+//! It exposes a low-level and a high-level API for the Apache Iggy message streaming
+//! infrastructure for the Rust programming language.
+//! SDKs for other programming languages can be found in [`foreign`] of the root
+//! repository on GitHub.
+//!
+//! The core of Iggy is the message streaming server.
+//! In essence it is a persisted append-only log data structure concerned with making
+//! reads and writes highly efficient.
+//! For that, the server exposes *commands* that can be triggered to change its state,
+//! such as adding users, setting permissions, adding new streams and topics or reading
+//! and writing messages to and from the log.
+//! A comprehensive overview of commands can be found in the [`schema spec`] on the
+//! website, or in the [`server command enum`] within the source code.
+//!
+//! The SDK provides tools to build production ready message-streaming applications.
+//! It exposes its functionality at two levels. The [high-level API](#high-level-api)
+//! is transport-agnostic and already ships with useful features that a production
+//! application needs, such as message batching, retry policies and offset-tracking.
+//! The [low-level API](#low-level-api) is the set of concrete transport clients that
+//! speak the wire protocol directly and that the high-level API is built on top of.
+//! It is recommended to start with the high-level API, and utilize the low-level API
+//! in case the high-level API cannot satisfy your requirements.
+//!
+//! # High-level API
+//!
+//! The high-level API is most likely what you are looking for, especially if you are new
+//! to building message-streaming applications with Iggy.
+//! High-level API clients already provide common message-streaming features that
+//! you would otherwise need to build yourself.
+//!
+//! There are three client types:
+//! - [`IggyClient`] is the entry point and the full API surface. It owns the
+//!   connection and implements every domain trait, including [`MessageClient`]
+//!   with the raw [`send_messages`] and [`poll_messages`] primitives. For both, each call
+//!   is a single, stateless request, i.e. there is no batching, retries, offset tracking,
+//!   or polling loop.
+//! - [`IggyProducer`] exposes all configuration and functionality to produce (send)
+//!   messages to a specific topic in a stream. It shares the connection from the
+//!   [`IggyClient`].
+//! - [`IggyConsumer`] exposes all configuration and functionality to consume (read)
+//!   messages from a specific topic and stream. It also shares the connection from the
+//!   [`IggyClient`].
+//!
+//! You do not construct the producer and consumer independently. Spawn their builders
+//! from an [`IggyClient`] with [`IggyClient::producer`] and
+//! [`IggyClient::consumer`] so they share its connection.
+//!
+//! ## When to use each
+//!
+//! Reach for [`IggyClient`] directly for administrative tasks such as
+//! creating streams, topics, users, and consumer groups, reading or storing
+//! offsets, or sending and polling a handful of messages in a script.
+//! Reach for [`IggyProducer`] and [`IggyConsumer`] when producing and consuming messages.
+//!
+//! The [`IggyProducer`] has two modes you can pick from when building it:
+//! **direct** ([`DirectConfig`]), where a send goes out on the calling task, or
+//! **background** ([`BackgroundConfig`]), where a send is buffered and sending
+//! is offloaded to worker tasks.
+//!
+//! Additionally it provides the following features:
+//!
+//! - **Retries** with a configurable count and interval.
+//! - A pluggable **partitioning strategy** ([`Partitioner`]).
+//! - **Encryption** of message payloads before they leave the process.
+//! - **Auto-creation** of the stream and topic if they do not exist yet.
+//!
+//! Only in **direct** mode:
+//! - **Chunking** splits an input larger than `batch_length` into several
+//!   requests, and `linger_time` sets a minimum delay between them.
+//!
+//! Only in **background** mode:
+//! - **Batching** collects messages until the batch size in bytes, the message
+//!   count, or the linger interval is reached, whichever comes first.
+//! - **Shard workers** run several send loops in parallel (`num_shards`), which
+//!   helps when one producer writes to several streams or topics.
+//! - A **sharding strategy** ([`Sharding`]) decides which worker a batch goes to:
+//!   [`OrderedSharding`] keeps messages for the same stream and topic in order,
+//!   [`BalancedSharding`] spreads them round-robin for throughput.
+//! - **Backpressure** bounds the bytes buffered across all workers and the number
+//!   of in-flight batches. With a [`BackpressureMode`] you can decide whether a full buffer
+//!   blocks, blocks with a timeout, or fails immediately.
+//! - **Ordering control** through `max_in_flight`.
+//! - An **error callback** ([`ErrorCallback`]) receives the messages a background
+//!   send could not deliver, together with the confirmations that did commit.
+//! - **Graceful shutdown** flushes what is still buffered, which dropping the
+//!   producer does not.
+//!
+//! The [`IggyConsumer`] has:
+//! - A [`futures::Stream`] implementation, so a `while let Some(message) =
+//!   consumer.next().await` loop drives polling, paging, and the poll interval
+//!   for you.
+//! - A **polling strategy** ([`PollingStrategy`]: `next`, `offset`, or
+//!   `timestamp`) that tracks position.
+//! - **Auto-commit** ([`AutoCommit`]) stores the offset on an interval, or when
+//!   messages are polled, consumed one by one, consumed in full, or every Nth
+//!   message, so a restart resumes where it left off.
+//! - **Manual offset control** to store, read, or delete the offset of any
+//!   partition yourself when auto-commit is disabled or not enough.
+//! - A **shared state handle** ([`IggyConsumerState`]) that another task can clone
+//!   to read offsets or commit while the consuming loop holds the consumer.
+//! - **Replay control** drops messages this consumer already consumed, unless you
+//!   opt into replaying them with `allow_replay`.
+//! - **Auto-join** of the consumer group, optionally creating it, plus a rejoin
+//!   once the server revokes membership or the connection comes back.
+//! - **Reconnection handling** pauses polling while the client is disconnected and
+//!   resumes it after the reconnect and the rejoin have gone through.
+//! - **Init retries** wait for the stream and topic to appear instead of failing
+//!   right away when the consumer starts before they exist.
+//! - Payload **decryption**.
+//! - **Graceful shutdown** flushes pending offsets and leaves the consumer group.
+//!
+//! For details on the specific behavior of each feature, reach for the type-level
+//! documentation.
+//!
+//! # Stream builder API
+//!
+//! The stream builder API is a convenient way to use the high-level API.
+//! [`IggyStream`], [`IggyStreamProducer`], and [`IggyStreamConsumer`] construct
+//! everything at once. You can pass an [`IggyClient`] (or just a connection string)
+//! together with a config, and they hand back a ready, connected
+//! [`IggyProducer`] / [`IggyConsumer`].
+//! Compared to the **high-level API**, it changes how you construct
+//! producers and consumers, not what they can do. Instead of chaining an
+//! [`IggyProducerBuilder`] / [`IggyConsumerBuilder`] and setting each option
+//! with a method call, you describe the whole setup once in an
+//! [`IggyStreamConfig`] (or in a single [`IggyProducerConfig`] /
+//! [`IggyConsumerConfig`] when you only need one side) and build from it. The result is
+//! the same [`IggyProducer`] and [`IggyConsumer`] the builders produce, backed

Review Comment:
   the stream builder does limit what you get: `IggyProducerConfig` has no background mode, partitioner, or topic expiry/size, and `IggyConsumerConfig` has no `allow_replay` or `offset_drain_timeout`. say it covers a subset.



##########
core/common/src/types/message/partitioning.rs:
##########
@@ -160,6 +167,9 @@ impl Partitioning {
     }
 
     /// Maximum size of the Partitioning struct
+    /// NOTE(haubur) I think this can be removed as it seems to be superseded

Review Comment:
   personal note in shipped rustdoc, and the reason is off - `get_size_bytes` is a per-instance size, it doesn't replace a max bound. drop the note; if you want the fn gone, delete it in its own PR (it's pub).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "haubur (via GitHub)" <gi...@apache.org>.
haubur commented on code in PR #3809:
URL: https://github.com/apache/iggy/pull/3809#discussion_r3903340370


##########
core/common/src/traits/partitioner.rs:
##########
@@ -21,8 +21,19 @@ use crate::types::message::IggyMessage;
 use std::fmt::Debug;
 
 /// The trait represent the logic responsible for calculating the partition ID and is used by the `IggyClient`.
-/// This might be especially useful when the partition ID is not constant and might be calculated based on the stream ID, topic ID and other parameters.
+///
+/// Iggy uses a hierarchical model for append-only logs. A stream contains topics which hold partitions. Each partition is an append-only log.[^note]
+/// A producer of messages such as an [`IggyProducer`], that appends messages to the log, may want to choose which partition to write the messages into.
+/// To do that, a producer can take a type that implements this trait.
+/// This is especially useful when computing the partition ID requires some client side info, i.e. stream ID, topic ID and/ or [`IggyMessage`] attributes.
+///
+/// Note the difference between [`Partitioning`] and [`Partitioner`]. [`Partitioning`] is a type used to set the _partitioning strategy_ for a producer.
+/// If you use both, the [`Partitioner`] overwrites the strategy, sets it to [`PartitioningKind::PartitionID`] and the partition ID is

Review Comment:
   I will highlight this again in the producer docs, specifically `send_with_partitioning` and `send_to`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "haubur (via GitHub)" <gi...@apache.org>.
haubur commented on code in PR #3809:
URL: https://github.com/apache/iggy/pull/3809#discussion_r3906602204


##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,173 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Every operation takes a shared read
+/// guard.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can

Review Comment:
   Solved with `self.partitioner.clone()` in producer() (see below).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "haubur (via GitHub)" <gi...@apache.org>.
haubur commented on code in PR #3809:
URL: https://github.com/apache/iggy/pull/3809#discussion_r3906237109


##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,173 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Every operation takes a shared read
+/// guard.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can

Review Comment:
   Not a fan of this, because its type-level and clarified in `create()` and `producer()`.
   This is the third paragraph someone reads and already welcomed with behavior.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): proposal core/sdk lib.rs and IggyClient docs [iggy]

Posted by "haubur (via GitHub)" <gi...@apache.org>.
haubur commented on PR #3809:
URL: https://github.com/apache/iggy/pull/3809#issuecomment-5225263931

   /ready


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #3809:
URL: https://github.com/apache/iggy/pull/3809#issuecomment-5472336818

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.
   
   If you need a review, please ensure CI is green and the PR is rebased on the latest master. Don't hesitate to ping the maintainers - either `@core` on Discord or by mentioning them directly here on the PR.
   
   Thank you for your contribution!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio merged PR #3809:
URL: https://github.com/apache/iggy/pull/3809


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on code in PR #3809:
URL: https://github.com/apache/iggy/pull/3809#discussion_r3906133319


##########
core/sdk/src/clients/client.rs:
##########
@@ -56,9 +56,173 @@ const SESSION_CONTROL_CODES: [u32; 5] = [
     LOGIN_REGISTER_WITH_PAT_CODE,
 ];
 
-/// The main client struct which implements all the `Client` traits and wraps the underlying low-level client for the specific transport.
+/// A high-level, transport-agnostic client for an Iggy server.
 ///
-/// It also provides the additional builders for the standalone consumer, consumer group, and producer.
+/// `IggyClient` wraps a transport-specific low-level **client** ([`ClientWrapper`]) and
+/// **provides access to the full server API**.
+/// Iggy comes with four options for client-server communication: TCP, QUIC, WebSocket and HTTP.
+/// The `IggyClient` is configured with one of these transport modes, hence abstracting
+/// transport specific implementations away.
+///
+/// The [`ClientWrapper`] lives behind an [`IggyRwLock`] so that the connection
+/// can be shared safely. You create a single client and use it from many tasks
+/// at once (e.g. producers, consumers). Every operation takes a shared read
+/// guard.
+///
+/// A [`Partitioner`] and a client-side [`EncryptorKind`] are optional, and both
+/// default to disabled. The [`Partitioner`] computes on the client-side the target
+/// partition for messages published without an explicit partition. Hence, you can

Review Comment:
   also at lines 495-498 and `partitioner.rs:23`.
   
   the client-level partitioner never runs - `producer()` passes `None` at line 787, so only `IggyProducerBuilder::partitioner()` takes effect.



##########
core/sdk/src/clients/client.rs:
##########
@@ -75,19 +239,211 @@ impl Default for IggyClient {
 }
 
 impl IggyClient {
-    /// Creates a new `IggyClientBuilder`.
+    /// Returns an empty [`IggyClientBuilder`].
+    ///
+    /// The returned builder is not ready to be [`IggyClientBuilder::build()`].
+    /// It sill needs to configure a mode of transport.
     pub fn builder() -> IggyClientBuilder {
         IggyClientBuilder::new()
     }
 
-    /// Creates a new `IggyClientBuilder` from the provided connection string.
+    /// Creates an [`IggyClientBuilder`] with the transport preconfigured from a
+    /// connection string.
+    ///
+    /// The transport is selected from the scheme:
+    /// - `iggy://` defaults to TCP.
+    /// - `iggy+tcp://` for TCP.
+    /// - `iggy+quic://` for QUIC.
+    /// - `iggy+http://` for HTTP.
+    /// - `iggy+ws://` for WebSocket.
+    ///
+    /// Authentication at the server is mandatory.
+    /// - user + password: `<user>:<password>@<host>:<port>`
+    /// - personal access token: `<personal_access_token>@host:port`
+    ///
+    /// Optional `?key=value&key=value` queries carry transport specific
+    /// configuration. The query is parsed per transport, so the accepted keys differ
+    /// by scheme. An unknown key is rejected.
+    /// If no queries are provided optional configurations are automatically set to their default values.
+    ///
+    /// # Examples
+    ///
+    /// Each example lists configuration options per transport mode and shows
+    /// one concrete example.
+    ///
+    /// If the value of an option is
+    /// - a duration pass a `humantime` string such as `5s`, `500ms`, or `1h 1m 1s`.
+    ///   These are cast into an [`IggyDuration`]/[`NonZeroIggyDuration`].
+    ///   Note, `unlimited`, `none`, `disabled`, and `0` parse to zero.

Review Comment:
   line 276 also names `NonZeroIggyDuration`, and there `0`, `none`, `disabled` and `unlimited` are rejected with `NonZeroDurationError::Zero`. only plain `IggyDuration` maps them to zero.



##########
core/sdk/src/clients/client.rs:
##########
@@ -75,19 +239,211 @@ impl Default for IggyClient {
 }
 
 impl IggyClient {
-    /// Creates a new `IggyClientBuilder`.
+    /// Returns an empty [`IggyClientBuilder`].
+    ///
+    /// The returned builder is not ready to be [`IggyClientBuilder::build()`].
+    /// It sill needs to configure a mode of transport.
     pub fn builder() -> IggyClientBuilder {
         IggyClientBuilder::new()
     }
 
-    /// Creates a new `IggyClientBuilder` from the provided connection string.
+    /// Creates an [`IggyClientBuilder`] with the transport preconfigured from a
+    /// connection string.
+    ///
+    /// The transport is selected from the scheme:
+    /// - `iggy://` defaults to TCP.
+    /// - `iggy+tcp://` for TCP.
+    /// - `iggy+quic://` for QUIC.
+    /// - `iggy+http://` for HTTP.
+    /// - `iggy+ws://` for WebSocket.
+    ///
+    /// Authentication at the server is mandatory.
+    /// - user + password: `<user>:<password>@<host>:<port>`
+    /// - personal access token: `<personal_access_token>@host:port`
+    ///
+    /// Optional `?key=value&key=value` queries carry transport specific
+    /// configuration. The query is parsed per transport, so the accepted keys differ
+    /// by scheme. An unknown key is rejected.
+    /// If no queries are provided optional configurations are automatically set to their default values.
+    ///
+    /// # Examples
+    ///
+    /// Each example lists configuration options per transport mode and shows
+    /// one concrete example.
+    ///
+    /// If the value of an option is
+    /// - a duration pass a `humantime` string such as `5s`, `500ms`, or `1h 1m 1s`.
+    ///   These are cast into an [`IggyDuration`]/[`NonZeroIggyDuration`].
+    ///   Note, `unlimited`, `none`, `disabled`, and `0` parse to zero.
+    /// - a retry count use either the literal `unlimited` or a number such as `5`.
+    /// - a bool use the literal `true` or `false`.
+    /// - bytes and millisecond options provide a number such as `1024`.
+    ///
+    /// ## TCP
+    ///
+    /// The same options apply for `iggy://` and `iggy+tcp://`.
+    ///
+    /// - `tls`: bool. Enable/disable TLS. Default: `false`.
+    /// - `tls_domain`: string. Server name to validate the certificate against. Default: unset.
+    /// - `tls_ca_file`: filesystem path. Extra CA certificate to trust. Default: unset.
+    /// - `reconnection_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`NonZeroIggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `heartbeat_interval`: [`NonZeroIggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `nodelay`: `bool`. Disable Nagle's algorithm (`TCP_NODELAY`). Default: `false`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+tcp://user:secret@localhost:8090\
+    ///      ?tls=true&tls_domain=localhost&tls_ca_file=/etc/iggy/ca.pem\
+    ///      &reconnection_retries=unlimited&reconnection_interval=1s&reestablish_after=5s\
+    ///      &heartbeat_interval=5s&nodelay=true",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## QUIC
+    ///
+    /// - `validate_certificate`: bool. Verify the server certificate. Default: `false`.
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.

Review Comment:
   also at lines 315, 350, 368, 370.
   
   these are `NonZeroIggyDuration` too, same as the tcp entries at 290 and 292.



##########
core/sdk/src/clients/client.rs:
##########
@@ -138,12 +566,78 @@ impl IggyClient {
         }
     }
 
-    /// Returns the underlying client implementation for the specific transport.
+    /// Returns a handle to the underlying transport client.
+    ///
+    /// The returned [`ClientWrapper`] is behind an [`IggyRwLock`].
+    /// Thus, the returned type shares ownership with this `IggyClient`, meaning
+    /// changes made through either are visible to both.
+    ///
+    /// # Examples
+    ///
+    /// Take the shared handle, acquire a read guard, and reach the underlying
+    /// transport directly, here to ping the server over the raw connection.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    /// use crate::iggy::prelude::locking::IggyRwLockFn;
+    ///
+    /// # async fn run(client: IggyClient) -> Result<(), IggyError> {
+    /// let handle = client.client();
+    /// handle.read().await.ping().await?;
+    /// # Ok(())
+    /// # }
+    /// ```
     pub fn client(&self) -> IggyRwLock<ClientWrapper> {
         self.client.clone()
     }
 
-    /// Returns the builder for the standalone consumer.
+    /// Returns an [`IggyConsumerBuilder`] to build a standalone consumer.
+    ///
+    /// Copies the client and the encryptor registered with the [`IggyClient`]
+    /// into a [`IggyConsumerBuilder`] and returns it.
+    /// Sets the consumer to [`ConsumerKind::Consumer`], i.e. a single consumer,
+    /// with the provided name.
+    /// Registers a consumer for `stream`, `topic` and `partition`.
+    ///
+    /// To get builder for a load-balanced consumer group, use
+    /// [`consumer_group`](IggyClient::consumer_group) instead.
+    ///
+    /// Refer to the [`IggyConsumer`] type and the [`IggyConsumerBuilder`]
+    /// for details on how a consumer can be configured.
+    ///
+    /// # Examples
+    ///
+    /// Connect a client, build a consumer pinned to partition 1, and configure
+    /// it to auto-commit its offset so a restart resumes where it left off.

Review Comment:
   also at line 683 and `lib.rs:116-118`.
   
   `AutoCommitWhen::PollingMessages` commits inside the poll request, before the app sees the messages - a crash drops them rather than resuming where it left off.



##########
core/sdk/src/clients/client.rs:
##########
@@ -75,19 +239,211 @@ impl Default for IggyClient {
 }
 
 impl IggyClient {
-    /// Creates a new `IggyClientBuilder`.
+    /// Returns an empty [`IggyClientBuilder`].
+    ///
+    /// The returned builder is not ready to be [`IggyClientBuilder::build()`].
+    /// It sill needs to configure a mode of transport.
     pub fn builder() -> IggyClientBuilder {
         IggyClientBuilder::new()
     }
 
-    /// Creates a new `IggyClientBuilder` from the provided connection string.
+    /// Creates an [`IggyClientBuilder`] with the transport preconfigured from a
+    /// connection string.
+    ///
+    /// The transport is selected from the scheme:
+    /// - `iggy://` defaults to TCP.
+    /// - `iggy+tcp://` for TCP.
+    /// - `iggy+quic://` for QUIC.
+    /// - `iggy+http://` for HTTP.
+    /// - `iggy+ws://` for WebSocket.
+    ///
+    /// Authentication at the server is mandatory.
+    /// - user + password: `<user>:<password>@<host>:<port>`
+    /// - personal access token: `<personal_access_token>@host:port`
+    ///
+    /// Optional `?key=value&key=value` queries carry transport specific
+    /// configuration. The query is parsed per transport, so the accepted keys differ
+    /// by scheme. An unknown key is rejected.
+    /// If no queries are provided optional configurations are automatically set to their default values.
+    ///
+    /// # Examples
+    ///
+    /// Each example lists configuration options per transport mode and shows
+    /// one concrete example.
+    ///
+    /// If the value of an option is
+    /// - a duration pass a `humantime` string such as `5s`, `500ms`, or `1h 1m 1s`.
+    ///   These are cast into an [`IggyDuration`]/[`NonZeroIggyDuration`].
+    ///   Note, `unlimited`, `none`, `disabled`, and `0` parse to zero.
+    /// - a retry count use either the literal `unlimited` or a number such as `5`.
+    /// - a bool use the literal `true` or `false`.
+    /// - bytes and millisecond options provide a number such as `1024`.
+    ///
+    /// ## TCP
+    ///
+    /// The same options apply for `iggy://` and `iggy+tcp://`.
+    ///
+    /// - `tls`: bool. Enable/disable TLS. Default: `false`.
+    /// - `tls_domain`: string. Server name to validate the certificate against. Default: unset.
+    /// - `tls_ca_file`: filesystem path. Extra CA certificate to trust. Default: unset.
+    /// - `reconnection_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`NonZeroIggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `heartbeat_interval`: [`NonZeroIggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `nodelay`: `bool`. Disable Nagle's algorithm (`TCP_NODELAY`). Default: `false`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+tcp://user:secret@localhost:8090\
+    ///      ?tls=true&tls_domain=localhost&tls_ca_file=/etc/iggy/ca.pem\
+    ///      &reconnection_retries=unlimited&reconnection_interval=1s&reestablish_after=5s\
+    ///      &heartbeat_interval=5s&nodelay=true",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## QUIC
+    ///
+    /// - `validate_certificate`: bool. Verify the server certificate. Default: `false`.
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `reconnection_max_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`IggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reconnection_reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `response_buffer_size`: u64. Number of bytes in the response receive buffer. Default: `10000000`.
+    /// - `max_concurrent_bidi_streams`: u64. Number of concurrent bidirectional streams. Default: `10000`.
+    /// - `datagram_send_buffer_size`: u64. Number of bytes in the datagram send buffer. Default: `100000`.
+    /// - `initial_mtu`: u16. Initial MTU estimate (in bytes). Default: `1200`.
+    /// - `send_window`: u64. Number of bytes bytes of the flow-control send window. Default: `100000`.
+    /// - `receive_window`: u64. Number of bytes of the flow-control receive window. Default: `100000`.
+    /// - `keep_alive_interval`: u64. QUIC keep-alive period (in milliseconds). Default: `5000`.
+    /// - `max_idle_timeout`: u64. Close after this much idle time (in middleseconds). Default: `10000`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+quic://user:secret@localhost:8080\
+    ///      ?validate_certificate=true&heartbeat_interval=5s\
+    ///      &reconnection_max_retries=unlimited&reconnection_interval=1s&reconnection_reestablish_after=5s\
+    ///      &response_buffer_size=10000000&max_concurrent_bidi_streams=10000\
+    ///      &datagram_send_buffer_size=100000&initial_mtu=1200\
+    ///      &send_window=100000&receive_window=100000\
+    ///      &keep_alive_interval=5000&max_idle_timeout=10000",
+    /// )?
+    /// .build()?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## HTTP
+    ///
+    /// A REST transport. Iggy uses the `reqwest` crate to manage the HTTP client.
+    /// Hence, transport specific configuration is abstracted away.
+    ///
+    /// Configurable options are:
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `retries`: u32. Number of retries when sending a request. Default: `3`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # async fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+http://localhost:3000?heartbeat_interval=5s&retries=3",
+    /// )?
+    /// .build()?;
+    /// client.login_user("user", "password").await?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ## WebSocket
+    ///
+    /// - `heartbeat_interval`: [`IggyDuration`]. Client heartbeat period. Default: `5s`.
+    /// - `reconnection_retries`: "unlimited" or u32. Number of attempts to connect. Default: `unlimited`.
+    /// - `reconnection_interval`: [`IggyDuration`]. Wait between reconnection attempts. Default: `1s`.
+    /// - `reestablish_after`: [`IggyDuration`]. Grace period before reconnecting. Default: `5s`.
+    /// - `read_buffer_size`: usize. Size of the read buffer in bytes. Default: `131072`.
+    /// - `write_buffer_size`: usize. Size of the write buffer in bytes. Default: `131072`.
+    /// - `max_write_buffer_size`: usize. Maximum size of the write buffer in bytes. Default: `usize::MAX`.
+    /// - `max_message_size`: usize. Maximum accepted message size in bytes. Default: `67108864`.
+    /// - `max_frame_size`: usize. Maximum accepted frame size in bytes. Default: `16777216`.
+    /// - `accept_unmasked_frames`: bool. Accept/ decline unmasked frames. Default: `false`.
+    /// - `tls`: `bool`. Enable/disbale TLS. Default: `false`.
+    /// - `tls_domain`: string. Server name to validate the certificate against. Default: unset.
+    /// - `tls_ca_file`: filesystem path. Extra CA certificate to trust. Default: unset.
+    /// - `tls_validate_certificate`: bool. Whether to verify the server certificate. Default: `false`.
+    ///
+    /// ```no_run
+    /// use iggy::prelude::*;
+    ///
+    /// # fn run() -> Result<(), IggyError> {
+    /// let client = IggyClient::builder_from_connection_string(
+    ///     "iggy+ws://user:secret@localhost:8092\
+    ///      ?heartbeat_interval=5s&reconnection_retries=unlimited&reconnection_interval=1s&reestablish_after=5s\
+    ///      &read_buffer_size=131072&write_buffer_size=131072&\

Review Comment:
   the trailing `&` here plus the leading one on the next line gives `131072&&max_message_size`, which `websocket_connection_string_options.rs:109` rejects as an empty segment. `no_run` keeps ci from catching it.



##########
core/common/src/types/message/partitioning.rs:
##########
@@ -160,6 +170,8 @@ impl Partitioning {
     }
 
     /// Maximum size of the Partitioning struct
+    /// by implementing Sizeable/ get_size_bytes().

Review Comment:
   leftover fragment - `by implementing Sizeable/ get_size_bytes()` no longer attaches to anything.



##########
core/sdk/src/lib.rs:
##########
@@ -15,6 +15,281 @@
 // specific language governing permissions and limitations
 // under the License.
 
+//! Apache Iggy is a high-performance, persistent message streaming platform written in
+//! Rust, capable of processing millions of messages per second with ultra-low latency.
+//! It is part of the [`Apache Software Foundation`] (ASF).
+//!
+//! **This library is the Apache Iggy SDK.**
+//! It exposes a low-level and a high-level API for the Apache Iggy message streaming
+//! infrastructure for the Rust programming language.
+//! SDKs for other programming languages can be found in [`foreign`] of the root
+//! repository on GitHub.
+//!
+//! The core of Iggy is the message streaming server.
+//! In essence it is a persisted append-only log data structure concerned with making
+//! reads and writes highly efficient.
+//! For that, the server exposes *commands* that can be triggered to change its state,
+//! such as adding users, setting permissions, adding new streams and topics or reading
+//! and writing messages to and from the log.
+//! A comprehensive overview of commands can be found in the [`schema spec`] on the
+//! website, or in the [`server command enum`] within the source code.
+//!
+//! The SDK provides tools to build production ready message-streaming applications.
+//! It exposes its functionality at two levels. The [high-level API](#high-level-api)
+//! is transport-agnostic and already ships with useful features that a production
+//! application needs, such as message batching, retry policies and offset-tracking.
+//! The [low-level API](#low-level-api) is the set of concrete transport clients that
+//! speak the wire protocol directly and that the high-level API is built on top of.
+//! It is recommended to start with the high-level API, and utilize the low-level API
+//! in case the high-level API cannot satisfy your requirements.
+//!
+//! # High-level API
+//!
+//! The high-level API is most likely what you are looking for, especially if you are new
+//! to building message-streaming applications with Iggy.
+//! High-level API clients already provide common message-streaming features that
+//! you would otherwise need to build yourself.
+//!
+//! There are three client types:
+//! - [`IggyClient`] is the entry point and the full API surface. It owns the
+//!   connection and implements every domain trait, including [`MessageClient`]
+//!   with the raw [`send_messages`] and [`poll_messages`] primitives. For both, each call
+//!   ignores producer and consumer level policies, i.e. there is no batching, retries, offset tracking,
+//!   or polling loop.
+//! - [`IggyProducer`] exposes all configuration and functionality to produce (send)
+//!   messages to a specific topic in a stream. It shares the connection from the
+//!   [`IggyClient`].
+//! - [`IggyConsumer`] exposes all configuration and functionality to consume (read)
+//!   messages from a specific topic and stream. It also shares the connection from the
+//!   [`IggyClient`].
+//!
+//! You do not construct the producer and consumer independently. Spawn their builders
+//! from an [`IggyClient`] with [`IggyClient::producer`] and
+//! [`IggyClient::consumer`] so they share its connection.
+//!
+//! ## When to use each
+//!
+//! Reach for [`IggyClient`] directly for administrative tasks such as
+//! creating streams, topics, users, and consumer groups, reading or storing
+//! offsets, or sending and polling a handful of messages in a script.
+//! Reach for [`IggyProducer`] and [`IggyConsumer`] when producing and consuming messages.
+//!
+//! The [`IggyProducer`] has two modes you can pick from when building it:
+//! **direct** ([`DirectConfig`]), where a send goes out on the calling task, or
+//! **background** ([`BackgroundConfig`]), where a send is buffered and sending
+//! is offloaded to worker tasks.
+//!
+//! Additionally it provides the following features:
+//!
+//! - **Retries** with a configurable count and interval.
+//! - A pluggable **partitioning strategy** ([`Partitioner`]).
+//! - **Encryption** of message payloads before they leave the process.
+//! - **Auto-creation** of the stream and topic if they do not exist yet.
+//!
+//! Only in **direct** mode:
+//! - **Chunking** splits an input larger than `batch_length` into several
+//!   requests.
+//! - **Spacing** applies `linger_time` between consecutive sends.
+//!
+//! Only in **background** mode:
+//! - **Batching** collects number of buffered sends until the batch size in bytes, the message

Review Comment:
   `batch_length` counts buffered `send()` calls, not messages. the sentence is also missing a word - `collects number of buffered sends`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(docs): core/sdk lib.rs and IggyClient docs [iggy]

Posted by "haubur (via GitHub)" <gi...@apache.org>.
haubur commented on PR #3809:
URL: https://github.com/apache/iggy/pull/3809#issuecomment-5292100733

   /ready


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org