Spring Integration with Jackson ObjectMapper and Java 8 Time (JSR-310)

倖福魔咒の 提交于 2019-12-02 01:08:18

There is nothing to do with the Spring Boot on the matter to force Spring Integration to use that.

You just need to configure JsonToObjectTransformer with that your jsonObjetMapper():

@Bean
@Transformer(inputChannel="input", outputChannel="output")
JsonToObjectTransformer jsonToObjectTransformer() {
    return new JsonToObjectTransformer(jsonObjectMapper());
}

Although there is no reason to register JsonObjectMapper as a bean.

Have you defined an encoder to your channel adapter?

You should always use an encoder for whichever adapter you're using, inbound channel adapter or message drive channel adapter.

In your case StringEncoder should solve the problem.

<bean id="myEncoder" class="org.springframework.integration.kafka.serializer.common.StringEncoder"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!