KB Article #177039
Unable to retrieve settings from envSettings.props via msg.get()
Problem
-- Using msg.get() on an environmental setting does not retrieve the value configured in envSettings.props.
Resolution
* This is because msg.get() does not do selector expansion, it only looks at the message whiteboard and so it won't find anything configured in envSettings.props. So if you attempt to msg.get("env.PORT.TRAFFIC") you will find nothing, rather than "8080" as you might expect.
One solution is to reference the environmental property directly within the script, for example, in JavaScript you could write var port = "${env.PORT.TRAFFIC}"; and then the port variable would be set to "8080" assuming the traffic port was at its default value.
Another solution is simply to copy the value from a selector expression evaluated within a copy/modify attributes filter into a normal message attribute. The following example copies the value of ${env.PORT.TRAFFIC} into test.port, after which msg.get("test.port") will return the expected value.