summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5b2ed10)
Add barebones R function to set a Kafka consumer's topic offset back to 0.
--- /dev/null
+ResetKafkaConsumerOffset <- function(consumer.base.uri, topic) {
+ response <- POST(url=paste(consumer.base.uri,
+ "positions", "beginning", sep="/"),
+ content_type("application/vnd.kafka.v2+json"),
+ body = paste0('{"partitions": [ {"topic": "',
+ topic,
+ '" , "partition": 0}',
+ ']}')
+ )
+ if(response$status_code == 204) {
+ return(response)
+ } else stop(response)
+}
\ No newline at end of file