rdkafkad

Apache Kafka C/C++ consumer and producer client library.

rdkafkacpp.h contains the public C++ API for librdkafka. The API is documented in this file as comments prefixing the class, function, type, enum, define, etc. For more information, see the C interface in rdkafka.h and read the manual in INTRODUCTION.md. The C++ interface is STD C++ '03 compliant and adheres to the Google C++ Style Guide.

Modules

config
module rdkafkad.config
handler
module rdkafkad.handler
metadata
module rdkafkad.metadata
topic
module rdkafkad.topic

Public Imports

rdkafkad.config
public import rdkafkad.config;
Undocumented in source.
rdkafkad.handler
public import rdkafkad.handler;
Undocumented in source.
rdkafkad.handler.simple_consumer
public import rdkafkad.handler.simple_consumer;
Undocumented in source.
rdkafkad.handler.kafka_consumer
public import rdkafkad.handler.kafka_consumer;
Undocumented in source.
rdkafkad.handler.producer
public import rdkafkad.handler.producer;
Undocumented in source.
rdkafkad.metadata
public import rdkafkad.metadata;
Undocumented in source.
rdkafkad.topic
public import rdkafkad.topic;
Undocumented in source.

Members

Aliases

ConsumeCb
alias ConsumeCb = void delegate(ref Message message) nothrow @(nogc)

The consume callback is used with Consumer::consumeCallback() methods and will be called for each consumed \p message.

DeliveryReportCb
alias DeliveryReportCb = void delegate(ref Message message) nothrow @(nogc)

Delivery Report callback class

EventCb
alias EventCb = void delegate(ref Event event) nothrow @(nogc)

Event callback class

OffsetCommitCb
alias OffsetCommitCb = void delegate(ErrorCode err, ref TopicPartition[] offsets) nothrow @(nogc)

Set offset commit callback for use with consumer groups

PartitionerCb
alias PartitionerCb = int delegate(const Topic topic, const(void)[] key, int partition_cnt, void* msg_opaque) nothrow @(nogc)

Partitioner callback

PartitionerKeyPointerCb
alias PartitionerKeyPointerCb = int delegate(const Topic topic, const(void)* key, size_t key_len, int partition_cnt, void* msg_opaque) nothrow @(nogc)

Variant partitioner with key pointer

RebalanceCb
alias RebalanceCb = void delegate(KafkaConsumer consumer, ErrorCode err, ref TopicPartition[] partitions) nothrow @(nogc)

Group rebalance callback for use with KafkaConsunmer

SocketCb
alias SocketCb = int function(int domain, int type, int protocol) nothrow @(nogc)

Socket callback

Enums

ErrorCode
enum ErrorCode

Error codes.

Functions

err2str
string err2str(ErrorCode err)

Returns a human readable representation of a kafka error.

getDebugContexts
const(char)[] getDebugContexts()

Returns a CSV list of the supported debug contexts for use with Conf::Set("debug", ..).

versionStr
const(char)[] versionStr()

Returns the librdkafka version as string.

version_
int version_()

Returns the librdkafka version as integer.

waitDestroyed
auto waitDestroyed(int timeout_ms)

Wait for all rd_kafka_t objects to be destroyed.

Manifest constants

RD_KAFKA_VERSION
enum RD_KAFKA_VERSION;

librdkafka version

Structs

Event
struct Event

Event object class as passed to the EventCb callback.

Message
struct Message

Message object

See Also

For the C interface see rdkafka.h

Meta