O'Reilly logo

Apache Kafka Cookbook by Saurabh Minni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Monitoring producer stats

As we have Kafka server metrics, similarly there are metrics for the producer so that we can track what's happening with it.

Getting ready

Get the Kafka cluster up-and-running. You are now all set to start producing data to it.

How to do it...

  1. Start the console producer with the JMX parameters enabled. You can do this as follows:
    >JMX_PORT=10102 bin/kafka-console-producer.sh --broker-list localhost:9092 --topic mytesttopic
    
  2. Now you can connect to JMX at port number 10102 on your machine using the jconsole application as mentioned in the previous topic. You can see all the metrics in the following screenshot.
    How to do it...

    MBeans tab showing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required