Skip to content

Commit

Permalink
[revert]revert changes for old version (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
liubao68 authored Apr 14, 2023
1 parent 2069022 commit 05188ec
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import spring-framework-bom. No need configure spring version. -->
<spring-cloud.version>Greenwich.SR6</spring-cloud.version>
<spring-boot.version>2.1.6.RELEASE</spring-boot.version>
<servicecomb.version>2.7.4</servicecomb.version>
<servicecomb.version>2.5.1</servicecomb.version>
</properties>

<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static AddressManager createAddressManager(DiscoveryBootstrapProperties d
addresses = URLUtil.dealMultiUrl(discoveryProperties.getAddress());
}
LOGGER.info("initialize discovery server={}", addresses.toString());
return new AddressManager("default", addresses, EventManager.getEventBus());
return new AddressManager("default", addresses);
}

// add other headers needed for registration by new ServiceCenterClient(...)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class DiscoveryBootstrapProperties {
private boolean healthCheck = true;


private int healthCheckInterval = 15;
private int healthCheckInterval = 15000;

private int healthCheckRequestTimeout = 5000;

Expand All @@ -70,10 +70,6 @@ public class DiscoveryBootstrapProperties {

private DataCenterInfo datacenter;

private static final int HEALTH_CHECK_MAX_INTERVAL = 600;

private static final int HEALTH_CHECK_MIN_INTERVAL = 1;

public String getServerAddress() {
return serverAddress;
}
Expand Down Expand Up @@ -175,9 +171,7 @@ public int getHealthCheckInterval() {
}

public void setHealthCheckInterval(int healthCheckInterval) {
if (healthCheckInterval <= HEALTH_CHECK_MAX_INTERVAL && healthCheckInterval >= HEALTH_CHECK_MIN_INTERVAL) {
this.healthCheckInterval = healthCheckInterval;
}
this.healthCheckInterval = healthCheckInterval;
}

public int getHealthCheckRequestTimeout() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private AddressManager configCenterAddressManager(ServiceCombConfigProperties co
}
LOGGER
.info("initialize config server type={}, address={}.", configProperties.getServerType(), addresses.toString());
return new AddressManager(serviceCombAkSkProperties.getProject(), addresses, EventManager.getEventBus());
return new AddressManager(serviceCombAkSkProperties.getProject(), addresses);
}

private HttpTransport createHttpTransport(boolean sslEnabled,
Expand Down Expand Up @@ -158,7 +158,7 @@ private void initServiceCenterConfig(ServiceCombConfigProperties configPropertie
}

private KieAddressManager createKieAddressManager(List<String> addresses) {
return new KieAddressManager(addresses, EventManager.getEventBus());
return new KieAddressManager(addresses);
}

private KieAddressManager configKieAddressManager(ServiceCombConfigProperties configProperties) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -90,7 +89,7 @@ public void register(ServiceCombRegistration registration) {
EventManager.getEventBus().register(this);
serviceCenterRegistration.setMicroservice(registration.getMicroservice());
serviceCenterRegistration.setMicroserviceInstance(registration.getMicroserviceInstance());
serviceCenterRegistration.setHeartBeatInterval(TimeUnit.SECONDS.toMillis(discoveryBootstrapProperties.getHealthCheckInterval()));
serviceCenterRegistration.setHeartBeatInterval(discoveryBootstrapProperties.getHealthCheckInterval());
serviceCenterRegistration.setHeartBeatRequestTimeout(discoveryBootstrapProperties.getHealthCheckRequestTimeout());

addSchemaInfo(registration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@ protected String extractStatusCode(Object response) {
}
return String.valueOf(status);
}

@Override
public Class<? extends Throwable>[] retryExceptions() {
return new Class[] {
HttpServerErrorException.class
};
}
}

0 comments on commit 05188ec

Please sign in to comment.