...
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"
}
}
|
...
Client-id based quota configuration overrides will continue be stored under /config/clients,
but these will be applied only to clients of users without a quota override and only if default user quota is unlimited. Quota configuration overrides for user principals will be stored under /config/users
. Note that url-encoded version of the user principal will be used as node name under /config/users to cope with Zookeeper naming restrictions. The non-encoded user principal will be stored as a property to make it easy to identify the actual user associated with the path. Quota overrides for clients of a user will be stored under /config/users/<user>/clients
.
...