clara | Posts: 5

Retrieving HTTPClient to add Connection Timeout

0 votes
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!

Duo_Liang | Posts: 3776

Reply to: Retrieving HTTPClient to add Connection Timeout

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

amcdowell | Posts: 15

Reply to: Retrieving HTTPClient to add Connection Timeout

0 votes

Was this enhancement request ever added to the java SDK?


amcdowell | Posts: 15

Reply to: Retrieving HTTPClient to add Connection Timeout

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?


Duo_Liang | Posts: 3776

Reply to:

0 votes

Hi 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


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off