Delete MULE_SESSION header from outbound HTTP call

感情迁移 提交于 2019-12-03 13:48:54

问题


I want to delete mule specific headers from outgoing HTTP request. I have placed the following transfomer within the HTTP call.

<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>

However, the following properties are still going out as http headers --

{
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:


You actually have to configure the HTTP connector for this:

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


来源:https://stackoverflow.com/questions/22183695/delete-mule-session-header-from-outbound-http-call

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!