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)
| 747 | // gives the minimum and maximum number of bytes that it wants to receive from |
| 748 | // the kafka server. |
| 749 | func (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. |