set connection timeout in java for MPS client

조회 수: 2 (최근 30일)
Jason Novotny
Jason Novotny 2022년 1월 6일
답변: Jason Novotny 2022년 1월 7일
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