CenturyLinkCloud / mdw

https://centurylinkcloud.github.io/mdw/
MIT License
46 stars 10 forks source link

Default values for READ_TIMEOUT and CONNECT_TIMEOUT in HTTP adapters #828

Closed donaldoakes closed 4 years ago

donaldoakes commented 4 years ago

Modify HttpServiceAdapter.getReadTimeout() and HttpServiceAdapter.getConnectTimeout() so that they return a default value if the attribute is not configured for the adapter. For example, instead of calling getAttributeValueSmart(READ_TIMEOUT), we can call getAttribute(String, int), passing the default value as the int parameter.

The reason this is needed is to avoid adapter service calls blocking for indeterminate periods, tying up threads and database connections.

Default values should be as follows: read timeout: 10 seconds connect timeout: 20 seconds