卡夫卡流水线的弹簧启动应用程序,错误为"Connection to node -1 could not be established. Broker may not be available."


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(无法连接到localhost端口9092:连接拒绝

您似乎有一些根本性的误解。connect to localhost port 9092: Connection refused端口9092通常是Kafka端口,而不是HTTP端口;假设您在尝试使用curl连接时得到了Broker may not be available.Connection Refused,这意味着您没有在localhost上运行Kafka,并且您当然不能使用HTTP连接到它,即使它在那里运行。

相关内容

最新更新