I am using Camel APIs for routing in my project with ESB and have the below requirement for a specific problem:-
There is a web service called using the form tag URI which takes in the request as JSON and responds the POST call with JSON data. I need to include the request JSON data as one of the fields inside my response JSON. I am searching for a possible way to enrich my message. I could do it by writing the transformation logic in a java class. But Constraint is that I can not use separate Java class for doing data transformation. I have to do it via configuration inside camelContext using tags. Please suggest.
You can read entire Json body as a tree
JsonNode body = mapper.readTree(input);
and after that enrich it with your construction. For example, if you have next json body:you can enrich it with this piece of code: