Skip to content

Commit 7b48325

Browse files
authored
[#257] increase heart beat interval / print response (#258)
1 parent 19fea0d commit 7b48325

File tree

1 file changed

+8
-4
lines changed
  • spring-cloud-huawei-servicecomb-discovery/src/main/java/com/huaweicloud/servicecomb/discovery/client

1 file changed

+8
-4
lines changed

spring-cloud-huawei-servicecomb-discovery/src/main/java/com/huaweicloud/servicecomb/discovery/client/ServiceCombClient.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.huaweicloud.servicecomb.discovery.client.model.SchemaRequest;
2727
import com.huaweicloud.servicecomb.discovery.client.model.SchemaResponse;
2828
import com.huaweicloud.servicecomb.discovery.discovery.MicroserviceHandler;
29+
2930
import java.io.IOException;
3031
import java.net.URI;
3132
import java.net.URISyntaxException;
@@ -35,6 +36,7 @@
3536

3637
import java.util.Map;
3738
import java.util.stream.Collectors;
39+
3840
import org.apache.http.HttpStatus;
3941
import org.apache.http.client.utils.URIBuilder;
4042
import org.apache.http.entity.ByteArrayEntity;
@@ -44,6 +46,7 @@
4446
import org.slf4j.LoggerFactory;
4547
import org.springframework.cloud.client.DefaultServiceInstance;
4648
import org.springframework.cloud.client.ServiceInstance;
49+
4750
import com.huaweicloud.common.cache.RegisterCache;
4851
import com.huaweicloud.common.exception.RemoteOperationException;
4952
import com.huaweicloud.common.exception.RemoteServerUnavailableException;
@@ -62,6 +65,7 @@
6265

6366
import com.fasterxml.jackson.databind.ObjectMapper;
6467
import com.fasterxml.jackson.databind.SerializationFeature;
68+
6569
import org.springframework.util.StringUtils;
6670

6771

@@ -388,7 +392,7 @@ public MicroserviceInstanceSingleResponse getInstance(String serviceId, String i
388392
} else {
389393
throw new RemoteOperationException(
390394
"read response failed. status:" + response.getStatusCode() + "; message:" + response
391-
.getStatusMessage() + "; content:" + response.getContent());
395+
.getStatusMessage() + "; content:" + response.getContent());
392396
}
393397
} catch (URISyntaxException e) {
394398
throw new RemoteOperationException("build url failed.", e);
@@ -423,7 +427,7 @@ public HeardBeatStatus heartbeat(HeartbeatRequest heartbeatRequest) throws Servi
423427
throw new RemoteOperationException("build url failed.", e);
424428
} catch (IOException e) {
425429
toggle();
426-
throw new RemoteOperationException("read response failed. ", e);
430+
throw new RemoteOperationException("read response failed , msg: {} " + response, e);
427431
}
428432
}
429433

@@ -443,7 +447,7 @@ public boolean updateInstanceStatus(String serviceId, String instanceId, String
443447
}
444448
throw new RemoteOperationException(
445449
"update instance status failed. status:" + response.getStatusCode() + "; message:"
446-
+ response.getStatusMessage() + "; content:" + response.getContent());
450+
+ response.getStatusMessage() + "; content:" + response.getContent());
447451
} catch (URISyntaxException e) {
448452
throw new RemoteOperationException("build url failed.", e);
449453
}
@@ -461,7 +465,7 @@ public MicroserviceResponse getServices() throws ServiceCombException {
461465
} else {
462466
throw new RemoteOperationException(
463467
"read response failed. status:" + response.getStatusCode() + "; message:" + response
464-
.getStatusMessage() + "; content:" + response.getContent());
468+
.getStatusMessage() + "; content:" + response.getContent());
465469
}
466470
} catch (URISyntaxException e) {
467471
throw new RemoteOperationException("build url failed.", e);

0 commit comments

Comments
 (0)