如何将requestPayloadType参数设置为使用Java DSL的HashMap
问题描述:
我有下面的使用java DSL的集成流程,我想将requestPayloadType添加为java.util.HashMap。 我该怎么做? 我想JSON输入被自动识别为JSON而不是字节如何将requestPayloadType参数设置为使用Java DSL的HashMap
public IntegrationFlow NotificationFlow() {
return IntegrationFlows
.from(Http.inboundChannelAdapter("/passenger")
.requestChannel(inputChannel())
.autoStartup(true)
.id("httpInnboundPass")
.requestMapping(r -> r.consumes("application/json"))
.**requestPayloadType**()
)
.enrichHeaders(hes -> hes.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE))
.channel("inputChannel")
.get();
}
答
你的问题不明确。那里真的有那种方法:
Http.inboundChannelAdapter("/passenger")
.requestPayloadType(HashMap.class)