userver: userver/kafka/rebalance_types.hpp File Reference
Loading...
Searching...
No Matches
rebalance_types.hpp File Reference

Detailed Description

Kafka consumer rebalance callback types.

Definition in file rebalance_types.hpp.

Go to the source code of this file.

#include <cstdint>
#include <functional>
#include <optional>
#include <userver/utils/span.hpp>
#include <userver/utils/zstring_view.hpp>
+ This graph shows which files directly or indirectly include this file:

Classes

struct  kafka::TopicPartitionView
 Represents the topic's partition for certain topic. More...
 

Typedefs

using kafka::TopicPartitionBatchView = utils::span<const TopicPartitionView>
 
using kafka::ConsumerRebalanceCallback = std::function<void(TopicPartitionBatchView, RebalanceEventType)>
 Callback invoked when a rebalance event occurs.
 

Enumerations

enum class  RebalanceEventType {
  kAssigned ,
  kRevoked
}
 

Typedef Documentation

◆ ConsumerRebalanceCallback

using kafka::ConsumerRebalanceCallback = std::function<void(TopicPartitionBatchView, RebalanceEventType)>

Callback invoked when a rebalance event occurs.

Warning
The rebalance callback should be set before calling ConsumerScope::Start or after ConsumerScope::Stop. The callback must not throw exceptions; any thrown exceptions will be caught and logged by the consumer implementation.
Note
The callback is invoked after the assign or revoke event has been successfully processed.

Definition at line 44 of file rebalance_types.hpp.

◆ TopicPartitionBatchView

using kafka::TopicPartitionBatchView = utils::span<const TopicPartitionView>

Definition at line 37 of file rebalance_types.hpp.

Enumeration Type Documentation

◆ RebalanceEventType

enum class kafka::RebalanceEventType
strong

Definition at line 17 of file rebalance_types.hpp.