使用Spring Boot Actuator 2.2.x时,如果你使用fastjosn作为HttpMessageConverter。
访问web端,报Could not find acceptable representation,返回406 Not Acceptable。
需要添加支持的 mediaType:application/vnd.spring-boot.actuator.v3+json
注意:这个在不同版本的Spring Boot Actuator上会不一样,低版本的是需要加上 application/vnd.spring-boot.actuator.v2+json
。
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
FastJsonConfig fastJsonConfig = new FastJsonConfig();
fastJsonConfig.