Skip to content

Commit ff69832

Browse files
committed
Demonstrates that rest+schemas work together
1 parent caf56c7 commit ff69832

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/rest-curl.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,27 @@ data:
7171
curl -X GET $SCHEMAS/subjects/$TOPIC-value/versions/1
7272
echo ""
7373
74+
# rest + schema
75+
# TODO new topic needed because this breaks json consumer above
76+
77+
curl -X POST -H "Content-Type: application/vnd.kafka.avro.v2+json" \
78+
-H "Accept: application/vnd.kafka.v2+json" \
79+
--data '{"value_schema": "{\"type\": \"record\", \"name\": \"User\", \"fields\": [{\"name\": \"name\", \"type\": \"string\"}]}", "records": [{"value": {"name": "testUser"}}]}' \
80+
$REST/topics/$TOPIC
81+
echo ""
82+
83+
curl -X POST -H "Content-Type: application/vnd.kafka.v2+json" \
84+
--data '{"name": "my_consumer_instance", "format": "avro", "auto.offset.reset": "earliest"}' \
85+
$REST/consumers/my_avro_consumer
86+
echo ""
87+
88+
curl -X POST -H "Content-Type: application/vnd.kafka.v2+json" \
89+
--data "{\"topics\":[\"$TOPIC\"]}" \
90+
$REST/consumers/my_avro_consumer/instances/my_consumer_instance/subscription
91+
92+
curl -X GET -H "Accept: application/vnd.kafka.avro.v2+json" \
93+
$REST/consumers/my_avro_consumer/instances/my_consumer_instance/records
94+
7495
tail -f /tmp/testlog
7596
7697
continue.sh: |-

0 commit comments

Comments
 (0)