nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Thomsen <>
Subject Re: NIFI Usage for Data Transformation
Date Thu, 01 Nov 2018 16:39:40 GMT

Depending on how you implemented the custom framework, you may be able to
easily drop it in place into a custom NiFi processor. Without knowing much
about your implementation details, if you can act on Java streams, Strings,
byte arrays and things like that it will probably be very straight forward
to drop in place.

This is a really simple of how you could bring it in depending on how
encapsulated your business logic is:

public void onTrigger(ProcessContext context, ProcessSession session)
throws ProcessException {
    FlowFile input = session.get();
    if (input == null) {

    FlowFile output = session.create(input);
    try (InputStream is =;
        OutputStream os = session.write(output)
    ) {
        transformerPojo.transform(is, os);


        session.transfer(input, REL_ORIGINAL); //If you created an
"original relationship"
        session.transfer(output, REL_SUCCESS);
    } catch (Exception ex) {
        session.transfer(input, REL_FAILURE);

That's the general idea, and that approach can scale to your disk space
limits. Hope that helps put it into perspective.


On Thu, Nov 1, 2018 at 10:16 AM Nathan Gough <> wrote:

> Hi Ameer,
> This blog by Mark Payne describes how to manipulate record based data like
> CSV using schemas:
> This
> would probably be the most efficient method. And another here:
> .
> An alternative option would be to port your custom java code into your own
> NiFi processor:
> under 'Steps for Creating a Custom Apache NiFi Processor'
> Nathan
> ´╗┐On 10/31/18, 5:02 PM, "Ameer Mawia" <> wrote:
>     We have a use case where we take data from a source(text data in csv
>     format), do transformation and manipulation of textual record, and
> output
>     the data in another (csv)format. This is being done by a Java based
> custom
>     framework, written specifically for this *transformation* piece.
>     Recently as Apache NIFI is being adopted at enterprise level by the
>     organisation, we have been asked to try *Apache NIFI* and see if can
> use
>     that as a replacement to this custom tool?
>     *My question is*:
>        - How much leverage does *Apache NIFI *provides on the flowfile
> *content
>        *manipulation?
>     I understand *NIFI *is good for creating data flow pipeline, but is it
> good
>     for *extensive TEXT Transformation* as well?   So far I have not found
>     obvious way to achieve that.
>     Appreciate the feedback.
>     Thanks,
>     --
>     Toronto, ON

View raw message