librdkafka
The Apache Kafka C/C++ client library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RdKafka::Queue Class Referenceabstract

Queue interface. More...

#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 Messageconsume (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...
 

Static Public Member Functions

static Queuecreate (Handle *handle)
 Create Queue object.
 

Detailed Description

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.

Member Function Documentation

virtual ErrorCode RdKafka::Queue::forward ( Queue dst)
pure virtual

Forward/re-route queue to dst. If dst is NULL, the forwarding is removed.

The internal refcounts for both queues are increased.

Remarks
Regardless of whether dst is NULL or not, after calling this function, src will not forward it's fetch queue to the consumer queue.
virtual Message* RdKafka::Queue::consume ( int  timeout_ms)
pure virtual

Consume message or get error event from the queue.

Remarks
Use delete to free the message.
Returns
One of:
virtual int RdKafka::Queue::poll ( int  timeout_ms)
pure virtual

Poll queue, serving any enqueued callbacks.

Remarks
Must NOT be used for queues containing messages.
Returns
the number of events served or 0 on timeout.

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