- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How does one run NIFI in the debugger?
- Labels:
-
Apache NiFi
Created 05-29-2019 12:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've successfully cloned and built the NIFI system. It built cleanly. Though initially I experienced a few random unit test failures. That was solved (it was actually a network configuration issue on my end that caused this).
The instructions I followed are here:
https://nifi.apache.org/quickstart.html
The built system is in nifi-assembly/target. I want to run the primary NIFI backend application in the debugger (not the web app, but rather the backend). I have the nifi set of maven projects loaded into eclipse.
Can someone provide me information that would assist in getting the app up and running in the debugger?
For example:
- What project contains the main entry point?
- Aside from running the main application, how do I launch the web app? I'm assuming it is launched separately from the main application.
Created 05-29-2019 04:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In nifi-assembly/target you'll find the built system as you mention, including a "conf" folder that contains (among other things) a file called bootstrap.conf. In that file there's a commented out JVM property to enable attachment by a debugger (the preceding line says "Enable Remote Debugging". When you uncomment that argument and start NiFi, it will listen on port 8000 for a debugger to attach. You can then attach a debugger from your IDE (Eclipse, NetBeans, IntelliJ, etc.). You can change the port and/or set "suspend=y" if you want it to wait until a debugger is attached before continuing startup, the latter is helpful if you are debugging something early in the startup sequence. Otherwise you can wait for NiFi to finish starting up and then attach whenever you like.
Created 05-29-2019 04:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In nifi-assembly/target you'll find the built system as you mention, including a "conf" folder that contains (among other things) a file called bootstrap.conf. In that file there's a commented out JVM property to enable attachment by a debugger (the preceding line says "Enable Remote Debugging". When you uncomment that argument and start NiFi, it will listen on port 8000 for a debugger to attach. You can then attach a debugger from your IDE (Eclipse, NetBeans, IntelliJ, etc.). You can change the port and/or set "suspend=y" if you want it to wait until a debugger is attached before continuing startup, the latter is helpful if you are debugging something early in the startup sequence. Otherwise you can wait for NiFi to finish starting up and then attach whenever you like.
Created 05-30-2019 12:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you @Matt Burgess. I'll try this today hopefully. We've built our first custom processor, and it seems like the best way to work with that is to run everything inside a single debug environment. Anyways, as usual, I appreciate your prompt and thorough response.
Created 05-30-2019 12:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Matt Burgess I've got a couple of questions for you.
- What nifi maven project contains the core application that listens on port 8000? In other words, what component implements support for the "Enable Remote Debugging" property that you describe above?
- Do you have a preferred IDE for NIFI development? I'd think that the IDE with the best support for maven integration would be the one. Perhaps they are all comparable. I do have an option to use other than eclipse: eclipse (on centos 7) is what I'm trying for now.
Created 05-31-2019 03:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Matt Burgess. I've been able to attach a debugger.. yet i cant seem to set breakpoints. I've attempted to set breakpoints in RunNIFI (in the nifi-bootstrap project). I've set breakpoints at the "status", and "stop" locations, and at many other locations. I've also tried to suspend start to allow for an attach.
I've commented on this in detail under a NIFI issue I created, since I think it deserves better attention from the developers (documentation support for new developers).
Anyways if you can give me some guidance relative to actually getting my first breakpoint placed in a location where I actually hit the breakpoint, I'd appreciate it.
Created 06-03-2019 01:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've finally worked through this challenge. It was a bit of a struggle for me, since there is inadequate documentation on some of these lower-level developer details.
However I did take the time to capture what I learned along the way. Currently I placed this learning here. If I capture more detail on this process, i will place it in the same NiFi issue.
