pub struct KafkaSource { /* private fields */ }Expand description
Kafka source: one consumer-group member per process, partitions split
into per-lane queues polled by pipeline threads. Constructed from
config (KafkaSource::new) or a pipeline component section
(KafkaSource::from_component_config).
Implementations§
Source§impl KafkaSource
impl KafkaSource
Sourcepub fn new(config: KafkaSourceConfig) -> Self
pub fn new(config: KafkaSourceConfig) -> Self
Create a source from validated configuration.
Sourcepub fn from_component_config(
section: &ComponentConfig,
) -> Result<Self, ConfigError>
pub fn from_component_config( section: &ComponentConfig, ) -> Result<Self, ConfigError>
Create a source from the pipeline’s opaque source: { kafka: ... }
section.
Sourcepub fn with_metrics(self, metrics: SourceMetrics) -> Self
pub fn with_metrics(self, metrics: SourceMetrics) -> Self
Attach pre-registered source metrics (consumer lag, rebalances). Optional; without it the source only logs.
Trait Implementations§
Source§impl Debug for KafkaSource
impl Debug for KafkaSource
Source§impl Drop for KafkaSource
Teardown: consumer close (inside BaseConsumer::drop) triggers a final
revoke and then polls until the rebalance protocol completes — with the
deferred-intent design, nothing would ever complete it and the drop
would hang forever. Flip the context to inline-completion mode and
settle any revocation that was surfaced but not yet acknowledged.
impl Drop for KafkaSource
Teardown: consumer close (inside BaseConsumer::drop) triggers a final
revoke and then polls until the rebalance protocol completes — with the
deferred-intent design, nothing would ever complete it and the drop
would hang forever. Flip the context to inline-completion mode and
settle any revocation that was surfaced but not yet acknowledged.
Source§impl Source for KafkaSource
impl Source for KafkaSource
Source§fn open(&mut self, ctx: SourceCtx) -> Result<(), SourceError>
fn open(&mut self, ctx: SourceCtx) -> Result<(), SourceError>
Source§fn poll_events(
&mut self,
timeout: Duration,
) -> Result<SourceEvent<KafkaLane>, SourceError>
fn poll_events( &mut self, timeout: Duration, ) -> Result<SourceEvent<KafkaLane>, SourceError>
timeout. Must be called
regularly regardless of backpressure state.