Skip to content

Commit

Permalink
[#257] increase heart beat interval / print response (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoYL123 authored Sep 18, 2020
1 parent 19fea0d commit 7b48325
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.huaweicloud.servicecomb.discovery.client.model.SchemaRequest;
import com.huaweicloud.servicecomb.discovery.client.model.SchemaResponse;
import com.huaweicloud.servicecomb.discovery.discovery.MicroserviceHandler;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
Expand All @@ -35,6 +36,7 @@

import java.util.Map;
import java.util.stream.Collectors;

import org.apache.http.HttpStatus;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.ByteArrayEntity;
Expand All @@ -44,6 +46,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.cloud.client.DefaultServiceInstance;
import org.springframework.cloud.client.ServiceInstance;

import com.huaweicloud.common.cache.RegisterCache;
import com.huaweicloud.common.exception.RemoteOperationException;
import com.huaweicloud.common.exception.RemoteServerUnavailableException;
Expand All @@ -62,6 +65,7 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;

import org.springframework.util.StringUtils;


Expand Down Expand Up @@ -388,7 +392,7 @@ public MicroserviceInstanceSingleResponse getInstance(String serviceId, String i
} else {
throw new RemoteOperationException(
"read response failed. status:" + response.getStatusCode() + "; message:" + response
.getStatusMessage() + "; content:" + response.getContent());
.getStatusMessage() + "; content:" + response.getContent());
}
} catch (URISyntaxException e) {
throw new RemoteOperationException("build url failed.", e);
Expand Down Expand Up @@ -423,7 +427,7 @@ public HeardBeatStatus heartbeat(HeartbeatRequest heartbeatRequest) throws Servi
throw new RemoteOperationException("build url failed.", e);
} catch (IOException e) {
toggle();
throw new RemoteOperationException("read response failed. ", e);
throw new RemoteOperationException("read response failed , msg: {} " + response, e);
}
}

Expand All @@ -443,7 +447,7 @@ public boolean updateInstanceStatus(String serviceId, String instanceId, String
}
throw new RemoteOperationException(
"update instance status failed. status:" + response.getStatusCode() + "; message:"
+ response.getStatusMessage() + "; content:" + response.getContent());
+ response.getStatusMessage() + "; content:" + response.getContent());
} catch (URISyntaxException e) {
throw new RemoteOperationException("build url failed.", e);
}
Expand All @@ -461,7 +465,7 @@ public MicroserviceResponse getServices() throws ServiceCombException {
} else {
throw new RemoteOperationException(
"read response failed. status:" + response.getStatusCode() + "; message:" + response
.getStatusMessage() + "; content:" + response.getContent());
.getStatusMessage() + "; content:" + response.getContent());
}
} catch (URISyntaxException e) {
throw new RemoteOperationException("build url failed.", e);
Expand Down

0 comments on commit 7b48325

Please sign in to comment.