I\'m using a spring-webflux WebClient (build 20170502.221452-172) to access a Web application producing a stream of Entry objects (application/stream+json) like th
Configuring globally:
@Configuration
public class AppConfig {
private final ObjectMapper objectMapper;
@Autowired
public AppConfig(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
this.webClientBuilder = WebClient.builder()
.exchangeStrategies(exchangeStrategies());
}
private ExchangeStrategies exchangeStrategies() {
Jackson2JsonEncoder encoder = new Jackson2JsonEncoder(objectMapper);
Jackson2JsonDecoder decoder = new Jackson2JsonDecoder(objectMapper);
return ExchangeStrategies
.builder()
.codecs(configurer -> {
configurer.defaultCodecs().jackson2JsonEncoder(encoder);
configurer.defaultCodecs().jackson2JsonDecoder(decoder);
}).build();
}
}