Struct rdkafka::producer::base_producer::BaseProducer [] [src]

pub struct BaseProducer<C: ProducerContext> { /* fields omitted */ }

Low level Kafka producer.

The BaseProducer needs to be polled at regular intervals in order to serve queued delivery report callbacks (for more information, refer to the module-level documentation. This producer can be cheaply cloned to create a new reference to the same underlying producer.

Methods

impl<C: ProducerContext> BaseProducer<C>
[src]

[src]

Polls the producer. Regular calls to poll are required to process the events and execute the message delivery callbacks.

[src]

Sends a copy of the payload and key provided to the specified topic. When no partition is specified the underlying Kafka library picks a partition based on the key. If no key is specified, a random partition will be used. Note that some errors will cause an error to be returned straight-away, such as partition not defined, while others will be returned in the delivery callback. To correctly handle errors, the delivery callback should be implemented.

[src]

Flushes the producer. Should be called before termination.

[src]

Returns the number of messages waiting to be sent, or send but not acknowledged yet.

Trait Implementations

impl FromClientConfig for BaseProducer<DefaultProducerContext>
[src]

[src]

Creates a new BaseProducer starting from a configuration.

impl<C: ProducerContext> FromClientConfigAndContext<C> for BaseProducer<C>
[src]

[src]

Creates a new BaseProducer starting from a configuration and a context.

impl<C: ProducerContext> Clone for BaseProducer<C>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<C> Send for BaseProducer<C>

impl<C> Sync for BaseProducer<C>