Message

Message object

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

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

Constructors

this
this(Topic topic, rd_kafka_message_t* rkmessage, bool dofree)
Undocumented in source.
this
this(Topic topic, rd_kafka_message_t* rkmessage)
Undocumented in source.
this
this(rd_kafka_message_t* rkmessage)
Undocumented in source.
this
this(Topic topic, ErrorCode err)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

err
ErrorCode err()

The error code if object represents an error event, else 0.

errstr
string errstr()

The error string if object represent an error event, * else an empty string.

isNull
bool isNull()
Undocumented in source. Be warned that the author may not have intended to support it.
key
const(void)[] key()

Message key as string (if applicable)

msgOpaque
const(void)* msgOpaque()

The \p msg_opaque as provided to Producer::produce()

offset
long offset()

Message or error offset (if applicable)

partition
int partition()

Partition (if applicable)

payload
const(void)[] payload()

Message payload (if applicable)

timestamp
Timestamp timestamp()

Message timestamp (if applicable)

topic
const(Topic) topic()

the Topic object for a message (if applicable), * or null if a corresponding Topic object has not been * explicitly created with Topic::create(). * In this case use topic_name() instead.

topicName
const(char)[] topicName()

Topic name (if applicable, else empty string)

Structs

Timestamp
struct Timestamp

Message timestamp object

Variables

err_
ErrorCode err_;
Undocumented in source.
free_rkmessage_
bool free_rkmessage_;
Undocumented in source.
rkmessage_
const(rd_kafka_message_t)* rkmessage_;
Undocumented in source.
topic_
Topic topic_;
Undocumented in source.

Meta