开发者

Camel JaxB Problem With Existing Route

I have an existing route that I want to add logging to, currently it passes its object round as an exchange string. In certain java methods that are called from the route it converts it to a model using JAXB then does its work and converts it back.

Now im wanting to have a one way route, where I can basically jump in at a certain point and pass the model to a method to log it to the database. I'm currently using a Wiretap, but am a bit puzzled as to how I can unmarshal the object from a string to its actual model type then pass it i开发者_如何学编程n, then let the route continue as normal.

Currently the camel site is down so im just seeing if its a simple thing here...

It looks like I want to use , but will this only unmarshal it to an object for the next call (i.e the wiretap), as I want to leave everything else untouched, as if the logging never existed...


Maybe a simple camel route can explain what your want? Now I'm not sure what you want to do with the unmarshaled object.


from("direct:step1")
    .wireTap("direct:log")
    .to("direct:step2");

from("direct:log")
    .convertBodyTo(MyType.class)
    .to("bean:logToDatabase");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜