Nick, In general, attributes should not hold large quantities of data, as they are kept in memory and on the heap. The flowfile content is where the data under operation belongs, and NiFi is optimized for this model.
However, there are definitely scenarios where attributes are necessary in order to process the data (i.e. HTTP operations where multiple distinct header values are needed, routing information, metadata for queries, etc.). As you point out, EvaluateJsonPath offers a destination option because it could be used to perform a content transformation (I want the incoming JSON data to be changed to the following output data), or it could be used for attribute extraction (I still care about the JSON data I am carrying in this flowfile content and want it to stay intact, but I need to extract a specific key to an attribute in order to route to a different flow segment). We do hope to be somewhat consistent with these approaches, but as the processors have been contributed and enhanced over the years, there are certainly some legacy design decisions that still present themselves. When you encounter these situations, asking questions is excellent, because it either offers an opportunity for many people to learn about a specific decision that was made, or results in the developers recognizing a need for improvement and being able to act on that. Thank you. Andy LoPresto [email protected] [email protected] PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4 BACE 3C6E F65B 2F7D EF69 > On May 9, 2018, at 8:24 AM, Nick Carenza <[email protected]> > wrote: > > Hey Koji, thank you. I did in fact end up using ExtractText. I missed that > processor on my first pass. > > I think I was just expecting some kind of standard in how processors are > designed. For instance, InvokeHttp and EvalutateJsonPath are processors that > produce output and give you the option of whether the output should go in an > attribute or be written to FlowFile content. Processors that read data should > give you the option of reading from nifi a property supporting nifi > expression language or from the FlowFile content. > > So ExtractText lets us write attributes from the content and ReplaceText lets > us match the entire contents are replace with some expression language. > > Thanks, > Nick > > On Tue, May 8, 2018 at 5:28 PM, Koji Kawamura <[email protected] > <mailto:[email protected]>> wrote: > Hi Nick, > > You may find ExtractText useful to extract string from FlowFile > content into FlowFile attribute. > E.g. MonitorActivity -> ExtractText -> PutSlack > > Thanks, > Koji > > On Wed, May 9, 2018 at 9:03 AM, Nick Carenza > <[email protected] <mailto:[email protected]>> > wrote: > > Hey all, > > > > I can't find a way to send messages with PutSlack from the MonitorActivity > > processor. MonitorActivity only writes to content and PutSlack only reads > > from attributes and expression language doesn't provide a way to bridge the > > two. What is the best way to make these processors communicate? > > > > Thanks, > > Nick >
signature.asc
Description: Message signed with OpenPGP using GPGMail
