I have a Mule flow in which there is a session variable "servicerequested" and this variable can have different values like - customerservice,accountservice,transferservice,etc.
There is a property file mule.dev.properties which has information of ports based on this service options:
customerservice=9914
accountservice=9918
transferservice=9919
I want an http outbound endpoint to choose the port from this properties file based on the variable requestedservice. I tried using the MEL as below:
${#[header:session:servicerequested]}
<http:outbound-endpoint exchange-pattern="request-response" host="localhost"
port="${#[header:session:servicerequested]}" path="services" method="GET"/>
but it throws the exception
Template Endpoint "http://localhost:session:servicerequested]/services" resolved
into a Malformed endpoint "http://localhost:session:servicerequested]/services"
Please let me know how we can read property file dynamically using MEL.