Monday, October 10, 2011

OEG - Oracle Enterprise Gateway - Throttling

Simple example - throttle to only 5 requests per minute.

This builds on the example detailed in the previous OEG blog posting.

http://niallcblogs.blogspot.com/2011/09/registering-web-service-with-oracle.html

We will now amend the generated circuit (or shall we say, policy pipeline) to throttle requests to 5 per minute and email the Sys admin in case of violation.

We do this using the Throttling filter -



It is configured as follows -



Now we need to set up the connection to the EMAIL server (I'm using James for this)

We need to add an Alert destination -



Configured as follows -



Naturally, I have already created a user oegadmin on James - adduser oegadmin welcome

Now I configure an Alert filter in the policy (Failure Path) -






Deploy and test -

We can use Service Explorer and simple click run 6 times to see throttling in action.

I then check my email -



However, there is an easier way of doing this. We can use the OEG sr cmdLine tool to send the requests for us -



sr -h localhost -u/NiallsCreditCardService -s 8082 -p 10 -d10

The parameter definitions -




Now you be asking what is this /NiallsCreditCardService ?
this is simply a relative path I created on OEG -



essentially virtualising the backend service for us.

No comments: