Struct rdkafka::consumer::stream_consumer::StreamConsumer [] [src]

#[must_use = "Consumer polling thread will stop immediately if unused"]
pub struct StreamConsumer<C: ConsumerContext + 'static> { /* fields omitted */ }

A Kafka Consumer providing a futures::Stream interface.

This consumer doesn't need to be polled since it has a separate polling thread. Due to the asynchronous nature of the stream, some messages might be consumed by the consumer without being processed on the other end of the stream. If auto commit is used, it might cause message loss after consumer restart. Manual offset storing should be used, see the store_offset function on Consumer.

Methods

impl<C: ConsumerContext> StreamConsumer<C>
[src]

[src]

Starts the StreamConsumer with default configuration (100ms polling interval and no NoMessageReceived notifications).

[src]

Starts the StreamConsumer with the specified poll interval. Additionally, if no_message_error is set to true, it will return an error of type KafkaError::NoMessageReceived every time the poll interval is reached and no message has been received.

[src]

Stops the StreamConsumer, blocking the caller until the internal consumer has been stopped.

Trait Implementations

impl<C: ConsumerContext> Consumer<C> for StreamConsumer<C>
[src]

[src]

Returns a reference to the BaseConsumer.

[src]

Subscribe the consumer to a list of topics.

[src]

[src]

Manually assign topics and partitions to the consumer. If used, automatic consumer rebalance won't be activated. Read more

[src]

Commits the offset of the specified message. The commit can be sync (blocking), or async. Notice that when a specific offset is committed, all the previous offsets are considered committed as well. Use this method only if you are processing messages in order. Read more

[src]

Commit the current consumer state. Notice that if the consumer fails after a message has been received, but before the message has been processed by the user code, this might lead to data loss. Check the "at-least-once delivery" section in the readme for more information. Read more

[src]

[src]

Store offset for this message to be used on the next (auto)commit. When using this enable.auto.offset.store should be set to false in the config. Read more

[src]

Returns the current topic subscription.

[src]

Returns the current partition assignment.

[src]

Retrieve committed offsets for topics and partitions.

[src]

Lookup the offsets for this consumer's partitions by timestamp.

[src]

Retrieve current positions (offsets) for topics and partitions.

[src]

Returns the metadata information for the specified topic, or for all topics in the cluster if no topic is specified. Read more

[src]

Returns the metadata information for all the topics in the cluster.

[src]

Returns the group membership information for the given group. If no group is specified, all groups will be returned. Read more

impl FromClientConfig for StreamConsumer<EmptyConsumerContext>
[src]

impl<C: ConsumerContext> FromClientConfigAndContext<C> for StreamConsumer<C>
[src]

Creates a new StreamConsumer starting from a ClientConfig.

[src]

impl<C: ConsumerContext> Drop for StreamConsumer<C>
[src]

[src]

Executes the destructor for this type. Read more