forked from neo4j-contrib/neo4j-streams
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new config admin.client.api.enabled
- Loading branch information
1 parent
a6a14fe
commit d056619
Showing
10 changed files
with
92 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package streams.kafka | ||
|
||
interface AdminService { | ||
|
||
fun start() | ||
|
||
fun stop() | ||
|
||
fun isValidTopic(topic: String): Boolean | ||
|
||
fun getInvalidTopics(): List<String> | ||
} |
13 changes: 13 additions & 0 deletions
13
producer/src/main/kotlin/streams/kafka/AdminServiceFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package streams.kafka | ||
|
||
import org.neo4j.logging.Log | ||
|
||
class AdminServiceFactory(private val props: KafkaConfiguration, private val allTopics: List<String>, private val log: Log) { | ||
|
||
fun getAdminService(adminClientApiEnabled: Boolean): AdminService? { | ||
return when(adminClientApiEnabled) { | ||
false -> DefaultAdminService(log) | ||
true -> KafkaAdminService(props, allTopics, log) | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
producer/src/main/kotlin/streams/kafka/DefaultAdminService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package streams.kafka | ||
|
||
import org.neo4j.logging.Log | ||
|
||
class DefaultAdminService(private val log: Log) : AdminService { | ||
|
||
override fun start() { | ||
log.info("No need to start the AdminService to check the topic list. We'll consider the topic's auto creation enabled") | ||
} | ||
|
||
override fun stop() {} // Do nothing | ||
|
||
override fun isValidTopic(topic: String): Boolean = true | ||
|
||
override fun getInvalidTopics(): List<String> = emptyList() | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters