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
我试着跑 curl -X POST https://localhost:9092/employees/1001/Harry/Potter
在cmd上,但给出了curl错误:(7)未能连接到localhost端口9092:连接被拒绝
1条答案
按热度按时间wlzqhblo1#
你似乎有一些基本的误解。
connect to localhost port 9092: Connection refused
端口9092通常是kafka端口,而不是http端口;考虑到你现在Broker may not be available.
以及Connection Refused
当你试图和curl联系时,意味着你没有Kafkalocalhost
你当然不能用http连接到它,即使它在那里运行。