You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mule 4中attributes.maskedRequestPath的预期值咨询

关于maskedRequestPath值的确认

在你给出的配置场景下,转换输出中的maskedRequestPath值为null。

原因说明

maskedRequestPath的作用是返回请求路径中超出HTTP Listener配置的path前缀之外的剩余部分。只有当Listener显式配置了path属性时,这个字段才会有有效值:

  • 比如如果Listener配置的path为/hello,请求地址为http://localhost:8081/hello/world?abc=def,那么maskedRequestPath的值会是/world。

而你当前的HTTP Listener配置没有指定path属性(默认监听根路径,但无匹配的前缀需要剥离),因此maskedRequestPath没有对应的剩余路径内容,最终返回null,而非"/"。

参考配置与脚本

HTTP Listener配置

<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="dc9" >
    <http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>

DataWeave转换脚本

%dw 2.0
output application/json
---
{
    "maskedRequestPath": attributes.maskedRequestPath
}

内容的提问来源于stack exchange,提问作者Pierre

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 05:32:37