Member since
06-03-2017
8
Posts
0
Kudos Received
0
Solutions
09-22-2017
12:20 PM
Hi @Kiran Hebbar, In the below commands, replace the value localhost with ip/hostname of your kafka broker which is in cloud. kafka/bin/kafka-console-producer.sh \
--broker-list localhost:9092 \
--topic my-topic kafka/bin/kafka-console-consumer.sh \
--bootstrap-server localhost:9092 \
--topic my-topic \
--from-beginning Thanks, Aditya
... View more
06-06-2017
01:53 PM
1 Kudo
The session provides methods to read and write to the flow file content. If you are reading only then session.read with an InputStreamCallback will give you an InputStream to the flow file content If you are writing only then session.write with an OutputStreamCallback will give you an OutputStream to the flow file content If you are reading and writing at the same time then a StreamCallback will give access to the both an InputStream and OutputStream In your case, if you are just looking to extract a value then you likely need an InputStreamCallback and you would use the InputStream to read the content and parse it appropriately for your data. You can look at examples in the existing processors: https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractText.java#L313-L318 Keep in mind, the above example reads the whole content of the flow file into memory which can be dangerous when there are very large flow files, so whenever possible it is best to process the content in chunks.
... View more