pub struct StandaloneConfig {
pub consumer_id: String,
pub topic_id: u32,
pub max_fetch_bytes: u32,
pub start_position: SeekPosition,
pub offset_dir: Option<PathBuf>,
pub auto_commit_interval: Option<Duration>,
pub connect_timeout: Duration,
pub poll_timeout: Duration,
}Expand description
Configuration for standalone consumer mode
Fields§
§consumer_id: StringIdentifier for this consumer (used for offset storage)
topic_id: u32Topic ID to consume from
max_fetch_bytes: u32Maximum bytes to fetch per poll
start_position: SeekPositionStarting position if no stored offset exists
offset_dir: Option<PathBuf>Directory for offset persistence (None = in-memory only)
auto_commit_interval: Option<Duration>Auto-commit interval (None = manual commit only)
connect_timeout: DurationConnection timeout
poll_timeout: DurationPoll timeout for blocking operations
Implementations§
Source§impl StandaloneConfig
impl StandaloneConfig
Sourcepub fn new(consumer_id: impl Into<String>, topic_id: u32) -> Self
pub fn new(consumer_id: impl Into<String>, topic_id: u32) -> Self
Create a new standalone config for the given topic
Sourcepub fn with_consumer_id(self, id: impl Into<String>) -> Self
pub fn with_consumer_id(self, id: impl Into<String>) -> Self
Set the consumer ID for offset tracking
Sourcepub fn with_max_fetch_bytes(self, bytes: u32) -> Self
pub fn with_max_fetch_bytes(self, bytes: u32) -> Self
Set the maximum bytes to fetch per poll
Sourcepub fn with_start_position(self, position: SeekPosition) -> Self
pub fn with_start_position(self, position: SeekPosition) -> Self
Set the starting position when no stored offset exists
Sourcepub fn with_offset_dir(self, dir: &Path) -> Self
pub fn with_offset_dir(self, dir: &Path) -> Self
Set the directory for offset persistence If not set, offsets are stored in memory only (lost on restart)
Sourcepub fn with_auto_commit_interval(self, interval: Option<Duration>) -> Self
pub fn with_auto_commit_interval(self, interval: Option<Duration>) -> Self
Set auto-commit interval (None to disable auto-commit)
Sourcepub fn with_manual_commit(self) -> Self
pub fn with_manual_commit(self) -> Self
Disable auto-commit (manual commit only)
Sourcepub fn with_connect_timeout(self, timeout: Duration) -> Self
pub fn with_connect_timeout(self, timeout: Duration) -> Self
Set connection timeout
Sourcepub fn with_poll_timeout(self, timeout: Duration) -> Self
pub fn with_poll_timeout(self, timeout: Duration) -> Self
Set poll timeout
Trait Implementations§
Source§impl Clone for StandaloneConfig
impl Clone for StandaloneConfig
Source§fn clone(&self) -> StandaloneConfig
fn clone(&self) -> StandaloneConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for StandaloneConfig
impl RefUnwindSafe for StandaloneConfig
impl Send for StandaloneConfig
impl Sync for StandaloneConfig
impl Unpin for StandaloneConfig
impl UnwindSafe for StandaloneConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request