binder-kafka-streams: Unable to configure AdminClient - bootstrap.servers = [kafka:9092]
See original GitHub issueHi, I can’t find a way of configure AdminClientConfig - bootstrap.servers. It’s always using kafka:9092
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-reactive</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka-streams</artifactId>
</dependency>
Log:
[task-scheduler-1] INFO o.a.k.c.admin.AdminClientConfig.logAll - AdminClientConfig values:
bootstrap.servers = [kafka:9092]
client.id =
connections.max.idle.ms = 300000
metadata.max.age.ms = 300000
metric.reporters = []
metrics.num.samples = 2
metrics.recording.level = INFO
And then an exception:
org.springframework.cloud.stream.binder.BinderException: Exception thrown while starting consumer:
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:326)
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:77)
at org.springframework.cloud.stream.binder.AbstractBinder.bindConsumer(AbstractBinder.java:129)
at org.springframework.cloud.stream.binding.BindingService.lambda$rescheduleConsumerBinding$0(BindingService.java:154)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.kafka.common.KafkaException: Failed create new KafkaAdminClient
at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal(KafkaAdminClient.java:336)
at org.apache.kafka.clients.admin.AdminClient.create(AdminClient.java:61)
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.createAdminClient(KafkaTopicProvisioner.java:188)
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.provisionConsumerDestination(KafkaTopicProvisioner.java:164)
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.provisionConsumerDestination(KafkaTopicProvisioner.java:74)
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:274)
... 11 common frames omitted
Caused by: org.apache.kafka.common.config.ConfigException: No resolvable bootstrap urls given in bootstrap.servers
at org.apache.kafka.clients.ClientUtils.parseAndValidateAddresses(ClientUtils.java:64)
at org.apache.kafka.clients.admin.KafkaAdminClient.<init>(KafkaAdminClient.java:366)
at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal(KafkaAdminClient.java:329)
... 16 common frames omitted
I tried with:
spring:
cloud:
stream:
kafka:
bindings:
input:
consumer:
configuration:
bootstrap.servers: my-kafka:9092
without success.
Anyway of configuring bootstrap.servers? Thank you
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Kafka consumer can't connect to broker other than localhost ...
In my case, spring.kafka.bootstrap-servers=myserver:myport in application.properties needed even after setting ConsumerConfig.
Read more >caused by: org.apache.kafka.common.config.configexception ...
Im trying to create jar for this application with host "kafka:9092" but create error "No resolvable bootstrap urls given in bootstrap.servers" unless if...
Read more >Kafka errors after upgrade | Layer7 API Management
Hello guys, how are you?recently, in a lab, I upgraded a server to version 4.5. Looking at the logs with the journalctl -fu...
Read more >Kafka AdminClient Configurations for Confluent Platform
A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. The client will make use of all...
Read more >Kafka broker listing empty nodes list *for a while* - Server Fault
Client connects to its configured bootstrap server just fine: ... clientId=adminclient-1] Initiating connection to node kafka:9092 (id: 0 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Finally I got a working solution. The configuration merge it’s working fine now.
I was wrongly using (missing the streams)… 😭
Thanks for your support!! 👍
Just for information of others that Spring Cloud Streams Binder for Kafka with version 2.1 has below way of denoting
brokers
andzkNodes
in the configuration.Here is the documentation link: https://github.com/spring-cloud/spring-cloud-stream-binder-kafka