1

我想要做的是使用 Kafka REST 代理进行手动提交。我正在尝试使用此代码:

curl -X POST -H "Content-Type: application/vnd.kafka.v2+json" -H "Accept: application/vnd.kafka.v2+json" \
--data '{"format": "json", "auto.commit.enable": "false", "auto.offset.reset": "earliest"}' \
http://localhost:8082/consumers/test_consumer

// Subscribe
curl -X POST -H "Content-Type: application/vnd.kafka.v2+json" --data '{"topics":["test.sap.pn.add"]}' \
http://localhost:8082/consumers/test_consumer/instances/rest-consumer-587fceb2-2f2c-404f-b71d-c3eb3c678bac/subscription

// Get data
curl -X GET -H "Accept: application/vnd.kafka.json.v2+json" \
http://localhost:8082/consumers/test_consumer/instances/rest-consumer-587fceb2-2f2c-404f-b71d-c3eb3c678bac/records

// commit
curl -X POST -H "Accept: application/vnd.kafka.v1+json, application/vnd.kafka+json, application/json" \
http://localhost:8082/consumers/test_consumer/instances/rest-consumer-587fceb2-2f2c-404f-b71d-c3eb3c678bac/offsets

然后返回: {"error_code":40403,"message":"Consumer instance not found."}

我究竟做错了什么?

4

0 回答 0