Member since
09-29-2015
871
Posts
723
Kudos Received
255
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 4307 | 12-03-2018 02:26 PM | |
| 3249 | 10-16-2018 01:37 PM | |
| 4343 | 10-03-2018 06:34 PM | |
| 3206 | 09-05-2018 07:44 PM | |
| 2448 | 09-05-2018 07:31 PM |
08-29-2017
01:17 PM
Unfortunately it depends on the processor, some processors were implemented to support '\\n' and some were not. Usually the documentation for the given property will say how to enter the value.
... View more
08-28-2017
07:19 PM
1 Kudo
Did you set the 'Message Demarcator' property on PublishKafka_0_10? It should be set to a new-line by pressing shift+enter while in the value field. Also, you can increase the concurrent tasks from 1 to 2 for PublishKafka, but this would only help if you have multiple CSV files reaching the processor at the same time. You can also look into how many partitions you have on the topic, you'll get better performance reading/writing with more than 1 partition.
... View more
08-23-2017
06:49 PM
What version of NiFi did you take the nifi-http-context-nar from? MiNiFi 0.2.1 is based on NiFi 1.2.0 and you would need to take the NAR from that release: https://dist.apache.org/repos/dist/release/nifi/1.2.0/nifi-1.2.0-bin.tar.gz
... View more
08-21-2017
04:06 PM
1 Kudo
Hi @sukesh nagaraja I think the results you got are expected behavior behavior... The extracting request handler has no way to know the field names for the data you sent in. It is generally used to extract text from files like PDFs, or Word documents, where you basically have a title and content, and everything just goes into the content mostly. For your scenario, you basically have a CSV where you know the field names. Take a look at Solr's CSV update handler: https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers#UploadingDatawithIndexHandlers-CSVFormattedIndexUpdates You can use this from NiFi by setting the path to /update and setting the Content-Type to application/csv and then add a property fieldnames with your list of fields. I'd recommend playing around with the update handler outside of NiFi first, just by using curl or a browser tool like Postman, and then once you have the request working the way you want, then get it working in NiFi.
... View more
08-18-2017
02:02 PM
There isn't an out-of-the-box way, your options would be.... 1) Use UpdateAttribute + expression language functions to parse out each parameter from the original query string into its own attribute, then use ReplaceText with a templated JSON where you reference the attribute names and values like: { ${attr1} : ${attr1.value} } Assuming you already create attr1 and attr1.value using UpdateAttribute. 2) Write a script that reads the query params from the flow file, parses them, and writes them back out as json, and then put this script into an ExecuteScript processor. 3) Write a custom Java processor that does the same as #2.
... View more
08-18-2017
01:57 PM
This is a bug in the HDF 3.0.1 release related to the integration of NiFi and Schema Registry. It will be fixed in a future release. For now you could stick with 3.0.0 if you need this to work.
... View more
08-15-2017
02:29 PM
1 Kudo
No problem. Here is how the AvroReader in NiFi handles things... If you choose "Schema Access Strategy" of "Use Embedded Avro Schema" then it uses this class which uses a datafile stream: https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/avro/AvroReaderWithEmbeddedSchema.java If you choose one of the other "Schema Access Strategy" options, like from a schema registry, then it uses this class: https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/avro/AvroReaderWithExplicitSchema.java So if you want your custom processor to support either option then you can model it after AvroReader: https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/avro/AvroReader.java#L87
... View more
08-15-2017
01:53 PM
1 Kudo
Can you show the configuration for the AvroRecordSetWriter being used by ConvertRecord? Specifically, what is the Schema Write Strategy set to? I believe it would have to be set to "Embedded Avro Schema" in order for it to be read as a data file.
... View more
08-11-2017
03:55 PM
1 Kudo
The FlowFiles produced by HandleHttpRequest will have the content of the HTTP request, since your case is a GET request with no content, that is why the FlowFile is empty. The FlowFiles should have an attribute called "http.query.string" which should contain the query params portion of the URL. You should be able to see this by looking in provenance, or by using a LogAttribute processor. If you want to store the query params in HDFS you need to get them into the content of the flow file. You can do this using a ReplaceText processor, and set the Replacement Value to ${http.query.string}. HandleHttpRequest is meant to be used with HandleHttpResponse to create a web server. So you would do something like: HandleHttpRequest -> ReplaceText -> PutHDFS From PutHDFS you would connect the success relationship to a HandleHttpResponse that sent a 200 response, and connect the failure relationship to a different HandleHttpResponse that sent a 500 response. This way the client knows if the request succeeded or not. If you don't care about the client knowing about this, you could just have the success relation of HandleHttpRequest go right to a HandleHttpResponse and always return a 200, then also send success to the rest of the flow (ReplaceText, PutHDFS, etc). In this case the client will always see it as successful even if the write to HDFS failed.
... View more
08-11-2017
12:22 PM
Just set the "Delimiter Strategy" in MergeContent to "Text" and then set the "Demarcator" property to shift+enter to make a new line. It will insert the demarcator between each flow file that it merges.
... View more