Using the Java SDK, is there a way to retrieve the HttpClient to add a connection request timeout (ie. for instances where OneSpan may possibly be down)?
Thanks!
March 4Created
January 21Last Updated
3 years agoLast Reply
5Replies
208Views
3Users
0Likes
0Links
Duo_Liang | Posts: 3776
Reply to: Retrieving HTTPClient to add Connection Timeout
Monday, March 4, 2019 at 09:34am
0
votes
Hi Clara,
Unfortunately, there's no function in the Java SDK allowing retrieving HttpClient object because all HttpClient object are built by buildHttpClient() function in RestClient class, and it's a private function.
There's already an Enhancement Request for adding this feature to the SDK and it's currently a candidate, whereas there's no detailed ETA for this update. I would definitely help you fill in another ER ticket for this feature as more people request the feature, the feature would get higher priority.
Or potentially, even if it's very unrecommended to modify the SDK yourself, you can create a RestClient class in com.silanis.esl.sdk.internal package in your own project path. Copy paste all the existing code and modify the buildHttpClient() function, add connect timeout and socket timeout like something below:
SocketConfig socketConfig = SocketConfig.custom()
.setSoTimeout(10*1000)
.build(); //added config
final HttpClientBuilder httpClientBuilder = HttpClients.custom()
.setDefaultSocketConfig(socketConfig) //added line
;
But still, it's not suggested to overwrite classes from SDK as in that case, we can't confirm that the SDK would still work properly.
Hope this could help!
Duo
Unfortunately, this enhancement request is still a candidate at this time. If you preferred, I can vote on behalf of your organization for this request in the roadmap system.
Reply to: Retrieving HTTPClient to add Connection Timeout
Thursday, September 2, 2021 at 01:21pm
0
votes
Yeah, that would be nice. So currently is there not a timeout set at all? We had an issue on the evening of 8/31 where we had some really long running threads that were eating up memory and cpu. Do you know if the OneSpan servers were having issues at that time?
Sorry to hear that! As per the Trust Center, we were only seeing CA production release upgrade on August 31st, and there shouldn't have downtime. On top of raising an enhancement request, have you also reported the issue to support team with the SDK/API you were calling, the timestamp and the error message?
Reply to: Retrieving HTTPClient to add Connection Timeout
Monday, March 4, 2019 at 09:34amReply to: Retrieving HTTPClient to add Connection Timeout
Thursday, September 2, 2021 at 11:10amWas this enhancement request ever added to the java SDK?
Reply to: Was this enhancement request…
Thursday, September 2, 2021 at 11:44amHi Andrew,
Unfortunately, this enhancement request is still a candidate at this time. If you preferred, I can vote on behalf of your organization for this request in the roadmap system.
Duo
Reply to: Retrieving HTTPClient to add Connection Timeout
Thursday, September 2, 2021 at 01:21pmYeah, that would be nice. So currently is there not a timeout set at all? We had an issue on the evening of 8/31 where we had some really long running threads that were eating up memory and cpu. Do you know if the OneSpan servers were having issues at that time?
Reply to: Yeah, that would be nice. …
Thursday, September 2, 2021 at 01:36pmHi Andrew,
Sorry to hear that! As per the Trust Center, we were only seeing CA production release upgrade on August 31st, and there shouldn't have downtime. On top of raising an enhancement request, have you also reported the issue to support team with the SDK/API you were calling, the timestamp and the error message?
Duo