I had included spring-cloud-bus:1.3.3-RELEASE in my project. But i found that the behavior of ObjectMapper was changed by comparing without using spring cloud bus.
I have a very simple case like below
public class TestDomain {
private String name;
private Date createTime;
}
@RestController
public class TestController {
@RequestMapping("/test")
public TestDomain test(){
TestDomain domain = new TestDomain();
domain.setName("Test");
domain.setCreateTime(new Date());
return domain;
}
}
and i traced the code, found that BusJacksonAutoConfiguration has created a bean BusJacksonMessageConverter, which changed some behavior of the global injected ObjectMapper
Actually, what i want is keep the ObjectMapper work as usual, how can i do that?
I tried to create a higher precedence AutoConfiguration by extending BusJacksonAutoConfiguration and override busJsonConverter() method, to create BusJacksonMessageConverter by passing a null parameter, but failed since the BusJacksonMessageConverter is unvisiable, so what's the suggested way to do that?
BTW,what's the purpose to set SerializationFeature.WRITE_DATES_AS_TIMESTAMPS as false?
I had included spring-cloud-bus:1.3.3-RELEASE in my project. But i found that the behavior of ObjectMapper was changed by comparing without using spring cloud bus.
I have a very simple case like below
When accessing http://localhost:8080/test, what i expect it should be
but i found after included spring cloud bus, the result looks like
and i traced the code, found that BusJacksonAutoConfiguration has created a bean BusJacksonMessageConverter, which changed some behavior of the global injected ObjectMapper
Actually, what i want is keep the ObjectMapper work as usual, how can i do that? I tried to create a higher precedence AutoConfiguration by extending BusJacksonAutoConfiguration and override busJsonConverter() method, to create BusJacksonMessageConverter by passing a null parameter, but failed since the BusJacksonMessageConverter is unvisiable, so what's the suggested way to do that?
BTW,what's the purpose to set SerializationFeature.WRITE_DATES_AS_TIMESTAMPS as false?