Six Stars

How to set restriction on tLoop iteration while retry for error "org.apache.axis2.AxisFault:Read timed out " in tSalesForceinput component?

Hi,

I want to count number of records for CampaignMember table from SalesForce. 

But Sometimes it gives me "org.apache.axis2.AxisFault:Read timed out" for tSalesforceinput component for only CampaignMember object ,other objects have no problem.

That's why i want to retry this process  2 times using tLoop as shown below but again for CampaignMember object when it fails it doesn't retry.

Can any one resolve my issue and provide me solution over this?

 

Thanks,

vaibhav

 

retry by tloop.jpgtJava code.jpgtloop setting.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: How to set restriction on tLoop iteration while retry for error "org.apache.axis2.AxisFault:Read timed out " in tSalesForceinput component?

Hi,

Sorry for late reply......!

The issue is solved now but with different approach .

I uses one more tRunJob to retry the job on my expected condition. Also uses tBufferOutput component to transfer parameters back to Master Job.

 

Design is like this:

Master job-->tRunJob_1-->Child Job-->If error comes -->tBufferOutput--->Master Job-->If Error recorded-->tRunJob_2-->process repeats ....

 

Master jOb-

RowCountMaster Job pic.jpg

 

Child Job-

Rowcount child job pic.jpg

8 REPLIES
Twelve Stars

Re: How to set restriction on tLoop iteration while retry for error "org.apache.axis2.AxisFault:Read timed out " in tSalesForceinput component?

This is down to an error in your Java. By the way, thanks for the screenshots, but with code it is easier if you copy and paste it into the forum. It allows us to edit it for you Smiley Happy

 

Please excuse typos in the code examples.

Your loop condition should be like below.....

((String)globalMap.get("LoopIterate")).compareToIgnoreCase("Start")==0

You are comparing the exact value. You are saying "Is the value of my globalMap variable THIS value?". It's subtle but it is like saying that two cars are the same. They may be the same make, model, year, colour.....they may even have the same number plate. They may look EXACTLY the same. But they are different cars. The "==" checks for that. You want to compare the value.

The second issue is with the first line of your IF condition in the tJava. There is a relatively famous saying which goes "You can say someone is a waste of space, but not a waste of null". Null is nothing. It is the non existence of something. You are treating as a String with the value "null". What you want to use is below (again, the code is pseudo code, but you should get the idea)....

if(globalMap.get("Salesforce_component")==null){
     ---do something
}else if(........

Try adjusting your code following the above and you will be a step closer. It still may have issues. If so, let us know

 

 

Rilhia Solutions
Six Stars

Re: How to set restriction on tLoop iteration while retry for error "org.apache.axis2.AxisFault:Read timed out " in tSalesForceinput component?

Hi rhall_2_0,
Thanks for your quick response Smiley Happy
I have used the condition mentioned in your reply,my job running fine with all other objects but still issues with CampaignMember object.

Actually the thing is I have used tLogCatcher in my job at bottom but whenever Read timed out error comes it doesn't go to tjava where I update my Global variable value used in tLoop so it doesn't retry and directly terminate the flow.

Can you suggest me over this?

Regards,
Vaibhav
Twelve Stars

Re: How to set restriction on tLoop iteration while retry for error "org.apache.axis2.AxisFault:Read timed out " in tSalesForceinput component?

You are using an OnComponentOK to link to the tJava. That is likely something to do with this here. You can sort this by changing the approach. Have the globalMap that controls the Loop to be immediately set to the value that will continue the loop before you do anything. Then set that globalMap to be the complete status in the tJava which currently is not being fired. My thinking is that this will only be fired on a successful run. Therefore you should use this to end the loop instead of continue it.

Rilhia Solutions
Six Stars

Re: How to set restriction on tLoop iteration while retry for error "org.apache.axis2.AxisFault:Read timed out " in tSalesForceinput component?

Hi,
I am actually doing whatever u said in your reply but there is no problem with objects those are successfully executed .
Problem is with some objects that's why I want to retry them at least for 2 times so that error vanishes and I get success message.
Because when I get same error on Sales Force UI for same object ,I just fire SOQL query again to count no. of records in that object ,after 2 retry it will gives me the count.
Same thing I want implement in my scenario also but bcz of tLogCatcher the flow directly divert to end and the value for tLoop is not updated.

Can you send me working example for my scenario that I discussed so that I will implement it?

Thanks & regards
Vaibhav
Twelve Stars

Re: How to set restriction on tLoop iteration while retry for error "org.apache.axis2.AxisFault:Read timed out " in tSalesForceinput component?

If you are getting an error with the Salesforce component the flow will not get to the tJava. As such, you need to increment a counter before the Salesforce component. I would approach this in the following way...

1) Use an increment counter in your Loop. Also use a While Loop. This can be done with a globalMap variable created before the tLoop (maybe in a tJava).
2) Increment this globalMap variable before the Salesforce component is called.
3) Set the While loop limit to whatever you want (I think you say you wish it to try twice).
4) If the Salesforce component is called successfully and the update is carried out in the DB (ie if the tJava at the end is reached) set the gobalMap varible to be equal or greater than you max loop value.

This *should* solve your issue.

Rilhia Solutions
Six Stars

Re: How to set restriction on tLoop iteration while retry for error "org.apache.axis2.AxisFault:Read timed out " in tSalesForceinput component?

Hi,

tLogCatcher doesn't allow me to divert the flow of execution for retry as previously discussed, now I disable it and handle the incoming error by using "onComponentError" link and attach it further with tJava where I update my tLoop condition .

 

This will update global variable value from tloop and go for retry. But now again different issue arises though my condition -

if((Integer)globalMap.get("tLoop_1_CURRENT_ITERATION")<3)
{
globalMap.put("LoopIterate", "Start");
System.out.println("Going for Retry for "+context.SF_Table);
}

is true it doesn't pass the flow to tjava also , as I don't get "Going for Retry for" message in error log/trace.

Is there any limitation for OnComponentError link? Does it support all objects i.e. input components as  well as output components?

 

Kindly reply ...!

Vaibhav

Twelve Stars

Re: How to set restriction on tLoop iteration while retry for error "org.apache.axis2.AxisFault:Read timed out " in tSalesForceinput component?

The fact that your code is not getting to the the tJava is not because something is going wrong. There is no error on what I suspect your OnComponentError is connected to. The error is occurring on the salesforce component and the flow will likely stop there (I cannot see it, so I am having to guess). That is why I gave the suggestion I did above. You need to have the status (variable settings) set to a state of failure before the Salesforce component so that if the flow stops dead there, it will cycle through again. If the flow gets beyond the Salesforce component then it can be considered a success.

It is very hard to imagine your flow (particularly as you say you have changed it). Can you try what I suggested, test it and send a screen shot with issues?

By the way, the tLogCatcher just intercepts logs. It does not change the flow. You can see how it is supposed to be used by looking at the link below.

 

https://help.talend.com/display/TalendOpenStudioComponentsReferenceGuide61EN/tLogCatcher

Rilhia Solutions
Six Stars

Re: How to set restriction on tLoop iteration while retry for error "org.apache.axis2.AxisFault:Read timed out " in tSalesForceinput component?

Hi,

Sorry for late reply......!

The issue is solved now but with different approach .

I uses one more tRunJob to retry the job on my expected condition. Also uses tBufferOutput component to transfer parameters back to Master Job.

 

Design is like this:

Master job-->tRunJob_1-->Child Job-->If error comes -->tBufferOutput--->Master Job-->If Error recorded-->tRunJob_2-->process repeats ....

 

Master jOb-

RowCountMaster Job pic.jpg

 

Child Job-

Rowcount child job pic.jpg