MCPcopy
hub / github.com/segmentio/kafka-go / ReadBatch

Method ReadBatch

conn.go:749–754  ·  view source on GitHub ↗

ReadBatch reads a batch of messages from the kafka server. The method always returns a non-nil Batch value. If an error occurred, either sending the fetch request or reading the response, the error will be made available by the returned value of the batch's Close method. While it is safe to call R

(minBytes, maxBytes int)

Source from the content-addressed store, hash-verified

747// gives the minimum and maximum number of bytes that it wants to receive from
748// the kafka server.
749func (c *Conn) ReadBatch(minBytes, maxBytes int) *Batch {
750 return c.ReadBatchWith(ReadBatchConfig{
751 MinBytes: minBytes,
752 MaxBytes: maxBytes,
753 })
754}
755
756// ReadBatchWith in every way is similar to ReadBatch. ReadBatch is configured
757// with the default values in ReadBatchConfig except for minBytes and maxBytes.

Callers 6

TestBatchDontExpectEOFFunction · 0.95
ReadMethod · 0.95
ReadMessageMethod · 0.95
readPartitionFunction · 0.95
benchmarkConnReadBatchFunction · 0.80

Calls 1

ReadBatchWithMethod · 0.95

Tested by 4

TestBatchDontExpectEOFFunction · 0.76
readPartitionFunction · 0.76
benchmarkConnReadBatchFunction · 0.64