如何将此弃用方法替换为非弃用方法?
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");
}
}
答案 0 :(得分:1)
您可以按如下方式获取会话属性:
message.getProperty("myProperty", PropertyScope.SESSION);