Skip to content
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

Optionally disable creation of AdminClient bean #702

Closed
visheshruparelia opened this issue Apr 28, 2023 · 1 comment · Fixed by #848
Closed

Optionally disable creation of AdminClient bean #702

visheshruparelia opened this issue Apr 28, 2023 · 1 comment · Fixed by #848
Assignees

Comments

@visheshruparelia
Copy link

Feature description

We have a micronaut based application. It uses micronaut-kafka to leverage Kafka Streams. We keep seeing this error:
v1.0.0 t.n:kafka-admin-client-thread | adminclient-1 o.apache.kafka.clients.NetworkClient.handleDisconnections:937 | [AdminClient clientId=adminclient-1] Node -1 disconnected.
The reason for this is, we don't allow AdminClients in our envrionments and thus it keeps logging this message upto a point where going through logs is impossible as they are cluttered.

I see that this bean gets created by default if you are using any Kafka feature.
I would like to have an option where we can disable the creation of AdminClient.
For ex. something like:
@Requires(property = AbstractKafkaConfiguration.PREFIX + ".admin.enabled", value = "true", defaultValue = "true")

Or is there any other way I can disable this bean from getting created without patching the micronaut lib?
Thanks!

@visheshruparelia visheshruparelia changed the title Option disable creation of AdminClient Optionally disable creation of AdminClient bean Apr 28, 2023
@visheshruparelia
Copy link
Author

I added a class like this in my application, but it did not work.

@Replaces(AdminClientFactory.class)
@Factory
@Requires(property = AbstractKafkaConfiguration.PREFIX + ".adminClientEnabled", notEquals = StringUtils.FALSE, defaultValue = StringUtils.FALSE)
public class AdminClientFactoryOverride {
// Noop
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants