syncGroup completes the handshake to join a consumer group See http://kafka.apache.org/protocol.html#The_Messages_SyncGroup
(request syncGroupRequestV0)
| 513 | // |
| 514 | // See http://kafka.apache.org/protocol.html#The_Messages_SyncGroup |
| 515 | func (c *Conn) syncGroup(request syncGroupRequestV0) (syncGroupResponseV0, error) { |
| 516 | var response syncGroupResponseV0 |
| 517 | |
| 518 | err := c.readOperation( |
| 519 | func(deadline time.Time, id int32) error { |
| 520 | return c.writeRequest(syncGroup, v0, id, request) |
| 521 | }, |
| 522 | func(deadline time.Time, size int) error { |
| 523 | return expectZeroSize(func() (remain int, err error) { |
| 524 | return (&response).readFrom(&c.rbuf, size) |
| 525 | }()) |
| 526 | }, |
| 527 | ) |
| 528 | if err != nil { |
| 529 | return syncGroupResponseV0{}, err |
| 530 | } |
| 531 | if response.ErrorCode != 0 { |
| 532 | return syncGroupResponseV0{}, Error(response.ErrorCode) |
| 533 | } |
| 534 | |
| 535 | return response, nil |
| 536 | } |
| 537 | |
| 538 | // Close closes the kafka connection. |
| 539 | func (c *Conn) Close() error { |
nothing calls this directly
no test coverage detected