Consume messages from a given topic and return them as a lazily evaluated Scala Stream.
Consume messages from a given topic and return them as a lazily evaluated Scala Stream. Depending on how many messages are taken from the Scala Stream it will try up to 3 times to consume batches from the given topic, until it reaches the number of desired messages or return otherwise.
the topic from which to consume messages
the maximum number of attempts to try and get the batch (defaults to 3)
the amount of time, in milliseconds, to wait in the buffer for any messages to be available (defaults to 2000)
the stream of consumed messages that you can do .take(n: Int).toList
to evaluate the requested number of messages.