Member since
07-01-2022
15
Posts
0
Kudos Received
2
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1606 | 07-26-2022 12:31 AM | |
2632 | 07-17-2022 11:42 PM |
07-26-2022
12:31 AM
My problem was solved after using a different email id. As far as gmail settings are concerned: access to less secure apps must be turned on. IMAP access must be turned on in settings of gmail.
... View more
07-24-2022
10:52 AM
I am trying to create a flow where I extract email contents and attachments. The first step in the flow is a ConsumeIMAP processor. I have plugged in the: host name: imap.gmail.com port: 993 username: some-email-id password: .... The flowfile doesn't produce any flowfile. The "Tasks/Time" keeps increasing, but the "Out" remains 0. I have turned on authentication by less secure apps for this gmail account Is there any extra step, that I could be missing, that could be causing this? any certificate or port related stuff that I should be taking care of?
... View more
Labels:
- Labels:
-
Apache NiFi
07-17-2022
11:42 PM
Finally, it is working as intended. Both invokehttp processors are working. This article worked for me: Chaining Multiple Http API's in Apache NiFi | Medium
... View more
07-14-2022
09:12 AM
1 Kudo
@sayak17 so this looks doable as I described above. Not sure what program you are using in your screenshots as it does not show the full rest-api call structure. But your process would be as as follows: 1. Get bearer token 2. Extract bearer token from response body and place in FlowFile attribute 3. Format flowfile attribute as needed for use by the rest of the api-calls 4. Using bearer token make get request to the ../sites rest-api endpoint 5. Use ExtractText to extract the site id to a new FlowFile Attribute 6. Use bearer token again and use NiFi Expression Language to dynamically create the rest-api url to include the site id. 7. From response, extract the Drive id to another new FlowFile Attribute as above. 8. Use bearer token again and use NiFi Expression Language to dynamically create the rest-api url to include the drive id. 9 finally do whatever you need to do with the response json you get from that final rest-api call. Matt
... View more
07-07-2022
08:51 AM
2 Kudos
@sayak17 If you are simply looking to GET from a REST API endpoint and take the response and write to a local file on the server where your NiFi service is running, you'll want to use the InvokeHTTP processor and feed that to your putFile processor. If you found this response assisted with your query, please take a moment to login and click on "Accept as Solution" below this post. Thank you, Matt
... View more
07-04-2022
02:00 AM
Thanks. Using examples from that cookbook, I could make it work. Here is my code which works: from org.apache.commons.io import IOUtils
from java.nio.charset import StandardCharsets
from org.apache.nifi.processor.io import OutputStreamCallback
class PyOutputStreamCallback(OutputStreamCallback):
def __init__(self):
pass
def process(self, outputStream):
with open("D:\\Work\\nifi test\\custom processor input\\random_json.json") as f:
file_content = f.read()
outputStream.write(bytearray(file_content.encode('utf-8')))
flowFile = session.create()
if(flowFile != None):
flowFile = session.write(flowFile, PyOutputStreamCallback())
flowFile = session.putAttribute(flowFile, "filename", 'input_file.json')
session.transfer(flowFile, REL_SUCCESS)
session.commit() Next, I will figure out if I can add the local directory path as a property and read that, instead of hardcoding it in the script.
... View more