(PECL rdkafka >= 0.9.1)
RdKafka\ConsumerTopic::consume — Consume a single message from a partition
Consume a single message from partition
.
Consumer must have been previously started with RdKafka\ConsumerTopic::consumeStart().
Note:
The returned message's
err
property must be checked for errors.
Note:
The
err
property being equal toRD_KAFKA_RESP_ERR__PARTITION_EOF
signals that the end of the partition has been reached, which should typically not be considered an error. The application should handle this case (e.g., ignore).
partition
(integer)The partition to consume
timeout_ms
The maximum amount of time to wait for a message to be received.
Returns a RdKafka\Message or NULL
on timeout.