Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Defining Custom Attributes in GenerateFlowFile

avatar
New Contributor

Hi,

I have case and I'm working on it. 

I'm using generateflowfile to run a python file, and then I'm using executestreamcommand processors. 

But in my python code there a Postgresql connection. I want to make this connection information and remove from the code. 

I have tried to create new properties in the generateflowfile and I have defined the postgre connection information as property and value. After I have gave into the code these property names for the connection part. 

But I couldn't run the flow. I'm getting various errors. 

Does my logic in the flow right?

Thanks. 

1 REPLY 1

avatar
Contributor

Hello,

 

Nifi can easily get data from a database, do you really need a Python script for that? If you really want to do what you describe here, I think you should use updateAttribute to set your set your database information in the flowfile attributes and then from your script use the getAttribute function to get it.