Created
March 24, 2017 20:20
-
-
Save gwenshap/d609cfaa3fbd565982331c3483c7e6da to your computer and use it in GitHub Desktop.
REST Proxy V2 examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create JSON consumer: | |
curl -X POST -H "Content-Type: application/vnd.kafka.v2+json" --data '{"name": "my_consumer_instance", "format": "JSON", "auto.offset.reset": "earliest"}' http://localhost:8082/consumers/my_json_consumer | |
{"instance_id":"my_consumer_instance", "base_uri":"http://localhost:8082/consumers/my_json_consumer/instances/my_consumer_instance"} | |
Subscribe consumer to a topic: | |
curl -X POST -H "Content-Type: application/vnd.kafka.v2+json" --data '{"topics":["jsontest"]}' http://localhost:8082/consumers/my_json_consumer/instances/my_consumer_instance/subscription | |
Consume: | |
curl -X GET -H "Accept: application/vnd.kafka.json.v2+json" http://localhost:8082/consumers/my_json_consumer/instances/my_consumer_instance/records | |
curl -X GET -H "Accept: application/vnd.kafka.json.v2+json" http://localhost:8082/consumers/my_json_consumer/instances/my_consumer_instance/topics/jsontest | |
Delete: | |
curl -X DELETE http://localhost:8082/consumers/my_json_consumer/instances/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment