Member since
10-24-2016
47
Posts
16
Kudos Received
0
Solutions
09-30-2017
04:24 AM
@Jorge moyano I tried the below code as you suggested but still facing the same problem File fileObj = new File(pathname);
FileBody fileBody = new FileBody(fileObj, ContentType.MULTIPART_FORM_DATA);
HttpEntity multiPart = MultipartEntityBuilder.create().addPart("template", fileBody).build();
HttpPost httpPost = new HttpPost("http://localhost:8080/nifi-api/process-groups/root/templates/upload");
httpPost.addHeader("Content-type", "multipart/form-data");
httpPost.setEntity(multiPart);
HttpClient httpClient = HttpClientBuilder.create().build();
HttpResponse response = httpClient.execute(httpPost); Response HttpResponseProxy{HTTP/1.1 500 Internal Server Error [Date: Sat, 30 Sep 2017 04:24:37 GMT, X-Frame-Options: SAMEORIGIN, Content-Type: text/plain, Transfer-Encoding: chunked, Server: Jetty(9.4.3.v20170317)] ResponseEntityProxy{[Content-Type: text/plain,Chunked: true]}}
... View more
09-29-2017
01:09 PM
@Andrew Grande can you please help on this?
... View more
09-28-2017
10:06 AM
I am trying to create a REST API call to import a template into my NiFi UI post which Instantiate the same.
Below is the code which I tried, String pathname = "D:\\Users\\bramasam\\Downloads\\BalaBackUp.xml";
String restString = "http://localhost:8080/nifi-api/process-groups/f80896d4-c71f-3395-d527-8c6bd69f44d0/templates/upload";
HttpPost httpPost = new HttpPost(restString);
File fileObj = new File(pathname);
httpPost.addHeader("Content-type", "multipart/form-data");
FileEntity fileEntity = new FileEntity(fileObj, ContentType.MULTIPART_FORM_DATA);
httpPost.setEntity(fileEntity);
HttpClient httpClient = HttpClientBuilder.create().build();
HttpResponse response = httpClient.execute(httpPost);
StatusLine status = response.getStatusLine();
System.out.println(status.getStatusCode()); I am getting a response code of 500 and with the below response HttpResponseProxy{HTTP/1.1 500 Internal Server Error [Date: Thu, 28 Sep 2017 09:43:28 GMT, X-Frame-Options: SAMEORIGIN, Content-Type: text/plain, Transfer-Encoding: chunked, Server: Jetty(9.4.3.v20170317)] ResponseEntityProxy{[Content-Type: text/plain,Chunked: true]}} Below is the {id} from the BalaBackUp.xml file which I am trying to import from <?xml version="1.0" ?>
<template encoding-version="1.1">
<description></description>
<groupId>bd5dba8b-015d-1000-1fd5-450ede38b7a5</groupId>
<name>BalaBackUp</name>
<snippet>
<processGroups>
<id>f80896d4-c71f-3395-0000-000000000000</id>
<parentGroupId>29a5776d-9728-3fee-0000-000000000000</parentGroupId>
<position>
<x>0.0</x>
<y>0.0</y>
</position>
<comments></comments>
<contents>
<connections>
<id>c0d0e26d-5ee2-3d60-0000-000000000000</id>
<parentGroupId>f80896d4-c71f-3395-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>f80896d4-c71f-3395-0000-000000000000</groupId>
<id>1f9e926a-71fc-356f-0000-000000000000</id>
<type>PROCESSOR</type> can you please help me on what I am missing?
... View more
Labels:
- Labels:
-
Apache NiFi
07-31-2017
12:37 PM
@sri chaturvedi Please try converting both the variables to String datatype before comparison. Sample: ${d_last_updt:toDate('yyyy-MM-dd'):format('yyyyMMdd'):toString():gt(constant value:toString())} Hope this helps
... View more
07-31-2017
12:29 PM
@Gayathri, I am not sure about your complete requirement. But, the MergeContent processor is used only when you have to merge the file contents which you have split up-steam using SplitContent processor. I can suggest you with some workarounds, 1. You may have a common filename for files which follow specific schema 2. Write the file into a local file system using PutFile or into Hadoop using PutHDFS processors 3. Select 'Conflict Resolution Strategy' property to 'Append' when you write the file to disk Hope this helps.
... View more
01-31-2017
11:28 AM
1 Kudo
@Raj B Please check for the 'Writes Attribute' in 'usage' of the processor. It describes the attribute each processor writes in case of failure. Below is the Usage of 'ExecuteStreamCommand' and it details 4 different error it writes during the execution.
... View more
01-25-2017
07:46 AM
@Raj B You can do this in many ways, 1. You can have an update attribute processor at the beginning of every Processor Group to specify the module name. But this cannot be replicated at processor level. Here, you keep updating the same attribute throughout the flow 2. You have have a 'Metadata' -> as a table or a flat file that will log all the attributes of the flow file. Please check AttributeToJson processor. This can log flow attributes both as an attribute or content. Also, note that every nifi processor adds additional 'error' attribute in case of any error which can be captured by AttributeToJson processor. Hope this helps
... View more
01-21-2017
09:34 AM
Can the password in Hiveconnectionpool be passed via a configuration or property file
... View more
01-20-2017
03:57 PM
Thanks @Matt. Also, we see that the hive connection pool service prompts for username and password. The password when keyeed-in is visible. How can this be made invisible while keying in the password.
... View more
01-20-2017
02:06 PM
Whenever we deploy a new template in nifi UI, the PutHiveQL processor seems to be in disabed state. Can you please let me know ways in which it can be enabled without manual intervenssion or how can I automate it.
... View more
Labels:
- Labels:
-
Apache NiFi