set connection timeout in java for MPS client

3 次查看(过去 30 天)
Hi,
Based on Java documentation in MPS guide, I configured a 5 minute connection timeout as below:
However, I have a long running Matlab function on MPS and it times out after just 1 minute and not 5...
I get the error:
! com.mathworks.mps.client.MWHttpException: Failed HTTP request; Response Status: 504, Response Message: Gateway Time-out
! at com.mathworks.mps.client.internal.SunHttpClientFevalHandler.processRequest(Unknown Source)
! at com.mathworks.mps.client.internal.ComponentProxy.processRequest(Unknown Source)
! at com.mathworks.mps.client.internal.ComponentProxy.invoke(Unknown Source)
! at com.mathworks.mps.client.internal.SingleOutputDispatcher.dispatch(Unknown Source)
! at com.mathworks.mps.client.internal.MWClientInvocationHandler.invoke(Unknown Source)
! at com.sun.proxy.$Proxy75.CompareModels(Unknown Source)
What am I doing wrong?
static class MyClientConfig extends MWHttpClientDefaultConfig {
public long getTimeOutMs() {
log.info("MPS timeout set to 5 minutes");
return 5*6*1000; // 5 minutes
}
}
MWHttpClient client = new MWHttpClient(new MyClientConfig());

回答(2 个)

Kojiro Saito
Kojiro Saito 2022-1-7
5*6*1000 is 30000 milliseconds (=30 seconds). Are you sure you set 5*60*1000 ?
public long getTimeOutMs() {
log.info("MPS timeout set to 5 minutes");
return 5*60*1000; // 5 minutes
}

Jason Novotny
Jason Novotny 2022-1-7
The issue resulted from the Elastic Load Balancer configuration in AWS which has a default of 60 seconds.

类别

Help CenterFile Exchange 中查找有关 Installation 的更多信息

产品


版本

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by