RdKafka\ConsumerTopic::consumeBatch

(PECL rdkafka >= 4.0.0)

RdKafka\ConsumerTopic::consumeBatchConsume a batch of messages from a partition

Description

public RdKafka\ConsumerTopic::consumeBatch ( integer $partition , integer $timeout_ms , integer $batch_size ) : array

Consume a batch of messages from partition.

Consumer must have been previously started with RdKafka\ConsumerTopic::consumeStart().

Parameters

partition (integer)

The partition to consume

timeout_ms

The maximum amount of time to wait for a batch to be received.

batch_size

The batch size of messages to be returned.

Return Values

Returns an array of RdKafka\Message or NULL on timeout.

Errors/Exceptions

  • Throws RdKafka\Exception on errors.
  • Throws InvalidArgumentException on argument parsing errors.