Skip to content

Commit

Permalink
add throttle time to produce response
Browse files Browse the repository at this point in the history
  • Loading branch information
travisjeffery committed Nov 19, 2016
1 parent c630499 commit 55a533e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion protocol/produce_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ func (r *ProduceResponses) Encode(e PacketEncoder) error {
for _, r := range r.Responses {
e.PutString(r.Topic)
e.PutArrayLength(len(r.PartitionResponses))

for _, p := range r.PartitionResponses {
e.PutInt32(p.Partition)
e.PutInt16(p.ErrorCode)
e.PutInt64(p.BaseOffset)
e.PutInt64(p.Timestamp)
}
}
e.PutInt32(r.ThrottleTimeMs)
return nil
}

Expand Down Expand Up @@ -75,6 +75,10 @@ func (r *ProduceResponses) Decode(d PacketDecoder) error {
}
resp.PartitionResponses = ps
}
r.ThrottleTimeMs, err = d.Int32()
if err != nil {
return err
}
return nil
}

Expand Down

0 comments on commit 55a533e

Please sign in to comment.