我在从Kubernetes pod访问Kafka服务时遇到间歇性问题。
org.apache.kafka.common.KafkaException: Failed to construct kafka producer
at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:432)
at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:298)
at oracle.fs.framework.core.transports.event.kafka.KafkaFactory.createProducer(KafkaFactory.java:29)
at oracle.fs.framework.core.transports.event.kafka.stream.KafkaStreamEventTransport.start(KafkaStreamEventTransport.java:165)
at oracle.fs.framework.core.service.TransportLifecycleHandler.start(TransportLifecycleHandler.java:57)
at oracle.fs.framework.core.service.AbstractService.start(AbstractService.java:400)
at oracle.fs.foundation.bootstrap.Bootstrap.startDomain(Bootstrap.java:555)
at oracle.fs.foundation.bootstrap.Bootstrap.startDomain(Bootstrap.java:188)
at oracle.fs.foundation.bootstrap.Bootstrap.startDomain(Bootstrap.java:147)
at oracle.fs.foundation.bootstrap.Bootstrap.startDomain(Bootstrap.java:102)
at oracle.fs.service.driver.DomainServiceDriver.startService(DomainServiceDriver.java:24)
at oracle.fs.service.driver.DomainServiceDriver.main(DomainServiceDriver.java:19)
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:88)
at org.apache.kafka.clients.ClientUtils.parseAndValidateAddresses(ClientUtils.java:47)
at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:407)
我不知道是什么原因间歇性地导致这个问题,因为我发现引导URL是正确的。
2条答案
按热度按时间ie3xauqp1#
我遇到了同样的问题,我有一个docker运行Kafka框架,我的应用程序无法连接到brocker。我更改了我的/etc/hosts以理解127.0.0.1作为我的bootstrap服务别名(confluentinc/cp-kafka:7.0.9)
ht4b089n2#
它的格式为spring.Kafka.bootstrap-servers=port:9092 sample:spring.Kafka.bootstrap-servers=localhost:9092或spring.kafka.bootstrap-servers= 127.0.0.1:9092等