I have created a sample mule application that fetches one row from my database. It fetches USER_NAME and USER_ID from the Database. when I convert the result to JSON or XML I get the output as
[{"USER_ID":"U001","USER_NAME":"Dharmin"}]
Now i want to save USER_ID and USER_NAME in Session variables. Can someone guide me ?
edit: updated the basic flow image
Do you need to use the results from the DB as a Json?
If not, don't even bother converting the values to JSON before saving them to the sessionVars. Access them directly from the Payload after the DB call:
And here's the configuration XML:
The output of the logger is:
processor.LoggerMessageProcessor: UserID: U001 | UserName: Dharmin