Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Windows Nifi - tweets are not loading into local windows file

Highlighted

Windows Nifi - tweets are not loading into local windows file

Expert Contributor

Hello All,

I just installed nifi in my windows system and trying to get the tweets using Gettweets, and i have mentioned all the keys in properties.

Before loading the json formated tweets into a json file, i am trying to merge those into single json file using MergeContent processor with name Tweets.json.

MergeContent properties:-

16101-1.png

After that when i am tying to put these merged tweets into a file using Putfile processor, i am unable to get the tweets in my file.

PutFile Properties:-

16102-2.png

Well i am able to get the tweets from gettweets and the tweets are getting merged using MergeContent but those are not storing into the Tweets.json file using PutFile.

16104-3.png

Can anyone suggest me what exactly the mistake am i doing.

Please help.

Mohan V


3.png
1 REPLY 1

Re: Windows Nifi - tweets are not loading into local windows file

Master Guru
@Mohan V

A few observations about your above flow...

  1. You are trying to pass an absolute path and filename to the "directory" property of the putFile processor. The PutFile is designed to write files to the target directory using the filename associated to the FlowFile it receives. What you are doing will not work. Instead you should add an updateAttribute processor between your MergeContent processor and your PutFile processor to set a new desired filename on your merged files. How do you plan on handling multiple merged FlowFiles since they will all then end up with same filename? I suggest making them unique by adding the FlowFile UUID to the filename. Below is example of doing this using UpdateAttribute:

    16110-screen-shot-2017-06-07-at-83718-am.png

  2. Out of your MergeContent processor you are routing both original (all your un-merged FlowFiles) and merged relationships to the putFile processor. Why? Typically the original relationship is auto-terminated or routed elsewhere if needed.
  3. I also see from your screenshot that the PutFile processor is producing a "bulletin" (red square in upper right corner. Floating your cursor over the red square will pop up the bulletin. The bulletin should explain why the putFile is failing.
  4. It appears as though you are auto-terminating the failure relationship on PutFile. This is a dangerous practice as it could easily result in data loss. A more typical scenario is to loop failure relationship back on PutFile processor to trigger a retry in the event of failure.

Thanks,

Matt

Don't have an account?
Coming from Hortonworks? Activate your account here