Added new config admin.client.api.enabled#1
Open
mroiter-larus wants to merge 1 commit intolarusba:4.1from
Open
Added new config admin.client.api.enabled#1mroiter-larus wants to merge 1 commit intolarusba:4.1from
mroiter-larus wants to merge 1 commit intolarusba:4.1from
Conversation
171634e to
d056619
Compare
conker84
suggested changes
Dec 30, 2021
| import streams.toMap | ||
| import streams.StreamsEventRouter | ||
| import streams.config.StreamsConfig | ||
| import streams.* |
| import streams.utils.StreamsUtils | ||
| import java.util.Properties | ||
| import java.util.UUID | ||
| import java.util.* |
Comment on lines
+54
to
+55
| val adminServiceFactory = AdminServiceFactory(kafkaConfig, eventRouterConfiguration.allTopics(), log) | ||
| kafkaAdminService = adminServiceFactory.getAdminService(kafkaConfig.adminClientApiEnabled)!! |
Comment on lines
+5
to
+13
| 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) | ||
| } | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
no immaginavo qualcosa del tipo
Suggested change
| 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) | |
| } | |
| } | |
| } | |
| object AdminServiceFactory { | |
| fun <AdminService> getInstance(props: KafkaConfiguration, allTopics: List<String>, log: Log): AdminService = when (props.adminClientApiEnabled) { | |
| true -> KafkaAdminService(props, allTopics, log) | |
| else -> DefaultAdminService(log) | |
| } | |
| } |
| private var producer: Neo4jKafkaProducer<ByteArray, ByteArray>? = null | ||
| private val kafkaConfig by lazy { KafkaConfiguration.from(config, log) } | ||
| private val kafkaAdminService by lazy { KafkaAdminService(kafkaConfig, eventRouterConfiguration.allTopics(), log) } | ||
| //private val kafkaAdminService by lazy { KafkaAdminService(kafkaConfig, eventRouterConfiguration.allTopics(), log) } |
There was a problem hiding this comment.
Suggested change
| //private val kafkaAdminService by lazy { KafkaAdminService(kafkaConfig, eventRouterConfiguration.allTopics(), log) } | |
| private val kafkaAdminService by lazy { | |
| AdminServiceFactory.getInstance(kafkaConfig, eventRouterConfiguration.allTopics(), log) | |
| } |
d056619 to
fe9465c
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added new config
kafka.admin.client.api.enabled, which is true by default, in order to disable the Kafka AdminClient API usage.