gpt4 book ai didi

java - 如何在 Spring 集成中使用 Java DSL 创建 ws 入站网关?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:06:28 28 4
gpt4 key购买 nike

我有以下 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"/>

最佳答案

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

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

希望对你有帮助

关于java - 如何在 Spring 集成中使用 Java DSL 创建 ws 入站网关?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36128121/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com