findCoordinator finds the coordinator for the specified group or transaction See http://kafka.apache.org/protocol.html#The_Messages_FindCoordinator
(request findCoordinatorRequestV0)
| 316 | // |
| 317 | // See http://kafka.apache.org/protocol.html#The_Messages_FindCoordinator |
| 318 | func (c *Conn) findCoordinator(request findCoordinatorRequestV0) (findCoordinatorResponseV0, error) { |
| 319 | var response findCoordinatorResponseV0 |
| 320 | |
| 321 | err := c.readOperation( |
| 322 | func(deadline time.Time, id int32) error { |
| 323 | return c.writeRequest(findCoordinator, v0, id, request) |
| 324 | |
| 325 | }, |
| 326 | func(deadline time.Time, size int) error { |
| 327 | return expectZeroSize(func() (remain int, err error) { |
| 328 | return (&response).readFrom(&c.rbuf, size) |
| 329 | }()) |
| 330 | }, |
| 331 | ) |
| 332 | if err != nil { |
| 333 | return findCoordinatorResponseV0{}, err |
| 334 | } |
| 335 | if response.ErrorCode != 0 { |
| 336 | return findCoordinatorResponseV0{}, Error(response.ErrorCode) |
| 337 | } |
| 338 | |
| 339 | return response, nil |
| 340 | } |
| 341 | |
| 342 | // heartbeat sends a heartbeat message required by consumer groups |
| 343 | // |
nothing calls this directly
no test coverage detected