Javacallout doesn't pass flow variable value to the java class

My Callout looks like this

<Properties> <Property name="encrypt.utils.key">{timeoutKey}</Property> </Properties>

Where timeoutKey variable is retrieved from KVM. I have checked that value is being retrieved from KVM properly. But in the javacallout encrypt.utils.key is passed as "{timeoutKey}" not as a value of the variable timeoutKey. How can pass the value of timeoutKey to the callout constructor. My callout constructor looks like this.

public EncryptorCallout(Map<String, String> props){
        String key = props.get("encrypt.utils.key");
        o1.addProperty("key", key);
        if(null != key && key.length() == 16){
        ENCRYPTION_KEY = key;
        }
    }

Can you please help me on this?

Solved Solved
1 1 745
1 ACCEPTED SOLUTION

Hi @Krish

You cannot reference a flow variable in Properties, you must specify the literal string. Check this link

Since the "timeoutKey" is a flow variable, you can directly use them within the Java callout by using messageContext.getVariable("timeoutKey");

For more info, check this post

For more info, check out the examples here

View solution in original post

1 REPLY 1

Hi @Krish

You cannot reference a flow variable in Properties, you must specify the literal string. Check this link

Since the "timeoutKey" is a flow variable, you can directly use them within the Java callout by using messageContext.getVariable("timeoutKey");

For more info, check this post

For more info, check out the examples here