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

Take error when get all group from client #853

Closed
tfzxyinhao opened this issue Mar 27, 2017 · 3 comments
Closed

Take error when get all group from client #853

tfzxyinhao opened this issue Mar 27, 2017 · 3 comments
Labels
client stale Issues and pull requests without any recent activity

Comments

@tfzxyinhao
Copy link

Versions

Sarama Version:1.11.0
Kafka Version: 2.11
Go Version:go1.8 windows/amd64

Configuration

config := sarama.NewConfig()

Logs

kafka: broker not connected

Problem Description
for _, item := range client.Brokers() {
    var req sarama.ListGroupsRequest
    resp, err := item.ListGroups(&req)
     if err != nil {
	log.Println(err)
    } 
}
@eapache
Copy link
Contributor

eapache commented Mar 27, 2017

Oh, hmm, this is because we don't automatically open connections to brokers as returned from the new Brokers() method (#813). If they haven't already been talked to for some other reason you'll get this error. @hollow I'm kind of surprised you haven't run into this.

As a short-term workaround, just call Open() on each broker before calling ListGroups (and ignore any ErrAlreadyConnected). In the longer term we should probably either open all the brokers before we return them or at least document this behaviour.

@tfzxyinhao
Copy link
Author

Thanks,call Open() before other operations are ok!

@ghost
Copy link

ghost commented Feb 21, 2020

Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur.
Please check if the master branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.

@ghost ghost added the stale Issues and pull requests without any recent activity label Feb 21, 2020
@ghost ghost closed this as completed Mar 23, 2020
alok87 added a commit to practo/tipoca-stream that referenced this issue Feb 19, 2021
alok87 added a commit to practo/tipoca-stream that referenced this issue Jun 5, 2021
alok87 added a commit to practo/tipoca-stream that referenced this issue Jun 7, 2021
alok87 added a commit to practo/tipoca-stream that referenced this issue Jun 17, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client stale Issues and pull requests without any recent activity
Projects
None yet
Development

No branches or pull requests

2 participants