Skip to content

Align codec configuration in ExchangeStrategies.Builder and WebFluxConfigurer [SPR-15682] #20241

Closed
@spring-projects-issues

Description

@spring-projects-issues

Brian Clozel opened SPR-15682 and commented

While working on a Spring Boot issue regarding codecs configuration, I've noticed that the reactive server and client codec configurations don't provide the same API.

On the server side, we're dealing with a ServerCodecConfigurer:

WebFluxConfigurer.configureHttpMessageCodecs(ServerCodecConfigurer configurer)

The client configuration is dealt with ExchangeStrategies, which declares:

ExchangeStrategies.defaultCodecs(Consumer<ClientCodecConfigurer.ClientDefaultCodecs> consumer);

ExchangeStrategies.customCodecs(Consumer<CodecConfigurer.CustomCodecs> consumer);

Those methods provide extension points that aren't aligned with the server side.

To better align those configurations and allow code reuse in the infrastructure setup, I'd like to add the following (and remove the existing ones?):

// both ClientCodecConfigurer and ServerCodecConfigurer extend CodecConfigurer
ExchangeStrategies.codecs(Consumer<ClientCodecConfigurer> consumer)

Affects: 5.0 RC2

Reference URL: spring-projects/spring-boot#9166

Referenced from: commits 52148a1

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions