我是 Mule 的新手,这就是我想要做的。1) 调用出站休息服务 A 2) 循环遍历结果并调用休息服务 B 3) 汇总来自服务 B 的结果并返回有效负载。这是我想出的,但这个流程是从服务 A 返回结果。如何忽略来自 A 的结果并从 B 返回聚合结果?我在 for 循环中添加了记录器,可以看到 B 的响应,但不确定如何将结果返回给用户?我需要自定义聚合器吗?
<flow name="test1Flow1" doc:name="test1Flow1">
<http:inbound-endpoint exchange-pattern="request-response" doc:name="HTTP1" address="http://localhost:8082"/>
<copy-properties propertyName="*" doc:name="Property"/>
<http:outbound-endpoint doc:name="HTTP2" followRedirects="true" address="http://abcd/catalog/#[message.inboundProperties['http.relative.path']]?#[message.inboundProperties['http.query.string']]" contentType="text/xml"/>
<foreach doc:name="For Each" collection="#[xpath('//mc:assets/mc:asset')]">
<http:outbound-endpoint doc:name="HTTP3" address="http://abcd#[xpath:@href]" contentType="text/xml" method="GET"/>
<collection-aggregator failOnTimeout="true" doc:name="Collection Aggregator"/>
</foreach>
</flow>
感谢任何帮助!