Thursday, March 1, 2012

Oracle Enterprise Gateway 11.1.1.6 --> Scripting

A big thank you to MartinM for his input here!

Scenario - I want to find out how long a web service call takes in OEG.



as you can see I have a Scripting filter before and after the WS call.

Pre-filter
---------------


Post Filter
----------------


I test the policy via Service Explorer and view the trace afterwards.



You notice that the script includes a check for response time > 10 secs and sets the boolean response accordingly.

However, we may also want to get the actual response time as a process instance attribute. That is very easily done, just add the following to the 2nd script.
Firstly, define the output variable,



then add the following to the script itself -
msg.put("v_totalTimeMs",totalTimeMs);




You can see I have also added a Trace filter at the end of the process.

Deploy and test



No comments:

Post a Comment