-response <- POST(url=paste(kafka_rest_proxy, "consumers", "my_json_consumer", sep="/"),
- content_type("application/vnd.kafka.v2+json"),
- accept("application/vnd.kafka.v2+json"),
- body='{"name": "my_consumer_instance", "format": "json", "auto.offset.reset": "earliest"}')
-fromJSON(content(response, "text"))
-
-response <- POST(url=paste(kafka_rest_proxy,
- "consumers",
- "my_json_consumer",
- "instances",
- "my_consumer_instance",
+# Create consumer
+source("R/CreateKafkaConsumer.R")
+consumerDetails <- CreateKafkaConsumer(kafka.rest.proxy = kafka_rest_proxy, consumer = consumer, consumer_instance = consumer_instance)
+
+# Subscribe it to topic
+response <- POST(url=paste(consumerDetails$base_uri,