You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Brett Tiplitz <br...@systolic.com> on 2019/03/06 21:33:35 UTC

jni with Apache Nifi

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

Re: jni with Apache Nifi

Posted by Marc Parisi <ph...@apache.org>.
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 <br...@systolic.com>
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
>