简体   繁体   中英

How can I create ws inbound-gateway with Java DSL in Spring integration?

I have the following ws inbound gateway. How can I do this configuration with 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"/>

Unfortunally I don't find a first level support for this kind of inbound gateway, however you can fix this as below:

@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();
        }   
    }

in your maven pom don't forget this dependency

<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>

I hope that this can help you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM