【发布时间】:2015-11-09 21:12:38
【问题描述】:
我正在努力做到以下几点:
创建两个 http 请求(getData 和 getMetadata),然后将结果合并到这样的负载中:{res1: getDataResult, res2: getMetadataResult} 然后将其传递到“resultChannel”。
<int:header-enricher input-channel="request" output-channel="getData">
<int:header name="prop" value="1"/>
</int:header-enricher>
<int-http:outbound-gateway
request-channel="getData"
url-expression="'https://x.y.z/{param1}'"
http-method="GET"
reply-channel="aggregate"
expected-response-type="java.util.HashMap"
request-factory="restFactory">
<int-http:uri-variable name="param1" expression="payload.param1"/>
</int-http:outbound-gateway>
<int-http:outbound-gateway
request-channel="getData"
url-expression="'https://x.y.z/{param2}'"
http-method="GET"
reply-channel="aggregate"
expected-response-type="java.util.HashMap"
request-factory="restFactory">
<int-http:uri-variable name="param2" expression="payload.param2"/>
</int-http:outbound-gateway>
<int:aggregator
release-strategy-expression="size() == 2"
input-channel="aggregate"
output-channel="resultChannel"
correlation-strategy-expression="headers['prop']"
expire-groups-upon-completion="true">
</int:aggregator>
<!---->
<int:channel id="resultChannel" />
作为输入,我有一个有效负载,其中包含必须用于请求的 param1 和 param2。
【问题讨论】:
-
帮助