How to convert flow file content into byte[] array and zip and then save it into database as a blob file in apache nifi

34 Views Asked by At

I have a flow file as like below and now i want to convert it as byte array and then make a zip out of this and then save it into a database as a blob file. Thank you so much for any help.

A   300 AAAAA
A   301 BBBBB
A   302 DDDDD
A   303 EEEEE
A   305 HHHHH
A   306 OOOOO

My flow file content size is maximum 500 MB, i am keeping here sample one

1

There are 1 best solutions below

6
daggett On

there is a processor CompressContent that could compress flowfile content for example gzip.

As for me, gzip format is appropriate for a single-file archive.

I remember one option for zip file - MergeContent - it's dezigned to put multiple files into archive. Hopefully you can set Maximum Number of Entries = 1 to zip just one file.

So, before storing data into a database call any of those processors.