REST ajax request is being invoked every 5 minutes | weblogic

632 views Asked by At

I am facing this problem when a rest webservice is being invoked by my UI code running on weblogic 10.3.0, after precisely 5 minutes the webservice gets invoked again. Am puzzled as to where the problem is.

My request is coming from Ajax call on ExtJS UI. This request hits the backend webservice which typically consumes more than 5 minutes. So as soon as time from first request surpasses 5 minute duration there is another webservice hit (as per the logs). I checked the network using firebug but i dont see multiple requests.

At first I thought this might be the ajax timeout, so tried setting the global timeout in ajax as 2 hrs but that isnt helping. I configured web.xml session timeout as 2 hrs which dint help either. In weblogic admin console i tried the max timeout for JTA (java transaction API) (assuming its something to do with all transactions) to 1800 seconds, which also dint help.

I would much appreciate it if you guys give me some pointers as to what other things I can try to resolve this issue.

PS: Its 5 minutes to the exact second as per the logs.

2016-12-13 07:52:25,783 INFO [103' for queue: 'weblogic.kernel.Default (self-tuning)'] search.Search.exportData - Starting exportData
2016-12-13 07:57:25,787 INFO ['72' for queue: 'weblogic.kernel.Default (self-tuning)'] search.Search.exportData - Starting exportData
2016-12-13 08:02:25,784 INFO [101' for queue: 'weblogic.kernel.Default (self-tuning)'] search.Search.exportData - Starting exportData

The problem is that my webservice is getting invoked every 5 minutes iff the duration of that webservice goes beyond 5 minutes. Let me explain it with an example:

@ Time 0 minutes : UI calls a webservice : /exportData  (lets say this api typically takes 16 minutes to complete)
@ Time 5th minute : /exportData gets invoked again with no interation from UI. Nor there is a trace in UI network which says UI called this webservice.
@ Time 10th minute : /exportData gets invoked again
@ Time 15th minute : /exportData gets invoked again

So in the end at minute 15.1 , there will be 4 instances of exportData running parallel. I have tried to increase the timeout in ajax request and session timeout in web.xml and other things but none of it is resolving the issue.

If the exportData happen to finish within 5 minute, there wont be any subsequent invocations. The problem is that application should not re invoke the webservice if that particular call takes more than 5 minutes, I just wish to find out where this timeout of 5 minutes is configured.

I have already tried setting that ajax.timeout globally to 2 hrs, web.xml session timeout to 2hrs. Changed weblogic JTA timeout to 30 minutes. But it hasnt helped.

1

There are 1 answers

5
Brian Pipa On

A few things come to mind... if you are sure it's your webapp making the calls, use Firebug or Chrome dev tools and put a breakpoint at the point it calls your webservice, then use the stack trace to backtrack and figure out what's triggering it (presumably every 5 minutes).

I'm assuming a few things here... is the call to the webservice juts kicking off a job and it doesn't need the results?

I think what you might want to do is put something in the server side code that keeps track if an export is already running and when a call comes into the webservice, it first checks to see if it's already running and if so, it doesn't run it again. If the webapp does look at the results, your webservice could just return a message like "export already running."