Spring-framework: DefaultClientResponseBuilder empty logPrefix when creating a DefaultClientResponse based on another

Created on 13 May 2020  路  1Comment  路  Source: spring-projects/spring-framework

Affects: 5.2.6.RELEASE

The current implementation of DefaultClientResponseBuilder doesn't allow a logPrefix to be specified for the DefaultClientResponse that is being builded, neither transfer the logPrefix when an instance is builded from another DefaultClientResponse.

This is a problem for spring-cloud-sleuth, that wraps and mutates DefaultClientResponses, and doing so, the logPrefix is replaced by an empty string on the new instance.

I also opened an issue on the spring-cloud-sleuth project, that explains the use case and contains a project that simulates the problem: https://github.com/spring-cloud/spring-cloud-sleuth/issues/1591

web bug

Most helpful comment

The logPrefix() on ClientResponse was added relatively recently in 09b6730f3d89b55819ea9bea66314269b7cc4fd9 and indeed it should be copied.

>All comments

The logPrefix() on ClientResponse was added relatively recently in 09b6730f3d89b55819ea9bea66314269b7cc4fd9 and indeed it should be copied.

Was this page helpful?
0 / 5 - 0 ratings