Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi team
I am having an input excel file which stores the json structure line by line that needs to be posted via tREST component in Talend.
I am reading the excel file using tFileInputExcel and using tFlowToIterate to iterate through each row of input excel and using tREST component the JSON structure is posted.
Sometimes, while the above flow is getting executed the job is getting failed with error code as 502. In that case, I need to wait for few secs and then retry posting for the same set of records.
How can this be accomplished in talend.
Thanks
Dhanoop B S
Hello,
So what you're trying to achieve is to keep those data linked to the 502 error, and then replay them ?
With tREST you need to filter the value with a textractxml or json (depending the answer you get) and then filter with a tMap.
If you use tRESTclient you have a "response" and "error" that permits you to filter directly from the tRESTClient
Personally i put the rest calls within a tLoop so you can retry a call a number of times before aborting. This does require quite a bit of extra work as you'll have to parse responses and handle various scenarios.
If I am getting 502 error, for the same set of record I need to perform posting again so as to check that the 502 error got resolved.
Thanks
Dhanoop B S
Can you please elaborate on how we can implement using tFlowIterate to iterate through each rows in excel and tloop to perform the looping operation when 502 error occurs.
Thanks
Dhanoop B S
Here's an example from a job I'm currently working on, it's essentially the same except i am retrieving data from a database then generating some JSON to use in the body of the REST POST request. I then pass those values to a subjob which is actually doing the API call. In the tLoop i call the REST endpoint then evaluate the response. If it's a success, great, if it's a failure i retry x amount of times and if it still fails then just log an error.
Thanks for your reply. I will check this out and will let you know if there is any issue while implementing.
Thanks
Dhanoop B S