heartbeat sends a heartbeat message required by consumer groups See http://kafka.apache.org/protocol.html#The_Messages_Heartbeat
(request heartbeatRequestV0)
| 343 | // |
| 344 | // See http://kafka.apache.org/protocol.html#The_Messages_Heartbeat |
| 345 | func (c *Conn) heartbeat(request heartbeatRequestV0) (heartbeatResponseV0, error) { |
| 346 | var response heartbeatResponseV0 |
| 347 | |
| 348 | err := c.writeOperation( |
| 349 | func(deadline time.Time, id int32) error { |
| 350 | return c.writeRequest(heartbeat, v0, id, request) |
| 351 | }, |
| 352 | func(deadline time.Time, size int) error { |
| 353 | return expectZeroSize(func() (remain int, err error) { |
| 354 | return (&response).readFrom(&c.rbuf, size) |
| 355 | }()) |
| 356 | }, |
| 357 | ) |
| 358 | if err != nil { |
| 359 | return heartbeatResponseV0{}, err |
| 360 | } |
| 361 | if response.ErrorCode != 0 { |
| 362 | return heartbeatResponseV0{}, Error(response.ErrorCode) |
| 363 | } |
| 364 | |
| 365 | return response, nil |
| 366 | } |
| 367 | |
| 368 | // joinGroup attempts to join a consumer group |
| 369 | // |
nothing calls this directly
no test coverage detected