问题
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