Consumer.consume

Consume a single message from the specified queue.

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

a Message object, the application needs to check if message is an error or a proper message \p 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

Note that Message.topic() may be nullptr after certain kinds of errors, so applications should check that it isn't null before dereferencing it.

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

Meta