我使用java DSL有以下Integration流程,我想将 requestPayloadType 添加为java.util.HashMap。 我怎么做? 我希望JSON输入自动识别为JSON而不是字节
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();
}
答案 0 :(得分:1)
你的问题不清楚。那里真的有那种方法:
Http.inboundChannelAdapter("/passenger")
.requestPayloadType(HashMap.class)