2017-06-02 53 views
0

我有下面的使用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(); 
} 

回答

1

你的問題不明確。那裏真的有那種方法:

Http.inboundChannelAdapter("/passenger") 
       .requestPayloadType(HashMap.class) 
相關問題