简体   繁体   English

如何在Spring集成中使用JAVA配置创建http outbound-gateway?

[英]How can I create http outbound-gateway with JAVA config in Spring integration?

I have the following http outbound gateway. 我有以下http出站网关。 How can I do this configuration with Java Config or Spring DSL? 如何使用Java Config或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"/>
@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;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring Integration Java DSL - 如何调用int-http:outbound-gateway? - Spring Integration Java DSL - How to invoke int-http:outbound-gateway? Spring Integration http出站网关和UTF-8 - Spring Integration http outbound-gateway and UTF-8 Spring Integration单元测试http:outbound-gateway - Spring Integration unit test http:outbound-gateway Spring Integration-网址变量在http:outbound-gateway中不起作用 - Spring Integration - url-variable not working in http:outbound-gateway Spring Integration http:outbound-gateway“没有合适的HttpMessageConverter” - Spring Integration http:outbound-gateway “no suitable HttpMessageConverter” Spring Integration:如何使用http:outbound-gateway将字节数组作为POST参数发送? - Spring Integration: how to send a Byte Array as POST parameter with an http:outbound-gateway? 在int-ws:outbound-gateway上通过Spring集成处理Http错误 - Handle Http errors with spring integration on int-ws:outbound-gateway Spring Integration通过出站网关递归获取FTP文件 - Spring Integration get FTP files recursively with outbound-gateway Spring集成出站网关想像动态一样使用URL - Spring integration outbound-gateway want to use URL as dynamic like Spring Integration Java DSL - Http Outbound Gateway uri 变量表达式 - Spring Integration Java DSL - Http Outbound Gateway uri variable Expression
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM