From cd56abd373b7483ac7815e234bb7ef0dfb0dc261 Mon Sep 17 00:00:00 2001 From: Frederik Vanrenterghem Date: Fri, 14 Sep 2018 21:33:36 +0800 Subject: [PATCH 1/1] Document SubscribeKafkaTopic function. * Add documentation to SubscribeKafkaTopic function. * Fix typo in CreateKafkaConsumer documentation. --- R/CreateKafkaConsumer.R | 2 +- R/SubscribeKafkaTopic.R | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/R/CreateKafkaConsumer.R b/R/CreateKafkaConsumer.R index 71f9f72..ae9abf0 100644 --- a/R/CreateKafkaConsumer.R +++ b/R/CreateKafkaConsumer.R @@ -1,6 +1,6 @@ #' Create Apache Kafka consumer using Confluent's REST Proxy API #' -#' \code{CreateKafkaConsumer} creates an Apache Kafka consumer using the rest proxy api provided by Confluence. +#' \code{CreateKafkaConsumer} creates an Apache Kafka consumer using the rest proxy api provided by Confluent. #' #' @param kafka.rest.proxy The URI of the REST Proxy. Defaults to \url{http://localhost:8082}. #' @param consumer A chr object with the name for the consumer. diff --git a/R/SubscribeKafkaTopic.R b/R/SubscribeKafkaTopic.R index 5e6976b..8ca0f62 100644 --- a/R/SubscribeKafkaTopic.R +++ b/R/SubscribeKafkaTopic.R @@ -1,3 +1,14 @@ +#' Subscribe Apache Kafka consumer to a topic using Confluent's REST Proxy API +#' +#' \code{SubscribeKafkaTopic} subscribes an Apache Kafka consumer to a topic +#' using the rest proxy api provided by Confluent. +#' +#' @param consumer.base.uri The URI of the consumer created by \code{\link{CreateKafkaConsumer}}. +#' @param topic A chr object with the topic to subscribe to. +#' +#' @return If the operation succeeds, returns the response, which can be discarded. +#' If the operation fails, it might help out understanding what happened. +#' SubscribeKafkaTopic <- function(consumer.base.uri, topic) { response <- POST(url=paste(consumer.base.uri, "subscription", sep="/"), -- 2.39.5