Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

within Java, can I get a variable with messageContext.getMessage().getVariable() ?

Not applicable

Suppose I've set a variable called "url" in my API Proxy flow, maybe using AssignMessage/AssignVariable, or via Javascript context.setVariable(), or implicitly in some other way.

If I then call messageContext.getMessage().getVariable("url") from within Java Callout class, will I be able to retrieve the variable value?

Solved Solved
1 5 1,770
1 ACCEPTED SOLUTION

Not applicable

You dont need the getMessage()

You can get your variables direcrly off the context for instance messageContext.getVariable("foo");

I would be careful about setting variables with names that may be reserved like url. For instance i would set my var to local_url or script_url. This avoids a scenerio where you can't overwrite a variable and it doesnt fail giving you a false sense of the variable being set.

View solution in original post

5 REPLIES 5