如何使用Java DSL将requestPayloadType参数设置为HashMap

时间:2017-06-02 01:38:43

标签: spring-integration dsl

我使用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();
}

1 个答案:

答案 0 :(得分:1)

你的问题不清楚。那里真的有那种方法:

Http.inboundChannelAdapter("/passenger")
                .requestPayloadType(HashMap.class)
相关问题