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

InstanceAlreadyExistsException with new multi-threaded consumer #175

Closed
kinghuang opened this issue Jun 23, 2019 · 5 comments
Closed

InstanceAlreadyExistsException with new multi-threaded consumer #175

kinghuang opened this issue Jun 23, 2019 · 5 comments

Comments

@kinghuang
Copy link

The new multi-threaded consumer in 2.3.0 doesn't seem to work for me. I just get unending errors in the logs for InstanceAlreadyExistsException. Setting multiThreadedConsumer: false in the config file works.

javax.management.InstanceAlreadyExistsException: kafka.consumer:type=app-info,id=KafkaWebViewConsumer-UserId1-web-256d1a7efb57dfed03a11f1fa57cd1dd41cc5c1b
	at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437) ~[na:1.8.0_151]
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898) ~[na:1.8.0_151]
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966) ~[na:1.8.0_151]
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900) ~[na:1.8.0_151]
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324) ~[na:1.8.0_151]
	at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522) ~[na:1.8.0_151]
	at org.apache.kafka.common.utils.AppInfoParser.registerAppInfo(AppInfoParser.java:62) ~[kafka-clients-2.0.1.jar!/:na]
	at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:791) [kafka-clients-2.0.1.jar!/:na]
	at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:615) [kafka-clients-2.0.1.jar!/:na]
	at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:596) [kafka-clients-2.0.1.jar!/:na]
	at org.sourcelab.kafka.webview.ui.manager.kafka.KafkaConsumerFactory.createConsumer(KafkaConsumerFactory.java:65) [classes!/:2.3.0]
	at org.sourcelab.kafka.webview.ui.manager.kafka.KafkaConsumerFactory.createConsumerAndSubscribe(KafkaConsumerFactory.java:73) [classes!/:2.3.0]
	at org.sourcelab.kafka.webview.ui.manager.kafka.ParallelWebKafkaConsumer.createNewConsumer(ParallelWebKafkaConsumer.java:278) [classes!/:2.3.0]
	at org.sourcelab.kafka.webview.ui.manager.kafka.ParallelWebKafkaConsumer.lambda$consumePerPartition$0(ParallelWebKafkaConsumer.java:103) [classes!/:2.3.0]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) ~[na:1.8.0_151]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_151]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_151]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_151]
@Crim
Copy link
Collaborator

Crim commented Jun 23, 2019

Does consuming fail to work, or are you just seeing these errors but consuming works OK?

When I saw those errors locally, it was because the parallel consumers were attempting to register the same JMX bean, and you'd get this error in the log. As far as I could determine from reviewing Kafka's consumer configurations, there was no way to prevent the JMX Metric Reporter from being registered.

Consuming would work correctly however.

@kinghuang
Copy link
Author

You're right. I mistakenly thought consuming didn't work. But, it actually does.

@Crim
Copy link
Collaborator

Crim commented Jun 25, 2019

Glad to hear it actually works. The flood of errors are far from ideal, I'll try to put together a patch here shortly that works out a way to avoid them.

@Crim
Copy link
Collaborator

Crim commented Jun 27, 2019

Fix for this should be included in upcoming 2.3.1 release. Thanks!

@Crim Crim closed this as completed Jun 27, 2019
@Crim
Copy link
Collaborator

Crim commented Jul 2, 2019

released 2.4.0 which should resolve those errors from being shown.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants