sat
sat

Reputation: 5709

Mule - Getting session property from transfomer

How do I replace this deprecated method with something that is not?

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");
    }
}

Upvotes: 0

Views: 288

Answers (1)

clare
clare

Reputation: 526

You can get the session property as follows:

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

Upvotes: 1

Related Questions