Sean Sun
Sean Sun

Reputation: 546

Cannot use property expression in class mediator in WSO2 ESB 4.9.0

I created a class mediator and need to use expression for password property because it has been encrypted in vault,

proxy

However, the property inside of class mediator () seems not support expression. There is an exception in console,

console

Upvotes: 1

Views: 426

Answers (1)

jchaplin
jchaplin

Reputation: 211

We ran into same issue. We were unable use expression on a property for the class Mediator.

I am by no means an expert so if there is a better way hopefully someone else will speak up but this is how I got it working.

Change the property on your inSequence to this, really only adding scope="default"

<property name="passwordvault"
                   expression="wso2:vault-lookup('proxy.sunb.password')"
                   scope="default"/>

Then once you set that you can retrieve it inside nz.govt.mpi.NtlmAuthorisation2 retrieve the value like this

password = (String) synMgtx.getProperty("passwordvault");

Upvotes: 1

Related Questions