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

Configurable client id #388

Merged
merged 2 commits into from
Nov 29, 2019
Merged

Conversation

davidrusu
Copy link
Contributor

Kafka lets us set produce and consume quotas to prevent badly behaved consumers/producers from eating up all the bandwidth of a broker, read more about it here: https://kafka.apache.org/documentation/#design_quotas

Kafka support's enforcing quota's by client_id, user_id, or by user_id,client_id pairs, but we don't use ACL's and as such we mainly care for Client ID based quota calculations.

KafkaEx currently does not support this use case since it hard codes the client id to kafka_ex. All services that interact with kafka will be accounted for under the same Quota.

This PR exposes the client id to be configurable by library users:

config :kafka_ex,
    client_id: "badly_behaved_service"

@sourcelevel-bot
Copy link

Hello, @davidrusu! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

Copy link
Member

@joshuawscott joshuawscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This looks good to me.

@dantswain
Copy link
Collaborator

I think ideally this would be something that could be set per-worker, but that can be deferred to another PR.

@joshuawscott joshuawscott merged commit f587e30 into kafkaex:master Nov 29, 2019
@davidrusu davidrusu deleted the configurable-client-id branch November 29, 2019 16:55
@joshuawscott joshuawscott mentioned this pull request Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants