Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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))
Comment

PREVIOUS NEXT
Code Example
Java :: R8: java.lang.OutOfMemoryError: GC overhead limit exceeded react-native 
Java :: android foreground services set auto cancel not working 
Java :: a?che les paramètres de la ligne de commande triés par ordre lexicographique en java 
Java :: how to create char type with jpa 
Java :: Java Access PriorityQueue Elements 
Java :: java Convert a string IPv4 IP address to the equivalent long numeric value. 
Java :: practical1_answer 
Java :: merging two sorted arrays 
Java :: pop back stack fragment android 
Java :: java easy list 
Java :: Create JDBC connection using properties file 
Java :: resizing ImageIcon in JButton java 
Java :: comparer deux entiers java 
Java :: add infinite numbers to variable java 
Java :: video compression with java 
Java :: dont kill service in android studio 
Java :: make a textarea not editable javafx 
Java :: singleton implementation 
Java :: java Detect Cycle in a Directed Graph 
Java :: set union java 
Java :: Implementing the Stack Class in java list 
Java :: array de meses java 
Java :: how to call same activity again in android 
Java :: Bukkit plugin player variable 
Java :: android snackbar message is behind back button 
Java :: java programme for fibonnaci series 
Java :: get week number from localdate java 
Java :: Java 2-dimensional Array 
Java :: how to get filename without extension in java 
Java :: exception class implementation in java 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =