Horje
how to check number of messages in kafka topic Code Example
how to check number of messages in kafka topic
brokers="<broker1:port>"
topic=<topic-name>
sum_1=$(/usr/hdp/current/kafka-broker/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list $brokers --topic $topic --time -1 | grep -e ':[[:digit:]]*:' | awk -F  ":" '{sum += $3} END {print sum}')
sum_2=$(/usr/hdp/current/kafka-broker/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list $brokers --topic $topic --time -2 | grep -e ':[[:digit:]]*:' | awk -F  ":" '{sum += $3} END {print sum}')
echo "Number of records in topic ${topic}: "$((sum_1 - sum_2))




Java

Related
and roid shape setCornerRadii Code Example and roid shape setCornerRadii Code Example
javafx edit list Code Example javafx edit list Code Example
java xml element get attribute value Code Example java xml element get attribute value Code Example
how to disable screenshot in react native Code Example how to disable screenshot in react native Code Example
java localdate subtract two dates Code Example java localdate subtract two dates Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10