nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Bateman <r...@windofkeltia.com>
Subject Re: How can I change the content-type of a flow file in a script processor?
Date Fri, 08 Dec 2017 15:27:25 GMT
Eric,

Just a reminder not to forget that this modifies the flowfile and you 
must gather/carry that modification in a practical sense. Therefore, 
your code will be

     flowfile = session.putAttribute( flowfile, "content-type", 
"application/json" );

and thence you'll use the updated flowfile the next time you need it 
(such as when you call session.transfer( flowfile, SUCCESS )).

Hope this reminder is useful,

Russ

On 12/07/2017 07:12 PM, Chris Herrera wrote:
> Hi Eric,
>
> If its for the content viewer you might want to use mime.type. 
> additionally you can use session.putAttribute(flowFile, 
> “content-type”, "application/json”);
>
> Regards,
> Chris
>
>
> On Dec 7, 2017, 8:10 PM -0600, Eric Chaves <eric@uolet.com>, wrote:
>> Hi guys,
>>
>> I'm trying to programatically set the content-type of a flow-file by 
>> calling flowFile.putAttribute('content-type', 'application/json') but 
>> it's not working.
>>
>> How can I change my flow-file content-type?
>>
>> Regards,
>>
>> Eric


Mime
View raw message