Configure RestTemplate¶
Spring Boot offers a RestTemplate to help
facilitate making rest calls. The Onegini Extension Engine has exposed an instance of that object by default to be used within your scripts. It can be accessed
using the global REST_TEMPLATE
. You may need to configure other classes for use in your JavaScript in order to use the
RestTemplate properly.
Configure connection and read timeouts¶
Property | Default | Description |
---|---|---|
RESTSERVICES_WAITFORAVAILABLECONNECTIONINPOOLTIMEOUT | 5s | Timeout for waiting for available connection in pool |
RESTSERVICES_REQUESTCONNECTIONPOOLMAXSIZETOTAL | 30 | Total max size of the http connection pool |
RESTSERVICES_REQUESTCONNECTIONPOOLMAXSIZEPERROUTE | 5 | Max size of the http connection pool per single route |
RESTSERVICES_REQUESTCONNECTIONPOOLVALIDATEAFTERINACTIVITY | 2s | Timeout validating connection in pool after inactivity |
RESTSERVICES_READTIMEOUT | 10s | Request read timeout |
RESTSERVICES_CONNECTIONTIMEOUT | 2500ms | Request connection timeout |
You can use different units for time based properties, ie all of the following will set read timeout to 1 minute:
RESTSERVICES_READTIMEOUT=1min
RESTSERVICES_READTIMEOUT=60s
RESTSERVICES_READTIMEOUT=60000ms
See writing scripts for help using the RestTemplate object.