Confluent Kafka REST Proxy asking to create new INSTANCE every time

本秂侑毒 提交于 2020-01-06 05:35:06

问题


I am following the Confluent Kafka documentation for REST Proxy use.

https://docs.confluent.io/current/kafka-rest/docs/intro.html

In the "Produce and Consume JSON Messages" part, I have been using the following APIs

I.)
POST : "http://localhost:8082/topics/jsontest"
Header : "Content-Type: application/vnd.kafka.json.v2+json"
"Accept: application/vnd.kafka.v2+json"
JSON BODY : {"records":[{"value":{"foo":"bar"}}]}

II.)
POST : "http://localhost:8082/consumers/my_json_consumer"
Header : "Content-Type: application/vnd.kafka.json.v2+json"
JSON BODY : {"name": "my_consumer_instance", "format": "json", "auto.offset.reset": "earliest"}

III.)
POST : "http://localhost:8082/consumers/my_json_consumer/instances/my_consumer_instance/subscription"
Header : "Content-Type: application/vnd.kafka.v2+json"
JSON BODY : {"topics":["jsontest"]}

IV.) 
GET : "http://localhost:8082/consumers/my_json_consumer/instances/my_consumer_instance/records"
Accept : "application/vnd.kafka.json.v2+json"

I am able to execute the above APIs successfully.

My problem is, I need to create new INSTANCE (for ex: my_consumer_instance) every time when i want to test this functionality. So, I can't test this at real-time without changing anything on the code. I can't test this streaming of sending data.

Is this way it works? How to avoid creating new INSTANCE every time (or) Is there any other way that I need to be handling this part?

If someone knows about it, please share your ideas to fix this.

来源:https://stackoverflow.com/questions/48554279/confluent-kafka-rest-proxy-asking-to-create-new-instance-every-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!