Skip to content

Commit

Permalink
fix: fix log feign response stream close bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanyouYu-Sean authored and SkyeBeFreeman committed Mar 15, 2023
1 parent e726735 commit 68264d9
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Spring Cloud Tencent 所有组件都已上传到 Maven 中央仓库,只需要
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-dependencies</artifactId>
<!--version number-->
<version>1.10.0-2022.0.1</version>
<version>1.10.1-2022.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ For example:
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-dependencies</artifactId>
<!--version number-->
<version>1.10.0-2022.0.1</version>
<version>1.10.1-2022.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

<properties>
<!-- Project revision -->
<revision>1.10.0-2022.0.1</revision>
<revision>1.10.1-2022.0.1</revision>

<!-- Spring Framework -->
<spring.framework.version>6.0.5</spring.framework.version>
Expand Down
2 changes: 1 addition & 1 deletion spring-cloud-tencent-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</developers>

<properties>
<revision>1.10.0-2022.0.1</revision>
<revision>1.10.1-2022.0.1</revision>

<!-- Dependencies -->
<polaris.version>1.11.1</polaris.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void run(EnhancedFeignContext context) {
if (exception instanceof SocketTimeoutException) {
retStatus = RetStatus.RetTimeout;
}
LOG.debug("Will report result of {}. Request=[{}]. Response=[{}].", retStatus.name(), request, response);
LOG.debug("Will report result of {}. Request=[{} {}]. Response=[{}].", retStatus.name(), request.httpMethod().name(), request.url(), response.status());
ServiceCallResult resultRequest = ReporterUtils.createServiceCallResult(request, retStatus);
consumerAPI.updateServiceCallResult(resultRequest);
// update result without method for service circuit break.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void run(EnhancedFeignContext context) {
if (apply(HttpStatus.resolve(response.status()))) {
retStatus = RetStatus.RetFail;
}
LOG.debug("Will report result of {}. Request=[{}]. Response=[{}].", retStatus.name(), request, response);
LOG.debug("Will report result of {}. Request=[{} {}]. Response=[{}].", retStatus.name(), request.httpMethod().name(), request.url(), response.status());
ServiceCallResult resultRequest = ReporterUtils.createServiceCallResult(request, retStatus);
consumerAPI.updateServiceCallResult(resultRequest);
// update result without method for service circuit break.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package com.tencent.cloud.rpc.enhancement.feign.plugin.reporter;

import java.util.HashMap;

import com.tencent.cloud.rpc.enhancement.config.RpcEnhancementReporterProperties;
import com.tencent.cloud.rpc.enhancement.feign.plugin.EnhancedFeignContext;
import com.tencent.cloud.rpc.enhancement.feign.plugin.EnhancedFeignPluginType;
Expand Down Expand Up @@ -83,7 +85,7 @@ public void testType() {
@Test
public void testRun() {
// mock request
Request request = mock(Request.class);
Request request = Request.create(Request.HttpMethod.GET, "/", new HashMap<>(), null, null, null);
// mock response
Response response = mock(Response.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package com.tencent.cloud.rpc.enhancement.feign.plugin.reporter;

import java.util.HashMap;

import com.tencent.cloud.rpc.enhancement.config.RpcEnhancementReporterProperties;
import com.tencent.cloud.rpc.enhancement.feign.plugin.EnhancedFeignContext;
import com.tencent.cloud.rpc.enhancement.feign.plugin.EnhancedFeignPluginType;
Expand Down Expand Up @@ -83,7 +85,7 @@ public void testType() {
@Test
public void testRun() {
// mock request
Request request = mock(Request.class);
Request request = Request.create(Request.HttpMethod.GET, "/", new HashMap<>(), null, null, null);
// mock response
Response response = mock(Response.class);
doReturn(502).when(response).status();
Expand Down

0 comments on commit 68264d9

Please sign in to comment.