Delete MULE_SESSION header from outbound HTTP call
Asked Answered
C

1

5

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
}
Caras answered 4/3, 2014 at 21:42 Comment(0)
R
8

You actually have to configure the HTTP connector for this:

<http:connector name="NoSessionConnector">
    <service-overrides sessionHandler="org.mule.session.NullSessionHandler"/>
</http:connector>
Rana answered 4/3, 2014 at 22:17 Comment(4)
It seems to remove the MULE_SESSION header but not the MULE_ENDPOINT header.Pyrites
@Pyrites yes, which is what was asked by user1493140Rana
@DavidDossot is it possible "to delete mule specific headers from outgoing HTTP request" (as stated by the OP on the question description), more specifically X-MULE_ENDPOINT?Pyrites
@DavidDossot Although the title of the question only talks about the session header, the question is actually to remove all ‘mule specific headers’. Is that (as) easily possible?Fortress

© 2022 - 2024 — McMap. All rights reserved.