1 CreateKafkaConsumer <- function(kafka.rest.proxy = "http://localhost:8082", consumer, consumer_instance) {
2 response <- POST(url=paste(kafka_rest_proxy, "consumers", consumer, sep="/"),
3 content_type("application/vnd.kafka.v2+json"),
4 accept("application/vnd.kafka.v2+json"),
5 body=paste0('{"name": "',
7 '", "format": "json", "auto.offset.reset": "earliest"}')
9 consumerDetails <- fromJSON(content(response, "text"))
10 return(consumerDetails)