Implementation of the Kafka TopicMetadata request, as described on the Kafka wiki. Metadata requests can be used to determine information about topics and partitions on the connected broker/cluster. The leader for a topic partition can be retrieved via a metadata request.
void AddTopicName(const String& topic_name)
Adds the given topic to this metadata request. This results in metadata being fetched for the given topic.
using libkafka_asio::MetadataRequest; MetadataRequest req; req.AddTopicName("foo"); req.AddTopicName("bar");
Clears the list of topic names, added to this metadata request.
const TopicNameVector& topic_names() const
Returns a reference to the list of topic names of this metadata request. This method is mainly used internally for getting the request data during the conversion to the Kafka wire format.
typedef MetadataResponse ResponseType
Type of the response object of a metadata request.
typedef MutableMetadataResponse MutableResponseType
Type of a mutable response object for a metadata request. This type is used by the library at the time of reading in the response from a Kafka server.
typedef std::vector<String> TopicNameVector
Vector of topic name strings.