Search code examples
mulemule-studiomule-componentmule-el

Mule: Key of a map contained in a spring bean to be constructed at runtime by concatenating from flowvar and a property in MEL


Having a hashmap in a spring bean(detail) whose keys at runtime are to be constructed using a concatenation of flowVars (msVendorCode) and a property read from a property file(QUEUENAME & QUEUEROUTINGKEY)

 <amqp:outbound-endpoint exchangeName="${QUEUEEXCHANGE}" queueName="#{detail.vendor['#[flowVars.msVendorCode]' + '${QUEUENAME}']}" connector-ref="vendorConnector" routingKey="#{detail.vendor['#[flowVars.msVendorCode]' + '${QUEUEROUTINGKEY}']}" doc:name="AMQP" />

How can i at runtime construct a map key for a map in a spring bean by concatenating flow variable and a property. The expression used above is setting null to routing key and queuename.


Solution

  • Try with:

    queueName="#[app.registry.detail.vendor[flowVars.msVendorCode] + '${QUEUENAME}']"