The guideline here uses 2.4.0 (Scala 2.12) for debugging. You can chose whichever version you need and set up using the same instructions.

  1. As per previous instructions in Developer Setup Area , Please configure your eclipse to be ready.
  2. As per the screenshots below, configure a Scala Application Runtime.


3. Configure the VM and program arguments - Please Note: This is simply running a Kafka runtime. This assumes that Zookeeper is still running. You could use the same mechanism to create a ZK runtime. Since, KIP-500 is aiming to replace ZK in the future, this doc will not contain any detail information on how to setup ZK debugging.

The example shown here simply tries to use the ECHO'ed command from kafka-run-class.sh file. Since, Please note that the path information is in Windows format.


3. Configure the source lookup for Kafka debugger.



4. Important - Classpath configuration. There are two things to remember here:

    a) "Add JARs" - mean JARs releative to the current project

    b) "Add external JARs" means JARs in filesystem.

    Option 4(b) above is correct selection for this step. For this guide, the JARs were references simply from 2.4 tag. However, this can be configure to debug trunk.

    


5. If ZK is running and setup correctly, it's all set. One final step is to place a breakpoint in Kafka.scala file (main). Then click "Debug"



Happy debugging and further contribution.

  • No labels