Posted: 15 Mar 2017 2:16 EDT Last activity: 23 Mar 2017 7:22 EDT
Setting proxy on REST-Connector
My requirement is to connect to third party system URL through proxy using REST-Connector. This is only needed for few REST-Connectors in our application not all. Is there any way to enable proxy other than doing the changes at JVM level where Pega is running because we don't want all the REST-Connectors to pass through this proxy.
For SOAP-Connector we can follow the steps mentioned in the below link but what about REST-Connector?
1. You can add resource parameters for the proxyHost and proxyPort on the specific Connect-REST rules
2. Override the pyInvokeRESTConnector activity rule into your application ruleset.
3. In the Java step where we check read the proxyHost and port from JVM System property, add a check just before the logic to look for proxyHost and proxyPort resource parameters from the pyResourceParameters Map (as below) and if not null set the values accordingly.
final java.util.Map resourceParamValsMap = (java.util.Map) pp.getObject("pyResourceParameters");
You need to check the Java step where we read the proxyHost and port from JVM System property, add a check just before the logic to look for proxyHost and proxyPort resource parameters from the pyResourceParameters Map and if values are not null set the values accordingly.
Theoretically, that would ensure that the proxy host and port will only be set if you have specified them as parameters for specific Connect-REST rules.