|
Modern C++ Kafka API
|
The base class for Kafka clients. More...
#include <KafkaClient.h>
Public Types | |
| enum | { DEFAULT_METADATA_TIMEOUT_MS = 10000 } |
Public Member Functions | |
| const std::string & | clientId () const |
| Get the client id. | |
| const std::string & | name () const |
| Get the client name (i.e. More... | |
| void | setLogLevel (int level) |
| Set log level for the kafka client (the default value: 5). | |
| const Properties & | properties () const |
| Return the properties which took effect. | |
| Optional< std::string > | getProperty (const std::string &name) const |
| Fetch the effected property (including the property internally set by librdkafka). | |
| void | pollEvents (std::chrono::milliseconds timeout) |
Call the OffsetCommit callbacks (if any) Note: The Kafka client should be constructed with option enable.manual.events.poll=true! | |
| Optional< BrokerMetadata > | fetchBrokerMetadata (const std::string &topic, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_METADATA_TIMEOUT_MS), bool disableErrorLogging=false) |
| Fetch matadata from a available broker. More... | |
| template<class ... Args> | |
| void | doLog (int level, const char *filename, int lineno, const char *format, Args... args) const |
| void | doLog (int level, const char *filename, int lineno, const char *msg) const |
The base class for Kafka clients.
|
inline |
Fetch matadata from a available broker.
Note: the Metadata response information may trigger a re-join if any subscribed topic has changed partition count or existence state.
|
inline |
Get the client name (i.e.
client type + id).