...
REST methods should be implemented as simple HTTP / HTTPS scripts that work in pair with JSON in the body of an HTTP request and return JSON in the HTTP body of responses.
Request
Protocol | HTTP / HTTPS |
---|---|
URL | |
Method | POST |
Content-Type | application/json |
Body | JSON |
Response
In response, WCS should receive a standard HTTP response containing the body of JSON
status | 200 |
Reason phrase | OK |
Body | JSON |
Disable REST hooks
REST hook sending is enabled by default. To disable it, the following parameter must be set in flashphoner.properties file
Code Block | ||||
---|---|---|---|---|
| ||||
disable_rest_requests=true |
...
Backend server response to WCS requests delays are possible under high load. Maximum di=uration of such delays can be controlled with the following parameter in flashphoner.properties file
Code Block | ||||
---|---|---|---|---|
| ||||
rest_request_timeout=15 |
By default, maximum backend server response delay duration set to 15 seconds. If backend response is not received during this time, the exception will be printed to server logs
Code Block | ||||
---|---|---|---|---|
| ||||
09:05:17,012 ERROR RestClient - API-ASYNC-pool-12-thread-2 Got exception in REST java.net.SocketTimeoutException: Read timed out |
The error will be handled as set in restClientConfig.
It is stringly recommended to set maximum backend server response delay duration from 1 to 10 seconds. The value
...
fully disables delay control.
Exceptions handling while sending a request
Since build 5.2.1475, if an error occurs while sending a request to backend server, a number of retries will be performed, 3 by default:
Code Block | ||
---|---|---|
| ||
rest_client_request_retry_count=3 |
Exceptions handling can be disabled by the following parameter
Code Block | ||
---|---|---|
| ||
rest_client_request_sent_retry_enabled=false |
In this case, if request sending fails, no retries are performed, and a corresponding exception is written to server log, for example
Code Block | ||
---|---|---|
| ||
10:32:43,072 ERROR RestClient - API-ASYNC-pool-13-thread-15 Got exception in REST
org.apache.http.NoHttpResponseException: localhost:8081 failed to respond |