-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new config admin.client.api.enabled #1
base: 4.1
Are you sure you want to change the base?
Conversation
171634e
to
d056619
Compare
import streams.toMap | ||
import streams.StreamsEventRouter | ||
import streams.config.StreamsConfig | ||
import streams.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no rimettilo come prima
import streams.events.StreamsEvent | ||
import streams.events.StreamsPluginStatus | ||
import streams.events.StreamsTransactionEvent | ||
import streams.extensions.isDefaultDb | ||
import streams.utils.JSONUtils | ||
import streams.utils.KafkaValidationUtils.getInvalidTopicsError | ||
import streams.utils.StreamsUtils | ||
import java.util.Properties | ||
import java.util.UUID | ||
import java.util.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no rimettilo come prima
val adminServiceFactory = AdminServiceFactory(kafkaConfig, eventRouterConfiguration.allTopics(), log) | ||
kafkaAdminService = adminServiceFactory.getAdminService(kafkaConfig.adminClientApiEnabled)!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no rimuovi
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) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no immaginavo qualcosa del tipo
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) | |
} | |
} |
@@ -41,7 +34,8 @@ class KafkaEventRouter(private val config: Map<String, String>, | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//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
Added new config
kafka.admin.client.api.enabled
, which is true by default, in order to disable the Kafka AdminClient API usage.