You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by lannanml <ma...@gmail.com> on 2016/09/28 10:20:50 UTC

Process flowFile based on relationship

I have a custom processor that extracts some metadata from an image, and then
transfers two flowFiles, one for relationship "metadata" and the other
flowFile for the relationship "original_image". In the next downstream
processor I want to be a able to read the flowFile based on one of these
relationships. The catch is the connection configuration must process for
both relationships. Is this possible? I can't seem to find a way to do this.
Any insight will help!



--
View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/Process-flowFile-based-on-relationship-tp13477.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Re: Process flowFile based on relationship

Posted by Mark Payne <ma...@hotmail.com>.
Hello,

Certainly, what Bryan suggests here may be a valid option, if it fits your use case.
However, there are certainly cases where metadata can indeed be complex binary
data and not simple key-value pairs that fit into FlowFile Attributes.

If that's the case, the typical pattern that we follow would be to simply create the two
FlowFiles as you are doing now, but to add an attribute to each of them denoting
whether the FlowFile represents data or metadata. In the follow-on processor, you
can then examine this attribute and process appropriately. If the attribute is missing,
you could simply route to a 'failure' relationship.

Thanks
-Mark


> On Sep 28, 2016, at 8:26 AM, Bryan Bende <bb...@gmail.com> wrote:
> 
> Hello,
> 
> If it is really just metadata, Is there a reason you couldn't add the
> extracted metadata as attributes to the original flow file?
> 
> -Bryan
> 
> On Wednesday, September 28, 2016, lannanml <ma...@gmail.com> wrote:
> 
>> I have a custom processor that extracts some metadata from an image, and
>> then
>> transfers two flowFiles, one for relationship "metadata" and the other
>> flowFile for the relationship "original_image". In the next downstream
>> processor I want to be a able to read the flowFile based on one of these
>> relationships. The catch is the connection configuration must process for
>> both relationships. Is this possible? I can't seem to find a way to do
>> this.
>> Any insight will help!
>> 
>> 
>> 
>> --
>> View this message in context: http://apache-nifi-developer-
>> list.39713.n7.nabble.com/Process-flowFile-based-on-
>> relationship-tp13477.html
>> Sent from the Apache NiFi Developer List mailing list archive at
>> Nabble.com.
>> 
> 
> 
> -- 
> Sent from Gmail Mobile


Re: Process flowFile based on relationship

Posted by Bryan Bende <bb...@gmail.com>.
Hello,

If it is really just metadata, Is there a reason you couldn't add the
extracted metadata as attributes to the original flow file?

-Bryan

On Wednesday, September 28, 2016, lannanml <ma...@gmail.com> wrote:

> I have a custom processor that extracts some metadata from an image, and
> then
> transfers two flowFiles, one for relationship "metadata" and the other
> flowFile for the relationship "original_image". In the next downstream
> processor I want to be a able to read the flowFile based on one of these
> relationships. The catch is the connection configuration must process for
> both relationships. Is this possible? I can't seem to find a way to do
> this.
> Any insight will help!
>
>
>
> --
> View this message in context: http://apache-nifi-developer-
> list.39713.n7.nabble.com/Process-flowFile-based-on-
> relationship-tp13477.html
> Sent from the Apache NiFi Developer List mailing list archive at
> Nabble.com.
>


-- 
Sent from Gmail Mobile