Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Talend experts
I have got below job which reads next API URL until it finds one also it iterates for different course_ids. I have tweaked the design a bit to run parallel execution(the idea is to use parallel execution option of iterate) to execute multiple calls at a time.
StoreCourseID:
//globalMap.put("canvas_id", row1.canvas_id);
globalMap.put("V_API_URL" + row1.canvas_id, "https://swinburneonline.instructure.com/api/v1/courses/"+row1.canvas_id +"/analytics/student_summaries?per_page=100");
globalMap.put("V_LOOP"+ row1.canvas_id, true);
tLoop:
((Boolean) globalMap.get("V_LOOP"+ row1.canvas_id))
tRestClient:
((String) globalMap.get("V_API_URL" + row1.canvas_id))
GetNextUrl
System.out.println("Current URL IS: "+globalMap.get("V_API_URL"+ row1.canvas_id)); (prints correctly)
System.out.println("Rest URL"+ globalMap.get("tRESTClient_1_HEADERS")); (doesn't print and errors out to null)
java.util.List <STRING> strList = ((java.util.Map<STRING>>globalMap.get("tRESTClient_1_HEADERS")).get("Link");
SetNextURlToCurrUrl:
if ((Boolean) globalMap.get("V_LOOP"+row1.canvas_id))
; {
System.out.println("URL1 IS: "+globalMap.get("V_API_URL"));
globalMap.put("V_API_URL"+row1.canvas_id,globalMap.get("next_url"+row1.canvas_id));
System.out.println("URL IS: "+globalMap.get("V_API_URL"));
In doing so I have run into problem where Rest URL is always getting NULL when I get it from GetNextURL (tjava) component. Not sure what's wrong. Any help is really appreciated!
@rhall and @gr44: your input is really appreciated!!
Thanks
Harshal.
I'm not sure. This *might* be a bug. I built a quick job like this....
tRowGenerator -------------------------------------> tFlowToIterate-------------------------> tJava
(Generating a single integer sequence) . (Running 10 in parallel) (Printing the numbers)
This produced an output of .....
3
9
1
4
10
7
8
2
6
5
I extended the test to 100 with 100 in parallel and it still looked ok.....although I didn't spend too much time checking.
But I did this in v6.5.1. Try something similar and see if you get problems. If you do, it sounds like a bug in v6.4