librdkafka
The Apache Kafka C/C++ client library
RdKafka::Message Class Referenceabstract

Message object. More...

#include <rdkafkacpp.h>

Public Member Functions

virtual std::string errstr () const =0
 Accessor functions*. More...
 
virtual ErrorCode err () const =0
 
virtual Topictopic () const =0
 
virtual std::string topic_name () const =0
 
virtual int32_t partition () const =0
 
virtual void * payload () const =0
 
virtual size_t len () const =0
 
virtual const std::string * key () const =0
 
virtual const void * key_pointer () const =0
 
virtual size_t key_len () const =0
 
virtual int64_t offset () const =0
 
virtual MessageTimestamp timestamp () const =0
 
virtual void * msg_opaque () const =0
 

Detailed Description

Message object.

This object represents either a single consumed or produced message, or an event (err() is set).

An application must check RdKafka::Message::err() to see if the object is a proper message (error is RdKafka::ERR_NO_ERROR) or a an error event.

Member Function Documentation

§ errstr()

virtual std::string RdKafka::Message::errstr ( ) const
pure virtual

Accessor functions*.

Remarks
Not all fields are present in all types of callbacks.
Returns
The error string if object represent an error event, else an empty string.

§ err()

virtual ErrorCode RdKafka::Message::err ( ) const
pure virtual
Returns
The error code if object represents an error event, else 0.

§ topic()

virtual Topic* RdKafka::Message::topic ( ) const
pure virtual
Returns
the RdKafka::Topic object for a message (if applicable), or NULL if a corresponding RdKafka::Topic object has not been explicitly created with RdKafka::Topic::create(). In this case use topic_name() instead.

§ topic_name()

virtual std::string RdKafka::Message::topic_name ( ) const
pure virtual
Returns
Topic name (if applicable, else empty string)

§ partition()

virtual int32_t RdKafka::Message::partition ( ) const
pure virtual
Returns
Partition (if applicable)

§ payload()

virtual void* RdKafka::Message::payload ( ) const
pure virtual
Returns
Message payload (if applicable)

§ len()

virtual size_t RdKafka::Message::len ( ) const
pure virtual
Returns
Message payload length (if applicable)

§ key()

virtual const std::string* RdKafka::Message::key ( ) const
pure virtual
Returns
Message key as string (if applicable)

§ key_pointer()

virtual const void* RdKafka::Message::key_pointer ( ) const
pure virtual
Returns
Message key as void pointer (if applicable)

§ key_len()

virtual size_t RdKafka::Message::key_len ( ) const
pure virtual
Returns
Message key's binary length (if applicable)

§ offset()

virtual int64_t RdKafka::Message::offset ( ) const
pure virtual
Returns
Message or error offset (if applicable)

§ timestamp()

virtual MessageTimestamp RdKafka::Message::timestamp ( ) const
pure virtual
Returns
Message timestamp (if applicable)

§ msg_opaque()

virtual void* RdKafka::Message::msg_opaque ( ) const
pure virtual
Returns
The msg_opaque as provided to RdKafka::Producer::produce()

The documentation for this class was generated from the following file: