Skip to content

Commit

Permalink
Merge pull request #586 from mailgun/maxim/offsetmanager
Browse files Browse the repository at this point in the history
Publish GroupGenerationUndefined constant
  • Loading branch information
eapache committed Dec 14, 2015
2 parents 1fdcdc2 + 48e29ec commit 0565e1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions offset_commit_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ package sarama
// The timestamp is only used if message version 1 is used, which requires kafka 0.8.2.
const ReceiveTime int64 = -1

// GroupGenerationUndefined is a special value of group generation field of
// Offset Commit Request that should be used when a consumer group does not rely
// on Kafka for partition management.
const GroupGenerationUndefined = -1

type offsetCommitRequestBlock struct {
offset int64
timestamp int64
Expand Down
4 changes: 1 addition & 3 deletions offset_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (

// Offset Manager

const groupGenerationUndefined = -1

// OffsetManager uses Kafka to store and fetch consumed partition offsets.
type OffsetManager interface {
// ManagePartition creates a PartitionOffsetManager on the given topic/partition.
Expand Down Expand Up @@ -480,7 +478,7 @@ func (bom *brokerOffsetManager) constructRequest() *OffsetCommitRequest {
r := &OffsetCommitRequest{
Version: 1,
ConsumerGroup: bom.parent.group,
ConsumerGroupGeneration: groupGenerationUndefined,
ConsumerGroupGeneration: GroupGenerationUndefined,
}

for s := range bom.subscriptions {
Expand Down

0 comments on commit 0565e1b

Please sign in to comment.