Camel Route :
<camelContext xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<xmljson id="xmljson" />
</dataFormats>
<route id="route1">
<from uri="file:C:/Users/User1/InputXML"/>
<to uri="activemq:queue:MyThread1"/>
</route>
<route id="route2">
<from uri="activemq:queue:MyThread1"/>
<marshal ref="xmljson"/>
<bean ref="com.test.OutputProcessor"/>
</route>
</camelContext>
Input XML :
<?xml version="1.0" encoding="UTF-8"?>
<Message>
<to> Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</Message>
Actual output :
{"to":" Tove","from":"Jani","heading":"Reminder","body":"Don't forget me this weekend!"}
I want to customize this output. i want to add some mote attributes to the converted json. For Example i want the output json as
{
"inputs":[
{
"inputname":"to",
"inputValue":"Tove"
},
{
"inputname":"from",
"inputValue":"jani"
},
{
"inputname":"heading",
"inputValue":"Reminder"
},
{
"inputname":"body",
"inputValue":"Don't forget me this weekend!"
}
]
}
How this can be achieved ?
CCvalue?