librdkafka
The Apache Kafka C/C++ client library
|
A Kafka message as returned by the rd_kafka_consume*
() family of functions as well as provided to the Producer dr_msg_cb()
.
More...
#include <rdkafka.h>
Data Fields | |
rd_kafka_resp_err_t | err |
rd_kafka_topic_t * | rkt |
int32_t | partition |
void * | payload |
size_t | len |
void * | key |
size_t | key_len |
int64_t | offset |
void * | _private |
A Kafka message as returned by the rd_kafka_consume*
() family of functions as well as provided to the Producer dr_msg_cb()
.
For the consumer this object has two purposes:
err
== 0)err
!= 0)The application must check err
to decide what action to take.
When the application is finished with a message it must call rd_kafka_message_destroy() unless otherwise noted.
rd_kafka_resp_err_t rd_kafka_message_s::err |
Non-zero for error signaling.
rd_kafka_topic_t* rd_kafka_message_s::rkt |
Topic
int32_t rd_kafka_message_s::partition |
Partition
void* rd_kafka_message_s::payload |
Producer: original message payload. Consumer: Depends on the value of err
:
err==0
: Message payload.err!=0
: Error string size_t rd_kafka_message_s::len |
Depends on the value of err
:
err==0
: Message payload lengtherr!=0
: Error string length void* rd_kafka_message_s::key |
Depends on the value of err
:
err==0
: Optional message key size_t rd_kafka_message_s::key_len |
Depends on the value of err
:
err==0
: Optional message key length int64_t rd_kafka_message_s::offset |
Consumer:
err!=0
if applicable). Producer, dr_msg_cb: Message offset assigned by broker. May be RD_KAFKA_OFFSET_INVALID for retried messages when idempotence is enabled. void* rd_kafka_message_s::_private |
Consumer: