question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apply codecs auto-configuration to webflux server and webclient

See original GitHub issue

For Spring MVC, the HttpMessageConvertersAutoConfiguration configures the appropriate message converters for the server and the client (RestTemplate).

We should do the same for WebFlux, using ServerCodecConfigurer and ClientCodecConfigurer.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alimatecommented, Jun 16, 2017

Probably the same issue

0reactions
bjornharvoldcommented, Mar 20, 2018

Hi @bclozel

I did what I saw in the other ticket that started this and added:

@Bean
    Jackson2JsonEncoder jackson2JsonEncoder() {
        return new Jackson2JsonEncoder(objectMapper());
    }

    @Bean
    Jackson2JsonDecoder jackson2JsonDecoder() {
        return new Jackson2JsonDecoder(objectMapper());
    }

    @Bean
    WebFluxConfigurer webFluxConfigurer(Jackson2JsonEncoder encoder, Jackson2JsonDecoder decoder) {
        return new WebFluxConfigurer() {
            @Override
            public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
                configurer.defaultCodecs().jackson2JsonEncoder(encoder);
                configurer.defaultCodecs().jackson2JsonDecoder(decoder);
            }
        };
    }

to my mock setup.

Read more comments on GitHub >

github_iconTop Results From Across the Web

34. Calling REST Services with 'WebClient' - Spring
Finally, you can fall back to the original API and use WebClient.create() . In that case, no auto-configuration or WebClientCustomizer is applied.
Read more >
Reactive WebClient - Medium
Spring WebFlux provides the reactive WebClient to make asynchronous api calls. It is fully non-blocking. Things I like about WebClient is it integrates...
Read more >
Spring Boot WebClient Example (2022) - TechGeekNext
In this tutorial, we'll create spring boot application with WebClient for communication between two services. We will utilize our previous example Spring Boot ......
Read more >
Spring Boot - ObjectMapper - Gitter
2) Can you use any other customization method described in ... /java/org/springframework/boot/autoconfigure/http/codec/CodecsAutoConfiguration.java#L58-L66.
Read more >
No qualifying bean of type 'org.springframework.boot.web ...
This behavior has been chosen because many Spring developers add spring-boot-starter-webflux to their Spring MVC application to use the reactive ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found