librdkafka
The Apache Kafka C/C++ client library
|
#include <rdkafkacpp.h>
Public Member Functions | |
virtual ErrorCode | forward (Queue *dst)=0 |
Forward/re-route queue to dst . If dst is NULL , the forwarding is removed. More... | |
virtual Message * | consume (int timeout_ms)=0 |
Consume message or get error event from the queue. More... | |
virtual int | poll (int timeout_ms)=0 |
Poll queue, serving any enqueued callbacks. More... | |
virtual void | io_event_enable (int fd, const void *payload, size_t size)=0 |
Enable IO event triggering for queue. More... | |
Static Public Member Functions | |
static Queue * | create (Handle *handle) |
Create Queue object. | |
Queue interface.
Create a new message queue. Message queues allows the application to re-route consumed messages from multiple topic+partitions into one single queue point. This queue point, containing messages from a number of topic+partitions, may then be served by a single consume() method, rather than one per topic+partition combination.
See the RdKafka::Consumer::start(), RdKafka::Consumer::consume(), and RdKafka::Consumer::consume_callback() methods that take a queue as the first parameter for more information.
Forward/re-route queue to dst
. If dst
is NULL
, the forwarding is removed.
The internal refcounts for both queues are increased.
dst
is NULL or not, after calling this function, src
will not forward it's fetch queue to the consumer queue.
|
pure virtual |
Consume message or get error event from the queue.
delete
to free the message.timeout_ms
(RdKafka::Message::err() is ERR__TIMED_OUT)
|
pure virtual |
Poll queue, serving any enqueued callbacks.
|
pure virtual |
Enable IO event triggering for queue.
To ease integration with IO based polling loops this API allows an application to create a separate file-descriptor that librdkafka will write payload
(of size size
) to whenever a new element is enqueued on a previously empty queue.
To remove event triggering call with fd
= -1.
librdkafka will maintain a copy of the payload
.