kafka-go
kafka-go copied to clipboard
panic when client returns an error instead of protocol response
In continuation to https://github.com/segmentio/kafka-go/pull/925, we are seeing the same behavior in other APIs, such as ListGroups, DescribeGroups, etc.
For example from the listgroups protocol:
func (r *Response) Merge(requests []protocol.Message, results []interface{}) (
protocol.Message,
error,
) {
response := &Response{}
for r, result := range results {
brokerResp := result.(*Response)
respGroups := []ResponseGroup{}
for _, brokerResp := range brokerResp.Groups {
respGroups = append(
respGroups,
ResponseGroup{
GroupID: brokerResp.GroupID,
ProtocolType: brokerResp.ProtocolType,
BrokerID: requests[r].(*Request).brokerID,
},
)
}
response.Groups = append(response.Groups, respGroups...)
}
return response, nil
}
Hi @dmarkhas we recently fixed those in https://github.com/segmentio/kafka-go/pull/931 and https://github.com/segmentio/kafka-go/pull/942, just now I tagged a new release https://github.com/segmentio/kafka-go/releases/tag/v0.4.33 can you check and see if that fixes it for you?