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