【发布时间】:2017-08-03 13:53:01
【问题描述】:
我是 Spring Integration 新手,我必须从 3rd 方 Web 服务获取在线代理列表,我尝试配置 Spring Integration 来获取它,但对于 channel 部分,我不太确定如何配置它.
我的原始配置如下,我从用于向 3rd 方 Web 服务发送请求的示例中复制:
public interface WebServiceGateway {
@Gateway(requestChannel = "getStatusChannel")
public String getStatus(String var); <------ being forced to send something
}
在我的集成配置中,
@Configuration
public class IntegrationConfiguration {
@Bean
public MessageChannel getStatusChannel() {
return MessageChannels.direct().get();
}
}
问题是,我没有向网络服务发送任何参数,在requestChannel 它迫使我这样做,所以我修改了gateway 部分:
public interface WebServiceGateway {
@Gateway(replyChannel = "getStatusChannel")
public String getStatus();
}
这部分保持不变:
@Configuration
public class IntegrationConfiguration {
@Bean
public MessageChannel getStatusChannel() {
return MessageChannels.direct().get();
}
}
提示我java.lang.IllegalStateException: receive is not supported, because no pollable reply channel has been configured,为什么我不能使用MessageChannel作为回复频道?我应该如何配置IntegrationConfiguration?
【问题讨论】:
标签: java spring web-services spring-integration-dsl