1
2
3
4
5
6
7
8
9
10
11
12
13
| public class HelloRoute extends RouteBuilder {
private DataFormat helloObjectJSonFormat = new JacksonDataFormat(
HelloObject.class); //sample transformation of Json object
JAXBContext ctx = JAXBContext
.newInstance(new Class[] { HelloObject.class });
DataFormat jaxBDataFormat = new JaxbDataFormat(ctx);//Xml transformation of an object
from("")
.filter(header("webSocketMsgType").isNotEqualTo("heartBeat"))
.unmarshal(helloObjectJSonFormat)
.marshal(jaxBDataFormat)
.to("properties:/hello")
}
|