gpt4 book ai didi

java - spring boot应用kafka pipeline报错 "Connection to node -1 could not be established. Broker may not be available."

转载 作者:行者123 更新时间:2023-12-02 08:57:10 28 4
gpt4 key购买 nike

2020-02-26 18:08:54.925  WARN 4472 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient   : [AdminClient clientId=adminclient-1] Connection to node -1 could not be established. Broker may not be available.

以下是application.yaml文件

spring:
cloud:
stream:
default:
producer:
useNativeEncoding: true
consumer:
useNativeEncoding: true
bindings:
input:
destination: employee-details
content-type: application/*+avro
group: group-1
concurrency: 3
output:
destination: employee-details
content-type: application/*+avro
kafka:
binder:
producer-properties:
key.serializer: io.confluent.kafka.serializers.KafkaAvroSerializer
value.serializer: io.confluent.kafka.serializers.KafkaAvroSerializer
schema.registry.url: http://localhost:8081
consumer-properties:
key.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer
value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer
schema.registry.url: http://localhost:8081
specific.avro.reader: true

我尝试在cmd上运行curl -X POST https://localhost:9092/employees/1001/Harry/Potter,但给出了curl错误:(7)无法连接到本地主机端口 9092:连接被拒绝

最佳答案

您似乎有一些根本性的误解。 连接到本地主机端口 9092:连接被拒绝 端口 9092 通常是 Kafka 端口,而不是 HTTP 端口;鉴于您在尝试使用curl连接时遇到Broker may not be available.Connection Refused,这意味着您没有在localhost上运行Kafka > 并且您当然无法使用 HTTP 连接到它,即使它在那里运行。

关于java - spring boot应用kafka pipeline报错 "Connection to node -1 could not be established. Broker may not be available.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60425451/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com