-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix EurekaConfigServerBootstrapConfiguration.
- Loading branch information
1 parent
f27b48b
commit 10e1edf
Showing
9 changed files
with
239 additions
and
145 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...t/src/main/java/org/springframework/cloud/netflix/eureka/RestClientTimeoutProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.springframework.cloud.netflix.eureka; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
/** | ||
* @author Olga Maciaszek-Sharma | ||
*/ | ||
@ConfigurationProperties("eureka.client.restclient.timeout") | ||
public class RestClientTimeoutProperties extends TimeoutProperties { | ||
|
||
@Override | ||
public String toString() { | ||
return "RestClientTimeoutProperties{" + ", connectTimeout=" + connectTimeout + ", connectRequestTimeout=" | ||
+ connectRequestTimeout + ", socketTimeout=" + socketTimeout + '}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...reka-client/src/main/java/org/springframework/cloud/netflix/eureka/TimeoutProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package org.springframework.cloud.netflix.eureka; | ||
|
||
import java.util.Objects; | ||
|
||
import org.apache.hc.client5.http.config.RequestConfig; | ||
import org.apache.hc.core5.http.io.SocketConfig; | ||
|
||
/** | ||
* @author Olga Maciaszek-Sharma | ||
*/ | ||
public class TimeoutProperties { | ||
|
||
|
||
/** | ||
* Default values are set to 180000, in keeping with {@link RequestConfig} and | ||
* {@link SocketConfig} defaults. | ||
*/ | ||
protected int connectTimeout = 180000; // 3 * MINUTES | ||
|
||
protected int connectRequestTimeout = 180000; // 3 * MINUTES | ||
|
||
protected int socketTimeout = 180000; // 3 * MINUTES | ||
|
||
public int getConnectTimeout() { | ||
return connectTimeout; | ||
} | ||
|
||
public int getConnectRequestTimeout() { | ||
return connectRequestTimeout; | ||
} | ||
|
||
public int getSocketTimeout() { | ||
return socketTimeout; | ||
} | ||
|
||
public void setConnectTimeout(int connectTimeout) { | ||
this.connectTimeout = connectTimeout; | ||
} | ||
|
||
public void setConnectRequestTimeout(int connectRequestTimeout) { | ||
this.connectRequestTimeout = connectRequestTimeout; | ||
} | ||
|
||
public void setSocketTimeout(int socketTimeout) { | ||
this.socketTimeout = socketTimeout; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
RestTemplateTimeoutProperties that = (RestTemplateTimeoutProperties) o; | ||
|
||
return connectTimeout == that.connectTimeout && connectRequestTimeout == that.connectRequestTimeout | ||
&& socketTimeout == that.socketTimeout; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(connectTimeout, connectRequestTimeout, socketTimeout); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.