Struct sea_streamer_kafka::KafkaStreamer
source · pub struct KafkaStreamer { /* private fields */ }
Trait Implementations§
source§impl Clone for KafkaStreamer
impl Clone for KafkaStreamer
source§fn clone(&self) -> KafkaStreamer
fn clone(&self) -> KafkaStreamer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for KafkaStreamer
impl Debug for KafkaStreamer
source§impl Streamer for KafkaStreamer
impl Streamer for KafkaStreamer
source§async fn disconnect(self) -> KafkaResult<()>
async fn disconnect(self) -> KafkaResult<()>
It will flush all producers
source§async fn create_consumer(
&self,
streams: &[StreamKey],
options: Self::ConsumerOptions
) -> KafkaResult<Self::Consumer>
async fn create_consumer( &self, streams: &[StreamKey], options: Self::ConsumerOptions ) -> KafkaResult<Self::Consumer>
If ConsumerMode is RealTime, auto commit will be disabled and it always stream from latest. group_id
must not be set.
If ConsumerMode is Resumable, it will use a group id unique to this host:
on a physical machine, it will use the mac address. Inside a docker container, it will use the container id.
So when the process restarts, it will resume from last committed offset. group_id
must not be set.
If ConsumerMode is LoadBalanced, shards will be divided-and-assigned by the broker to consumers sharing the same group_id
.
group_id
must already be set.
If you need to override the HOST ID, you can set the ENV var HOST_ID
.
type Error = KafkaError
type Producer = KafkaProducer
type Consumer = KafkaConsumer
type ConnectOptions = KafkaConnectOptions
type ConsumerOptions = KafkaConsumerOptions
type ProducerOptions = KafkaProducerOptions
source§async fn connect(
uri: StreamerUri,
options: Self::ConnectOptions
) -> KafkaResult<Self>
async fn connect( uri: StreamerUri, options: Self::ConnectOptions ) -> KafkaResult<Self>
Establish a connection to the streaming server.
source§async fn create_generic_producer(
&self,
options: Self::ProducerOptions
) -> KafkaResult<Self::Producer>
async fn create_generic_producer( &self, options: Self::ProducerOptions ) -> KafkaResult<Self::Producer>
Create a producer that can stream to any stream key.
Auto Trait Implementations§
impl Freeze for KafkaStreamer
impl RefUnwindSafe for KafkaStreamer
impl Send for KafkaStreamer
impl Sync for KafkaStreamer
impl Unpin for KafkaStreamer
impl UnwindSafe for KafkaStreamer
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
Mutably borrows from an owned value. Read more