Eug*_*erg 5 protocol-buffers apache-kafka confluent-schema-registry kafka-rest confluent-platform
我正在尝试使用 kafka-rest 接口将 Protobuf 架构发布到架构注册表:
curl -X POST -H "Content-Type: application/vnd.kafka.protobuf.v2+json" \
-H "Accept: application/vnd.kafka.v2+json" \
--data '{"value_schema": "syntax=\"proto3\"; message User { string name = 1; }", "records": [{"value": {"name": "testUser"}}]}' \
"http://localhost:8082/topics/protobuftest"
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
{"error_code":415,"message":"HTTP 415 Unsupported Media Type"}
Run Code Online (Sandbox Code Playgroud)
问题:指示媒体类型使其发挥作用的正确方法是什么?
您需要将其发送到 JSON 信封中,因为它不是 avro 模式。
$ curl -X POST -H "content-type: application/json"
http://localhost:8081/subjects/protobuf/versions
-d "{\"schemaType\": \"PROTOBUF\", \"schema\": \"syntax = \\\"proto3\\\";message test { int32 id = 1; }\"}"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
998 次 |
| 最近记录: |