Skip to content

Commit ab76ec7

Browse files
committed
Apply workaround to enforce Jackson 2 decoder/ encoder use with WebClient. Remove unnecessary classpath exclusions.
Signed-off-by: Olga Maciaszek-Sharma <olga.maciaszek-sharma@broadcom.com>
1 parent 00ade3f commit ab76ec7

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

spring-cloud-netflix-eureka-client-tls-tests/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@
6666
<dependency>
6767
<groupId>org.springframework.boot</groupId>
6868
<artifactId>spring-boot-starter-actuator</artifactId>
69-
<exclusions>
70-
<exclusion>
71-
<groupId>tools.jackson.core</groupId>
72-
<artifactId>jackson-databind</artifactId>
73-
</exclusion>
74-
</exclusions>
7569
<optional>true</optional>
7670
</dependency>
7771
<dependency>

spring-cloud-netflix-eureka-client/pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,10 @@
4242
<groupId>org.springframework.boot</groupId>
4343
<artifactId>spring-boot-starter-actuator</artifactId>
4444
<optional>true</optional>
45-
<exclusions>
46-
<exclusion>
47-
<groupId>tools.jackson.core</groupId>
48-
<artifactId>jackson-databind</artifactId>
49-
</exclusion>
50-
</exclusions>
5145
</dependency>
5246
<dependency>
5347
<groupId>org.springframework.boot</groupId>
5448
<artifactId>spring-boot-starter-webflux</artifactId>
55-
<exclusions>
56-
<exclusion>
57-
<groupId>tools.jackson.core</groupId>
58-
<artifactId>jackson-databind</artifactId>
59-
</exclusion>
60-
</exclusions>
6149
<optional>true</optional>
6250
</dependency>
6351
<dependency>

spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/WebClientTransportClientFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
* @author Haytham Mohamed
4949
* @author Armin Krezovic
5050
* @author Wonchul Heo
51+
* @author Olga Maciaszek-Sharma
5152
*/
5253
public class WebClientTransportClientFactory implements TransportClientFactory {
5354

@@ -81,6 +82,8 @@ private void setCodecs(WebClient.Builder builder) {
8182
ObjectMapper objectMapper = objectMapper();
8283
builder.codecs(configurer -> {
8384
ClientCodecConfigurer.ClientDefaultCodecs defaults = configurer.defaultCodecs();
85+
defaults.jacksonJsonDecoder(new Jackson2JsonDecoder(objectMapper, MediaType.APPLICATION_JSON));
86+
defaults.jacksonJsonEncoder(new Jackson2JsonEncoder(objectMapper, MediaType.APPLICATION_JSON));
8487
defaults.jackson2JsonEncoder(new Jackson2JsonEncoder(objectMapper, MediaType.APPLICATION_JSON));
8588
defaults.jackson2JsonDecoder(new Jackson2JsonDecoder(objectMapper, MediaType.APPLICATION_JSON));
8689

0 commit comments

Comments
 (0)