2017-08-22 95 views
1

我试图把HTTP:出站网关成链,但在运行时遇到异常,我知道我可以把HTTP出站网关到链是否可以将HTTP出站网关放入链中?

Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: The 'request-channel' attribute isn't allowed for a nested (e.g. inside a <chain/>) endpoint element: 'http:outbound-gateway'. 

,但是当我删除属性的要求,通道', IDE告诉我这是一个强制性属性。

这里是我的配置:

<int:chain input-channel="requestChannel" 
      output-channel="requestChannel2"> 
    <http:outbound-gateway request-channel="requestChannel2" expected-response-type="java.lang.String" 
          url="http://localhost:8080/postService/postwithparm" 
          http-method="POST" 
          extract-request-payload="true"> 
    </http:outbound-gateway> 
</int:chain> 

回答

1

request-channel是针对网关的输入。但是由于它已经是连接通道适配器的组件,我们无法通过自己的渠道实现这一点。

所以,没有request-channel的路是正确的。这只是你的IDE不支持正确的行为。

相关问题