Spring集成中的全局变量?

时间:2017-11-23 19:04:42

标签: spring spring-integration

我有一个transformer输出为http:outbound-gateway之一的输出,此outbound-gateway的输出通道是我activator的输出通道。我的要求是从Transformeractivator获取一些数据。

如下所示。

 <int:transformer ref="jsonToXmlTransformer" input-channel="replyChannel" output-channel="someObj"/>

 <http:outbound-gateway 
          request-channel="someObj"  
          expected-response-type="o.s.h.ResponseEntity"
          reply-channel="replyChannel"
          url="{someurl}"
          http-method="POST"
        extract-request-payload="true">
    </http:outbound-gateway>

<int:service-activator id="expressionConverter" input-channel="replyChannel" 
   ref="lastActivator"/>

不要专注于此配置。我的意思是,我在家里,尽我所能回忆起我作为办公室的配置。没有错。只是我没有从我的transformer到我的上一个activator获得我的预期数据。这只不过是应用程序流的终点。

1 个答案:

答案 0 :(得分:2)

考虑在标头中传输所需的数据。在出站网关之前将其添加到变压器之后的标题中,然后从激活器中获取它。