简体   繁体   中英

How to access to MULE_HOME variable from a file properties?

我想从文件属性访问MULE_HOME变量,我已经使用过muleEnv=${MULE_HOME}但是没有用。

Mule Home can be accessed using MEL expression:- #[mule.home] in the flow
You can put this expression in a properties file as follows:-

muleEnv=#[mule.home]

and can access in the flow:-

<logger level="INFO" message="## Mule home: ${muleEnv}" doc:name="Logger"/>

simple and easy :)

What do you mean with server? Are you referring to the Mule Runtime or the computer where the Mule Runtime is running ?

you can try to initialise your mule runtime with -M-Dmule.home.dir=%MULE_HOME%.

In this the case the runtime will contain the MULE_HOME directory and you it should be avaible with ${mule.home.dir}

This is not necessary at all, when a mule runtime is initialised, you should have a property mule.home with the value of the MULE_HOME variable, try to change ${MULE_HOME} for ${mule.home} or ${mule.base}

This is working for me:

test.properties --> test.var.home=${mule.home}

in my flow:

 <logger message="${test.var.home}" level="INFO" doc:name="Logger"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM