Skip to content

Long URL causes high memory allocation in WebClient calls #36605

@jeffreye

Description

@jeffreye

Hi team,

We are sending GET request with long urls (often longer than 200 characters due to various parameters)

Recently we tried to migrate it from apache http client to Webclient but found a performance hotspot in

public static String getRequestDescription(HttpMethod httpMethod, URI uri) {
if (StringUtils.hasText(uri.getQuery())) {
try {
uri = new URI(uri.getScheme(), null, uri.getHost(), uri.getPort(), uri.getPath(), null, null);
}
catch (URISyntaxException ignored) {
}
}
return httpMethod.name() + " " + uri;

This method is primarily used for debugging / logging

.checkpoint("Request to " +
WebClientUtils.getRequestDescription(request.method(), request.url()) +
" [DefaultWebClient]")

Could you help make a fix on them?

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: feedback-providedFeedback has been providedstatus: waiting-for-triageAn issue we've not yet triaged or decided on

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions