Member since
05-24-2022
11
Posts
1
Kudos Received
4
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1265 | 05-22-2023 07:47 AM | |
663 | 04-25-2023 04:07 AM | |
2972 | 07-06-2022 06:23 AM | |
1344 | 06-15-2022 08:07 AM |
05-22-2023
07:47 AM
1 Kudo
I used a global variable (DistributedMapCacheClientService & DistributedMapCacheServer) and a separate process group to run each 2 min to get a token then store that token in my global variable and use it in the header of my OnBoard API and each time i get a 403 error I loopback my flow file to request new token to use UpdateAttribute before the InvokeHTTP is used to get the exact token text from the full response from the oauth API InvokeHTTP Get Auth Token (Cycle)
... View more
04-26-2023
03:08 AM
Hello I have the following : Tomcat server (local) Nifi (local) customer csv file In my flow I am getting the file content and transforming it to a json body (the body I need to send it in the API post). The problem is to use the invokeHTTP processor to send the api (onboard) I need to get a token via another API (auth) and add it in the header of the main api (onboard). Auth API : Sends a json to the tomcat : {
"user_name": "User",
"password": "Password"
} And get a json with a token valid for 2 min {
"id": 1,
"user_name": "user",
"token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJzdXBlcmFkbWluIiwidGV...",
"roles": [
"USER",
"ADMIN"
],
"homePage": null,
"priorite": 0
} The problem is when I pass the customers json to the auth API it will take that json as the body for that API and I lose my customer json. Is there another way to get the token from the auth API and use it in the onboard API header without losing the customers json (main flow)?
... View more
Labels:
- Labels:
-
Apache NiFi
04-25-2023
04:07 AM
I used this Jolt Spec with the help of chatGPT and it worked [{ "operation": "shift", "spec": { "systemId": "systemId", "systemName": "systemName", "items.nid": "items.nid", "items.birth_date": "items.birth_date", "items.last_name": "items.last_name", "items.entity_type": "items.entity_type", "items.citizenship": "items.citizenship", "items.nationality": "items.nationality", "items.business_name": "items.business_name", "items.customer_type": "items.customer_type", "items.first_name": "items.first_name" } }, { "operation": "modify-overwrite-beta", "spec": { "items": { "*": "=ifEmpty(@(1,&),'')" } } }, { "operation": "shift", "spec": { "systemId": "systemId", "systemName": "systemName", "items": "items" } }]
... View more
04-25-2023
02:03 AM
Hello I have created a JSON body but I need to reconstruct it so I can send it in a REST API. Input : {
"systemId" : "4",
"systemName" : "Main",
"items.nid" : "123",
"items.birth_date" : "1978-01-01",
"items.last_name" : "Willson",
"items.nationality" : "GN",
"formId": 1
} Output : {
"formId": 1,
"systemId" : "4",
"systemName" : "Main",
"items" {
"nid" : "123",
"birth_date" : "1978-01-01",
"last_name" : "Willson",
"nationality" : "GN"
}
} I used JoltTransformJSON but with no luck always get null as a result, I can't figure how to regroup them based on the name "items.*" . how can I regroup my items or is there a better way to solve this point ?
... View more
Labels:
- Labels:
-
Apache NiFi
11-29-2022
06:39 AM
I need to create a flow that update rows in my database based on csv file. I have : 1- GetFile status client_id Active 123 Inactive 456 2- UpdateAttribute to update the Baobab_file (the schema is already in the AvroSchemaRegistry (collection) 3- SplitRecord to get each line status client_id Active 123 4- ExecuteSQL : update table_client set current_status = status where id = client_id How can I do this I tried ${status} and \status but no luck Thank you
... View more
Labels:
- Labels:
-
Apache NiFi
07-06-2022
06:23 AM
Thank you all for your replays, The fix was so simple: All I need to do to specify from which database schema I want to work with or have the lookup service connected to I just added the schema name before the table name like this : sandbox_s01.table_name
... View more
06-21-2022
06:56 AM
Hello I'm using Postgresql with NIFI, how can I specify the schema I want to use from Postgresql There is no option for the schema in the DBCPConnectionPoll. and there is no option for schema also in the lookup service
... View more
Labels:
- Labels:
-
Apache NiFi
06-15-2022
08:07 AM
I used ConvertCharacterSet and changed the oncoding from UTF-16 to UTF-8 and that fixed for me Thanks
... View more
06-15-2022
03:00 AM
Hi, I am getting a csv without a header then adding a header with ReplaceText to it after the ReplaceText the header is added but the rest is crashed. PS: This problem happen with this file only I tried the flow with other csv files and worked fine, can this be a csvReader problem or configuration on the encoding ? Before : The replace : After :
... View more
Labels:
- Labels:
-
Apache NiFi
05-24-2022
02:14 AM
Hello, I'm trying to learn NIFI so this is all new to me, I used to work with Talend and I have hard time translating to NIFI. So the main idea: For example is I have two tables in Postgresql Table CITY : ID (auto generated), city_name Table PERSON : ID (auto generated), first_name, last_name, city_id and I have a CSV file : first_name, last_name, city_name Can you please explain how I can insert in tow tables from one flowfile and refer in the table PERSON to the ID of the city not the name from the table CITY. Thank you.
... View more
Labels:
- Labels:
-
Apache NiFi