You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

REST API Groovy Script: "Error 429 - Too many requests" since Gen2 Migration

Received Response
117
Views
9
Comments

Summary:


Content (required):

I have a basic groovy script that runs a series of rules in sequence which all worked well in EPM classic.

The script basically runs through a list of requests and for each job, does a poll against the server to check the 'jobStatus' for a complete status (i.e. a value other than -1) before proceeding to the next task.

Since migrating to Gen2 I noticed a random occurrence of errors and managed to debug and narrow it down to the part where we do the checking of the job status.

HttpResponse<String> pingResponse

for (long delay = 50; JobStatus == -1; delay = Math.min(1000, delay*2))
{
	//pause
	sleep(delay)
	pingResponse = operation.application.getConnection("DMJobs").get(restURL +"/"+ processID).asString()
	JobStatus = JsonPath.parse(pingResponse.body).read('$.status')
}

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!