apache-kafka

Get the latest offsets in SSL Enabled Kafka via CMD


I have being using the below CMD to get the latest offsets in from a Kafka Queue which has plain-text port open

kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list server:9092 --topic sample_topic --time -1

But, now we only have the SSL port open, so I tried passing the SSL details as a property file

kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list server:9093 --topic sample_topic --time -1 --consumer-config /path/to/file

Getting the below error -

Exception in thread "main" joptsimple.UnrecognizedOptionException: consumer-config is not a recognized option

How do I pass the SSL details to this command? These are all the available arguments for kafka-run-class.sh kafka.tools.GetOffsetShell

--broker-list <String: hostname:and port,...,hostname:port>                
--max-wait-ms <Integer: ms>            
--offsets <Integer: count>             
--partitions <String: partition ids>   
--time <Long: timestamp/-1(latest)/-2             
--topic <String: topic>

Solution

  • Unfortunately kafka.tools.GetOffsetShell only supports PLAINTEXT connection. This tools is not used a lot and nobody has bothered updating it.

    Depending on your use case, you have a few options: