Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebClientConfigurer "drops" ObjectMapper customizations from WebClients #1134

Closed
totof3110 opened this issue Nov 30, 2019 · 3 comments
Closed
Assignees
Labels
in: client-side Only affects client-side in: configuration Configuration and setup stack: webflux type: bug
Milestone

Comments

@totof3110
Copy link

This is related to spring-projects/spring-framework#23961 (comment).

WebClientConfigurer configures the WebClients with the following line:

webClient.mutate().exchangeStrategies(hypermediaExchangeStrategies()).build()

which ends up overriding the WebClient custom configuration (in my case, the configuration of several Jackson Modules as well as my maxInMemorySize setting).

@bclozel added some logic in spring-projects/spring-framework@43e047c that should make it easier for HATEOAS to configure the WebClients without overriding existing config.

@odrotbohm
Copy link
Member

Looks like there's a few rough edges around the fix for spring-projects/spring-framework#24106 which means it doesn't make it into the next immediate Spring Framework release.

@odrotbohm
Copy link
Member

Update: looks like Spring Framework team is revisiting. I'll keep this on the radar for 1.0.2 as well.

@odrotbohm odrotbohm added in: configuration Configuration and setup type: bug labels Dec 2, 2019
@odrotbohm odrotbohm added in: client-side Only affects client-side stack: webflux labels Dec 2, 2019
odrotbohm added a commit that referenced this issue Dec 2, 2019
…ebClient.

We now use the API introduced in Spring Framework 5.2.2 to customize a WebClient to add hypermedia related en- and decoders without dropping customizations potentially made to the WebClient instance.
@bclozel
Copy link
Member

bclozel commented Dec 2, 2019

Note that the maxInMemorySize codec preference is configured only on the default codecs, and Spring HATEOAS is registering a custom codec. Spring Framework does not enforce that cofiguration on custom codecs as they may have different opinions.

We've provided still a way for custom codecs to know about such preferences, see spring-projects/spring-framework#24118. @odrotbohm , maybe additional changes need to be made to this configuration?

odrotbohm added a commit that referenced this issue Dec 3, 2019
…rer.

We now use new API introduced in Spring Framework 5.2.2 to forward the global configuration settings into the hypermedia decoders we register.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: client-side Only affects client-side in: configuration Configuration and setup stack: webflux type: bug
Projects
None yet
Development

No branches or pull requests

3 participants