rd_kafka_message_s

@brief A Kafka message as returned by the \c rd_kafka_consume*() family of functions as well as provided to the Producer \c dr_msg_cb().

For the consumer this object has two purposes: - provide the application with a consumed message. (\c err == 0) - report per-topic+partition consumer errors (\c err != 0)

The application must check \c 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.

Members

Variables

_private
void* _private;

< Consume: * - rdkafka private pointer: DO NOT MODIFY * - dr_msg_cb: * msg_opaque from produce() call

err
rd_kafka_resp_err_t err;

< Non-zero for error signaling.

key
void* key;

< Depends on the value of \c err : * - \c err==0: Optional message key

key_len
size_t key_len;

< Depends on the value of \c err : * - \c err==0: Optional message key length

len
size_t len;

< Depends on the value of \c err : * - \c err==0: Message payload length * - \c err!=0: Error string length

offset
int64_t offset;

< Consume: * - Message offset (or offset for error * if \c err!=0 if applicable). * - dr_msg_cb: * Message offset assigned by broker. * If \c produce.offset.report is set then * each message will have this field set, * otherwise only the last message in * each produced internal batch will * have this field set, otherwise 0.

partition
int32_t partition;

< Partition

payload
void* payload;

< Producer: original message payload. * Consumer: Depends on the value of \c err : * - \c err==0: Message payload. * - \c err!=0: Error string

rkt
rd_kafka_topic_t* rkt;

< Topic

Meta