Skip to content

Commit

Permalink
Extend Spring Cloud log streaming read timeout (#4679)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flanker32 authored Oct 26, 2020
1 parent 654ecf5 commit c581da5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@


public class AzureSpringCloudMvpModel {
private static final int SPRING_LOG_STREAMING_CONNECT_TIMEOUT = 3 * 1000; // 3s
private static final int SPRING_LOG_STREAMING_READ_TIMEOUT = 10 * 60 * 1000; // 10min
private static final String LOG_STREAMING_ENDPOINT = "%s/api/logstream/apps/%s/instances/%s?follow=%b";

public static List<ServiceResourceInner> listAllSpringCloudClusters() throws IOException {
Expand Down Expand Up @@ -240,8 +242,8 @@ public static InputStream getLogStream(String appId,
final String basicAuth = "Basic " + new String(Base64.getEncoder().encode(userpass.getBytes()));
connection.setRequestProperty("Authorization", basicAuth);

connection.setReadTimeout(50000);
connection.setConnectTimeout(3000);
connection.setReadTimeout(SPRING_LOG_STREAMING_READ_TIMEOUT);
connection.setConnectTimeout(SPRING_LOG_STREAMING_CONNECT_TIMEOUT);
connection.setRequestMethod("GET");
connection.connect();
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
Expand Down

0 comments on commit c581da5

Please sign in to comment.