class OffsetFetchRequest
Header File: <libkafka_asio/offset_fetch_request.h>
Namespace: libkafka_asio
Implementation of the Kafka OffsetFetchRequest as described on the Kafka wiki. Offset fetch requests are used to retrieve an offset value for one or more topic partitions of a Kafka consumer group. These kinds of requests require Kafka version 0.8.1.1 or above. Offset fetch requests must be sent to the current offset coordinator broker, which can be discovered using a ConsumerMetadata request.
Member Functions
FetchOffset
void FetchOffset(const String& topic_name,
Int32 partition)
Fetch offset data for the given topic partition
set_consumer_group
void set_consumer_group(const String& consumer_group)
Set the consumer group to fetch the offset data for.
topics
const Topics& topics() const
Returns a reference to the list of topics of this offset fetch request. This method is mainly used internally for getting the request data during the conversion to the Kafka wire format.
consumer_group
const String& consumer_group() const
Returns the consumer group string of this offset-fetch request.
Types
Topic
struct Topic {
String topic_name;
Partitions partitions;
}
topic_name
: Name of the topic to fetch data for.partitions
: Set of partitions of this topic.
Partition
struct Partition {
Int32 partition;
}
partition
: Number, identifying this topic partition.
Topics
typedef std::vector<Topic> Topics
Vector of Topic
objects.
Partitions
typedef std::vector<Partition> Partitions
Vector of Partition
objects.
ResponseType
typedef OffsetFetchResponse ResponseType
Type of the response object of an offset fetch request.
MutableResponseType
typedef MutableOffsetFetchResponse MutableResponseType
Type of a mutable response object for a offset fetch request. This type is used by the library at when reading-in the response from a Kafka server.