【问题标题】:How can I create ws inbound-gateway with Java DSL in Spring integration?如何在 Spring 集成中使用 Java DSL 创建 ws inbound-gateway?
【发布时间】:2016-07-07 18:57:05
【问题描述】:

我有以下 ws 入站网关。如何使用 Spring Integration Java 8 DSL 进行此配置?

<int-ws:inbound-gateway id="ws-inbound-gateway"
                        request-channel="ws-request-channel"
                        reply-channel="ws-response-channel"
                        error-channel="ws-error-channel"/>

【问题讨论】:

    标签: java spring spring-integration


    【解决方案1】:

    很遗憾,我没有找到对这种入站网关的第一级支持,但是您可以按如下方式解决此问题:

    @Configuration
    @EnableIntegration
    public class IntegrationConfiguration {
    
        @Bean
        public SimpleWebServiceInboundGateway SimpleWebServiceInboundGateway() {
                SimpleWebServiceInboundGateway simpleWebServiceInboundGateway = new SimpleWebServiceInboundGateway();
                // your inbound configurtion
                .....
    
                return simpleWebServiceInboundGateway;
            }
    
        @Bean
        public IntegrationFlow integrationFlow(){
                return IntegrationFlows.from(SimpleWebServiceInboundGateway())
                // your pipeline
                .....
                        .get();
            }   
        }
    

    在你的 maven pom 中不要忘记这个依赖

    <dependency>
                <groupId>org.springframework.integration</groupId>
                <artifactId>spring-integration-java-dsl</artifactId>
                <version>1.1.2.RELEASE</version>
            </dependency>
    
            <dependency>
                <groupId>org.springframework.integration</groupId>
                <artifactId>spring-integration-ws</artifactId>
                <version>4.2.5.RELEASE</version>
            </dependency>
    

    希望对你有帮助

    【讨论】:

    • Valerio,您将如何以同样的方式配置出站 Web 服务通道?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多