Skip to content

Commit

Permalink
Add support for FetchRequest API V3.
Browse files Browse the repository at this point in the history
This commit adds support for version 3 of the FetchRequest API. The
KIP can be found here:

    https://cwiki.apache.org/confluence/display/KAFKA/KIP-74%3A+Add+Fetch+Response+Size+Limit+in+Bytes

the PR here:

    apache/kafka#1812

and the JIRA here:

    https://issues.apache.org/jira/browse/KAFKA-2063

Should document the fact that the per-partition limits take
precedence (so the returned message may be larger than the
requested limit).
  • Loading branch information
Michael Herstine committed Jun 20, 2017
1 parent 4d1eceb commit b69551c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ func (bc *brokerConsumer) fetchNewMessages() (*FetchResponse, error) {
}
if bc.consumer.conf.Version.IsAtLeast(V0_10_1_0) {
request.Version = 3
request.MaxBytes = MaxResponseSize - 47 // TODO(mherstin): WTF?!
request.MaxBytes = MaxResponseSize
}

for child := range bc.subscriptions {
Expand Down
2 changes: 2 additions & 0 deletions fetch_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ func (r *FetchRequest) requiredVersion() KafkaVersion {
return V0_9_0_0
case 2:
return V0_10_0_0
case 3:
return V0_10_1_0
default:
return minVersion
}
Expand Down

0 comments on commit b69551c

Please sign in to comment.