Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read parameter in mule esb

I am sending some parameter to mule which is listening through http inbound in 8081 I am sending.

http://localhost:8081/hey?age=manoj

But I don't know How can I take this as from message?? I know I can access it from message and payload but when I try to do this

#[message payload: ['age']]

I am getting error that payload is a String type and I am very much confuse in mule. I want age value.

like image 839
Manoj Singh Avatar asked Jan 10 '23 12:01

Manoj Singh


2 Answers

If you are using Mule 3.6 version or above, the expression has been changed ..
So now, you need the following expression to get the value :-

#[message.inboundProperties.'http.query.params'.age]

You can find the reference here for you query :- https://developer.mulesoft.com/docs/display/current/HTTP+Listener+Connector

like image 191
Anirban Sen Chowdhary Avatar answered Jan 18 '23 20:01

Anirban Sen Chowdhary


This will come in as an inbound property. You can access it using MEL:

<logger message="#[message.inboundProperties['age']]" level="INFO" doc:name="Logger"/>

Be careful though you need to make sure to use the inboundProperty in the same flow as your HTTP Inbound endpoint.

like image 28
Jameson Triplett Avatar answered Jan 18 '23 22:01

Jameson Triplett