Skip to content

Commit f7ad667

Browse files
andriyfedorovsimplesteph
authored andcommitted
Bug fix for run once mode (#65)
* Change condition for run once mode from KSM_REFRESH_FREQUENCY_MS=-1 to KSM_REFRESH_FREQUENCY_MS=0 * Allow KSM_REFRESH_FREQUENCY_MS to be set to 0 or -1 for run once mode * Enable run once mode if KSM_REFRESH_FREQUENCY_MS has negative or zero value * Update documentation
1 parent d7cede8 commit f7ad667

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The [default configurations](src/main/resources/application.conf) can be overwri
105105

106106
- `KSM_READONLY=false`: enables KSM to synchronize from an External ACL source. The default value is `true`, which prevents KSM from altering ACLs in Zookeeper
107107
- `KSM_EXTRACT=true`: enable extract mode (get all the ACLs from Kafka formatted as a CSV)
108-
- `KSM_REFRESH_FREQUENCY_MS=10000`: how often to check for changes in ACLs in Kafka and in the Source. 10000 ms by default. If it's set to `-1` then KMS executes ACL synchronization just once and exits
108+
- `KSM_REFRESH_FREQUENCY_MS=10000`: how often to check for changes in ACLs in Kafka and in the Source. 10000 ms by default. If it's set to `0` or negative value, for example `-1`, then KMS executes ACL synchronization just once and exits
109109
- `AUTHORIZER_CLASS`: authorizer class for ACL operations. Default is `SimpleAclAuthorizer`, configured with
110110
- `AUTHORIZER_ZOOKEEPER_CONNECT`: zookeeper connection string
111111
- `AUTHORIZER_ZOOKEEPER_SET_ACL=true` (default `false`): set to true if you want your ACLs in Zookeeper to be secure (you probably do want them to be secure) - when in doubt set as the same as your Kafka brokers.

src/main/scala/com/github/simplesteph/ksm/KafkaSecurityManager.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ object KafkaSecurityManager extends App {
5353
})
5454

5555
try {
56-
//if appConfig.KSM.refreshFrequencyMs is equal to -1 the aclSyngronizer is run just once.
57-
if(appConfig.KSM.refreshFrequencyMs == -1){
56+
//if appConfig.KSM.refreshFrequencyMs is equal or less than 0 the aclSyngronizer is run just once.
57+
if(appConfig.KSM.refreshFrequencyMs <= 0){
5858
log.info("Single run mode: ACL will be synchornized once.")
5959
aclSynchronizer.run()
6060
} else {

0 commit comments

Comments
 (0)