Consumer.consumeCallback

Consumes messages from \p topic and \p partition, calling the provided callback for each consumed messsage.

\p consumeCallback() provides higher throughput performance than \p consume().

\p timeout_ms is the maximum amount of time to wait for one or more messages to arrive.

The provided \p consume_cb instance has its \p consume_cb function called for every message received.

The \p opaque argument is passed to the \p consume_cb as \p opaque.

the number of messages processed or -1 on error.

  1. int consumeCallback(Topic topic, int partition, int timeout_ms, ConsumeCb consume_cb)
    class Consumer
    nothrow @nogc static
    int
    consumeCallback
  2. int consumeCallback(Queue queue, int timeout_ms, ConsumeCb consume_cb)

See Also

Consumer::consume()

Meta