Following is the log of my current json body. And I want to add new property to this body. "NewPropertyName": "value"
. Since the value is in a database I am using a class mediator to add this property.
[2015-05-18 05:47:08,730] INFO - LogMediator To: /a/create-project, MessageID: urn:uuid:b7b6efa6-5fff-49be-a94a-320cee1d4406, Direction: request, _______BODY_______ =
{
"token": "abc123",
"usertype":"ext",
"request": "create"
}
Class mediator's mediate method,
public boolean mediate(MessageContext mc) {
mc.setProperty("key", "vale retrived from db");
return true;
}
but this doesn't work as I expected. I couldn't find any guide to add property to json body using class mediator, please help.