From ff698326390c191a39c95b38d019f7b306fb0063 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Tue, 1 Aug 2017 15:05:06 +0200 Subject: Demonstrates that rest+schemas work together --- test/rest-curl.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/rest-curl.yml b/test/rest-curl.yml index 5c6489d..998a36f 100644 --- a/test/rest-curl.yml +++ b/test/rest-curl.yml @@ -71,6 +71,27 @@ data: curl -X GET $SCHEMAS/subjects/$TOPIC-value/versions/1 echo "" + # rest + schema + # TODO new topic needed because this breaks json consumer above + + curl -X POST -H "Content-Type: application/vnd.kafka.avro.v2+json" \ + -H "Accept: application/vnd.kafka.v2+json" \ + --data '{"value_schema": "{\"type\": \"record\", \"name\": \"User\", \"fields\": [{\"name\": \"name\", \"type\": \"string\"}]}", "records": [{"value": {"name": "testUser"}}]}' \ + $REST/topics/$TOPIC + echo "" + + curl -X POST -H "Content-Type: application/vnd.kafka.v2+json" \ + --data '{"name": "my_consumer_instance", "format": "avro", "auto.offset.reset": "earliest"}' \ + $REST/consumers/my_avro_consumer + echo "" + + curl -X POST -H "Content-Type: application/vnd.kafka.v2+json" \ + --data "{\"topics\":[\"$TOPIC\"]}" \ + $REST/consumers/my_avro_consumer/instances/my_consumer_instance/subscription + + curl -X GET -H "Accept: application/vnd.kafka.avro.v2+json" \ + $REST/consumers/my_avro_consumer/instances/my_consumer_instance/records + tail -f /tmp/testlog continue.sh: |- -- cgit v1.2.3