Member since
11-28-2022
4
Posts
0
Kudos Received
0
Solutions
12-07-2022
02:40 PM
@mburgess I have the same problem. The code was written in jython. from org.apache.commons.io import IOUtils from java.nio.charset import StandardCharsets from org.apache.nifi.processor.io import OutputStreamCallback from java.lang import Object # Define a subclass of OutputStreamCallback for use in session.write() class PyOutputStreamCallback(OutputStreamCallback): def __init__(self, cadena): self.cadena = cadena def process(self, outputStream): outputStream.write(bytearray(self.cadena.encode('utf-8'))) # end class flowFile = session.get() if (flowFile != None): table = flowFile.getAttribute('table_name') if (table != 'database_1.dbo.dtproperties'): newFlowFile = session.create(flowFile) newFFC = '' newFlowFile = session.write(newFlowFile, PyOutputStreamCallback(newFFC)) session.transfer(newFlowFile, REL_SUCCESS) elif (table == 'database_1.dbo.dtproperties'): session.remove(flowFile) else: session.transfer(flowFile, REL_FAILURE) I'm understanding that flow files are passing one by one, right? So if there is a flow file with an attribute ''database_1.dbo.dtproperties" should be eliminated without affecting other flow files. But I got "flowfile has already marked for removal"
... View more