jni with Apache Nifi

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

jni with Apache Nifi

Brett Tiplitz
I'm trying to make a call from C++ into the Apache Nifi Logger.  I see an
abstract logger class, but nothing static.  I also look at all the class
methods, and nothing is appearing to be an external callable method.  Any
suggestions?

brett
Reply | Threaded
Open this post in threaded view
|

Re: jni with Apache Nifi

Marc Parisi
Brett,
  You can take a look at what we do in Apache NiFi MiNiFi C++ --
https://github.com/apache/nifi-minifi-cpp/tree/master/extensions/jni

  In this package you can see the Java code that links in the logger.

   In the class we use to launch NiFI processors [1] we first obtain the
logger class reference from the class loader, after which we set a
reference to the pointer (in our Java object ) that allows us to return the
ComponentLogger with ours from MiNiFi C++. This enables components within
NiFi to log to MiNiFI C++, and for us to access loggers if need be.

   Hope this helps.

[1]
https://github.com/apache/nifi-minifi-cpp/blob/master/extensions/jni/ExecuteJavaProcessor.cpp#L103

   Let me know if you have any other questions.
   Marc Parisi

On Wed, Mar 6, 2019 at 4:44 PM Brett Tiplitz <[hidden email]>
wrote:

> I'm trying to make a call from C++ into the Apache Nifi Logger.  I see an
> abstract logger class, but nothing static.  I also look at all the class
> methods, and nothing is appearing to be an external callable method.  Any
> suggestions?
>
> brett
>