从出站HTTP调用中删除MULE_SESSION标头

时间:2014-03-04 21:42:46

标签: mule mule-studio

我想从传出的HTTP请求中删除特定于mule的标头。我在HTTP调用中放置了以下transfomer。

<message-properties-transformer
            doc:name="Message Properties">
            <add-message-property key="Authorization" value="ffffffffff" />
            <add-message-property key="Content-Type" value="application/json" />
            <add-message-property key="Accept" value="application/json" />
            <delete-message-property key="MULE_ENCODING" />
            <delete-message-property key="MULE_SESSION" />
            <delete-message-property key="MULE_ENDPOINT" /> 
</message-properties-transformer>

但是,以下属性仍然以http标头 -

出现
{
MULE_SESSION=rO0ABXNyACNvcmcubXVsZS5zZXNzaW9uLkRlZmF1bHRNdWxlU2Vzc2lvbi7rdtEW7GGKAwAFWgAFdmFsaWRMAA1mbG93Q29uc3RydWN0dAAmTG9yZy9tdWxlL2FwaS9jb25zdHJ1Y3QvRmxvd0NvbnN0ceterteXZhL2xhbmcvU3RyaW5nO0wACnByb3BlcnRpZXN0AA9MamF2YS91dGlgdfgdfgdfg3JnL211bGUvYXBpL3NlY3VyaXR5L1NlY3VyaXR5Q29udGV4dDt4cAFwdAAkZDU3MWU5YmEtYTNlNC0xMWUzLWIxMjEtYmJlMWRiMDBjNTE1c3IAJWphdmEudXRpbC5Db2xsZWN0aW9ucyRTeW5jaHJvbml6ZWRNYXAbc/kJS0s5ewMAAkwAAW1xAH4AA0wABW11dGV4dAASTGphdmEvbGFuZy9PYmplY3Q7eHBzcgAkb3JnLm11bGUudXRpbC5DYXretertretreIYXNoTWFwndHZ72dFzgADAAB4cHcMP0AAAAAAABAAAAAAeHEAfgAJeHB4,     
Authorization=sHHZVtlErfzhiT4V6ecK6B, 
Host=localhost:8000, 
Content-Length=55, 
MULE_ENDPOINT=http://localhost:8000/test, 
User-Agent=Jakarta Commons-HttpClient/3.1, 
Keep-Alive=false, 
Connection=false, 
Content-Type=application/json, 
Accept=application/json, 
originatingip=20.20.20.20
}

1 个答案:

答案 0 :(得分:6)

您实际上必须为此配置HTTP连接器:

<http:connector name="NoSessionConnector">
    <service-overrides sessionHandler="org.mule.session.NullSessionHandler"/>
</http:connector>