Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish GroupGenerationUndefined constant #586

Merged
merged 1 commit into from
Dec 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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