Reputation: 1331
I have the following http outbound gateway. How can I do this configuration with Java Config or Spring DSL?
<int-http:outbound-gateway id="test"
url="http://localhost:8080/"
http-method="POST"
charset="UTF-8"
header-mapper="soapHeaderMapper"
request-factory="requestFactory"
request-channel="inputChannel"/>
Upvotes: 7
Views: 2680
Reputation: 174769
@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();
}
Or
@ServiceActivator(inputChannel="inputChannel")
@Bean(name="test")
public MessageHandler httpout() {
HttpRequestExecutingMessageHandler handler = new ...
...
return handler;
}
Upvotes: 11