I have a GET request inbound at my localhost. I have extracted all the URI parameters from the request and stored them in session variables. Now the problem I'm facing is when I try to set map as payload using session values.
While searching for correct method to do so I stumbled upon this.
The method described here is correct and it works in following case when I hard code the key-value pair.
<set-payload value="#[['Test' : 'hjhj' ]]" encoding="UTF-8"/>
Following message is printed:
Payload : {Test=hjhj}
Payload Type : java.util.HashMap
But when I use the same method and write the following code using session variable:
<set-session-variable variableName="transactionAmount" value="#[message.inboundProperties.'http.query.params'.amount]" doc:name="Session Variable"/>
<set-payload value="#[['Test' : #[sessionVars.transactionAmount] ]]" encoding="UTF-8"/>
Message which gets printed:
Payload : {Test=[1]}
Payload Type : java.lang.String
Please tell me how I can overcome this problem. I'm stuck in this for long.
NOTE: I'm using Mule 3.9
Thanks in Advance!!