question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

binder-kafka-streams: Unable to configure AdminClient - bootstrap.servers = [kafka:9092]

See original GitHub issue

Hi, 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.&lt;init&gt;(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:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mcolomerccommented, May 9, 2018

Finally I got a working solution. The configuration merge it’s working fine now.

spring:  
  cloud:  
    stream:
      kafka:   
        streams:
          timeWindow.length: 500
          binder:
            brokers: poc-kafka:9092
            zkNodes: poc-zookeeper:2181
            serdeError: logAndContinue 
            configuration:  
              default:
                key.serde: org.apache.kafka.common.serialization.Serdes$LongSerde 
                value.serde: org.mocr.poc.reactive.positionbuilder.serde.MovementSerde

I was wrongly using (missing the streams)… 😭

spring:    
  cloud: 
    stream:
      kafka:   
        binder:

Thanks for your support!! 👍

0reactions
parth-panditcommented, Dec 27, 2018

Just for information of others that Spring Cloud Streams Binder for Kafka with version 2.1 has below way of denoting brokers and zkNodes in the configuration.

spring: 
  cloud: 
    stream:
      kafka:   
        binder:
          brokers: poc-kafka
          zkNodes: poc-kafka

Here is the documentation link: https://github.com/spring-cloud/spring-cloud-stream-binder-kafka

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found