在引入springcloud-alibaba-sentinel时返回值变成了xml格式的。需要在依赖中排除。
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</exclusion>
</exclusions>
</dependency>
网上很多说排除Eureka客户端的尝试了没有用。只有在alibaba依赖中排除才有效。