I am able to remote debug apache nifi custom processor in eclipse (ref:1,2,3). The steps I follow are something like this:
Uncomment below line in apache nifi bootstrap.conf
java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
Start apache nifi
Create new debug configuration in eclipse with host=localhost
,port=8000
and select custom processor's project.
So I am able to hover the variables, add watch and do step through etc. However, once I get some hint and want to change some code and quickly try, what can be done? Do I need to change code, rebuild nar, stop apache nifi, put nar in apache nifi lib and then restart apache nifi. Do I have to follow this long path every time I do some code changes? Or I am missing something? I tried by changing code and saving it. But the moment I do Ctrl+S, it shows me unable to hot swap code changes screen:
Yes you need to rebuild and redeploy the NAR as you described. Generally you shouldn't have to debug too often because you should be developing the processor using a unit test built with NiFi's mock testing framework and you will have a pretty good idea the processor is going to work before ever running it. Then remote debugging is only really needed for unusual cases that can't be simulated in a unit test.