...
Code Block |
---|
language | java |
---|
title | Sample configuration: User quota without client-id overrides |
---|
|
// Quotas for user1 (without client-id overrides).
// Zookeeper persistence path /users/<encoded-user1>
{
"version":1,
"config": {
"producer_byte_rate":"1024",
"consumer_byte_rate":"2048",
},
"user_principal" : "user1"
}
}
|
Code Block |
---|
language | java |
---|
title | Sample configuration: User quota with client-id overrides |
---|
|
// Top-level total quotas for user2
// Zookeeper persistence path /users/<encoded-user2>
{
"version":1,
"config": {
"producer_byte_rate":"4096",
"consumer_byte_rate":"8192",
},
"user_principal" : "user2"
}
}
// Quota override for <user2, clientA>
// Zookeeper persistence path /users/<encoded-user2>/clients/clientA
{
"version":1,
"config": {
"producer_byte_rate":"10",
"consumer_byte_rate":"30"
},
"user_principal" : "user2"
}
// Quota override for <user2, clientB>
// Zookeeper persistence path /users/<encoded-user2>/clients/clientB
{
"version":1,
"config": {
"producer_byte_rate":"20",
"consumer_byte_rate":"40"
},
"user_principal" : "user2"
}
|
Code Block |
---|
language | java |
---|
title | Sample configuration: Client-id quota |
---|
|
// Quotas for client-id clientA of users without user quota override.
// Zookeeper persistence path /clients/clientA
{
"version":1,
"config": {
"producer_byte_rate":"100",
"consumer_byte_rate":"200"
}
}
|
...
Configuration change notifications will be generated for changes to quota configuration similar to the current notifications for client-id
quotas. Changes to client-id quotas of a user specify users
as the entity_type
and the sub-path of the node containing both user
and client-id
as entity_name
JSON for change notification will be modified to provide entity path instead of specifying entity type and name separately.
Code Block |
---|
language | java |
---|
title | Sample configuration change notification |
---|
|
// Change notification for user quota of user1
{
"version":12,
"entity_typepath": "users",
"entity_name": "/user1"
}
// Change notification for quota of <user2, clientA>
{
"version":12,
"entity_typepath": "users/user2/clients/clientA"
}
// Change notification for client-id quota of clientA
{
"version":2,
"entity_namepath": "user2/clients/clientA"
} |
Tools
kafka-configs.sh
will be extended to support a new entity type "users".
Quota configuration for users will be provided as key-value pairs to be consistent with other configuration options. Hence no new command line arguments will be added to the tool. The tool will parse the key-value pairs specifying rate limits, validate these and convert them to the equivalent JSON for persistence in Zookeeper. The existing entity “clients
” will continue to be supported to set client-id quotas for users with unlimited quota.
...