4

I am working in a Spring boot project and I have a request which is returning a Gateway Timeout 504. Can I increase this timeout? Is this a property that I can change in the standalone-full.xml? I am using a wildfly server.

The request is trigger twice in 1 minute, always in 1 mint.

2
  • think this helps: stackoverflow.com/questions/13837012/… Commented Feb 19, 2019 at 16:53
  • Occurs the same behavior, look like he ignores the connection time out Commented Feb 19, 2019 at 17:09

1 Answer 1

0

Hopefully this would help.

public HttpClient getBasicAuthDefaultHttpClient() { CredentialsProvider provider = new BasicCredentialsProvider(); UsernamePasswordCredentials creds = new UsernamePasswordCredentials(user, password); provider.setCredentials(AuthScope.ANY, creds); //Fix to avoid HTTP 504 ERROR (GATEWAY TIME OUT ERROR) RequestConfig.Builder requestBuilder = RequestConfig.custom(); requestBuilder.setConnectTimeout(30 * 1000); requestBuilder.setConnectionRequestTimeout(30 * 1000); HttpClientBuilder builder = HttpClientBuilder.create(); builder.setDefaultRequestConfig(requestBuilder.build()); builder.setDefaultCredentialsProvider(provider).build(); return builder.build(); } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.