【问题标题】:Calling a HTTP endpoint before calling APIKit router在调用 APIKit 路由器之前调用 HTTP 端点
【发布时间】:2017-01-10 04:57:14
【问题描述】:

我在消息到达 apikit:router 之前调用了一个 HTTP 端点。

当消息到达 apikit:router 时,它已经丢失了所有原始 HTTP 标头。因此,路由器无法找出预期的方法。

实际上,我可以在会话变量中复制入站属性,在 HTTP 调用之后,我可以将它们恢复为出站属性。然后我将我的 api 路由器放在另一个流中,因此出站属性再次被转换为入站属性。此解决方案工作正常,但流程看起来很丑陋。 (因为我必须为大约 10 个标题做这个副本)

有没有更好的解决方法?我也试图避免手动处理这些标题。

【问题讨论】:

    标签: mule mule-studio mule-component anypoint-studio


    【解决方案1】:

    将 HTTP 调用包装在 enricher 中,它将保留 http 入站属性和原始调用的负载。像这样,

    <enricher target="#[flowVars.resultOfInnerHTTP] source="#[payload]">
      <http:request...../>
    </enricher>
    <apikit:router.../>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-16
      • 1970-01-01
      • 1970-01-01
      • 2016-09-13
      • 1970-01-01
      • 2020-12-24
      相关资源
      最近更新 更多