For the Spring org.springframework.web.client.RestTemplate, it was relatively easy to define an own HttpMessageConverter:
/**
* Set the message body converters to use.
* <p>These converters are used to convert from and to HTTP requests and responses.
*/
public void setMessageConverters(List<HttpMessageConverter<?>> messageConverters) {
validateConverters(messageConverters);
// Take getMessageConverters() List as-is when passed in here
if (this.messageConverters != messageConverters) {
this.messageConverters.clear();
this.messageConverters.addAll(messageConverters);
}
}
When converting my client to an reactive WebClient, I did not find a suitable way to define my own message converter as before with the RestTemplate.
Background: Our spring boot project is based on Scala and we use our own converter (based on com.fasterxml.jackson.module.scala.JacksonModule) to process Scala Case classes.