我有以下http出站网关.如何使用Java Config或Spring DSL进行此配置?
url="http://localhost:8080/"
http-method="POST"
charset="UTF-8"
header-mapper="soapHeaderMapper"
request-factory="requestFactory"
request-channel="inputChannel"/>
解决方法:
@Bean
public IntegrationFlow httpOut() {
return IntegrationFlows.from("inputChannel")
.handle(Http.outboundGateway("http://localhost:8080/")
.charset("UTF-8")
.httpMethod(HttpMethod.POST)
.headerMapper(soapHeaderMapper())
.requestFactory(requestFactory()), e -> e.id("test"))
.get();
}
要么
@ServiceActivator(inputChannel="inputChannel")
@Bean(name="test")
public MessageHandler httpout() {
HttpRequestExecutingMessageHandler handler = new ...
...
return handler;
}
标签:java,spring,spring-integration
来源: https://codeday.me/bug/20190528/1167368.html