Mule - 从变换器获取会话属性

时间:2015-02-06 04:59:45

标签: mule mule-component

如何将此弃用方法替换为非弃用方法?

public class StrTransformer extends AbstractMessageTransformer {

    @Override
    public Object transformMessage(MuleMessage message, String outputEncoding) throws TransformerException {
        LOGGER.debug("transformMessage");
        //getSessionProperty is deprecated. Javadocs say, I can use muleSession
        //but muleSession is not available from this method.
        //Any ideas?
        return message.getSessionProperty("TEST_PROPERTY");
    }
}

1 个答案:

答案 0 :(得分:1)

您可以按如下方式获取会话属性:

message.getProperty("myProperty", PropertyScope.SESSION);