Consumer.consume

Consume a single message from \p topic and \p partition.

\p timeout_ms is maximum amount of time to wait for a message to be received. Consumer must have been previously started with \p ...start().

a Message object, the application needs to check if message is an error or a proper message Message::err() and checking for \p ErrorCode.no_error.

The message object must be destroyed when the application is done with it.

Errors (in Message::err()): - timed_out - \p timeout_ms was reached with no new messages fetched. - PARTITION_EOF - End of partition reached, not an error.

  1. void consume(Topic topic, int partition, int timeout_ms, Message msg)
    class Consumer
    nothrow @nogc static
    void
    consume
    (
    Topic topic
    ,,,)
  2. void consume(Queue queue, int timeout_ms, Message msg)

Meta