Skip to content

Support dynamic default uri variables for RestClient #34189

@quaff

Description

@quaff

It would be nice that defaultUriVariables() could accept Supplier/Function as value of Map.

MDC.put("partition", "p0"); // value is variable per request

Map<String, ?> defaultUriVariables = Map.of(
//		"partition", (Supplier<String>) () -> MDC.get("partition"),
		"partition", (Function<String, String>) MDC::get
);
RestClient restClient = RestClient.builder().baseUrl("http://{partition}.example.com").defaultUriVariables(defaultUriVariables).build();

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions