Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditional routing in Apache NiFi

I'm using NiFi to get data from an Oracle database and put some of this data in Kafka (using the processor PutKafka). Example : if the attribute "id" contains "aaabb"

Is that possible in Apache NiFi? How can i do it?

like image 357
Amine CHERIFI Avatar asked May 04 '16 10:05

Amine CHERIFI


1 Answers

This should definitely be possible, the flow might be something like this...

1) ExecuteSQL or QueryDatabaseTable to get the data from the database, these produce Avro

2) ConvertAvroToJson processor to convert the Avro to Json

3) EvaluateJsonPath to extract the id field into an attribute

4) RouteOnAttribute to route flow files where the id attribute contains "aaabbb"

5) PutKafka to deliver any of the matching results from RouteOnAttribute

like image 128
Bryan Bende Avatar answered Nov 08 '22 01:11

Bryan Bende