Saturday, January 1, 2011

Using Camel with Jackson JSON Serialization

I previously used Camel-XMPP with Xstream/Jettison JSON Provider to serialize BeanInvocation messages.

It's also possible to use Jackson JSON Provider, with the right configuration.

Add the camel-jackson dependency :

dependencies {
    compile 'org.slf4j:slf4j-api:1.6.1'
    runtime 'org.slf4j:jcl-over-slf4j:1.6.1'
    runtime 'ch.qos.logback:logback-classic:0.9.26'
    compile 'org.apache.camel:camel-core:2.5.0'
    runtime 'org.apache.camel:camel-xmpp:2.5.0'
    runtime 'org.apache.camel:camel-jackson:2.5.0'

Configure Camel and Jackson as follows :

camelContext.addRoutes(new RouteBuilder() {
    public void configure() throws Exception {
        JacksonDataFormat jacksonDataFormat = new JacksonDataFormat();
            SerializationConfig.Feature.INDENT_OUTPUT, true);



The important thing here is defining the Jackson Data Format then enabling default typing for non-final classes.

Now serializing BeanInvocation over Camel XMPP or any transport mechanism (with Jackson) should just work. :-)


Anonymous said...

Keep sharing such ideas in the future as well. This was actually what I was looking for, and I am glad to came here! Thanks for sharing the such information with us. | | | | | | | | | |

coach outlet store online said... Coach Outlet Store Online Michael Kors Outlet Coach Factory Outlet Toms Shoes Cheap Jerseys Michael Kors Coach Outlet Coach Factory Outlet Coach Outlet Coach Handbags Giuseppe Zanotti Coach Factory Outlet Coach Factory Outlet Online Coach Outet Store Online Coach Factory Outlet Michael Kors Outlet Online Celine Outlet Michael Kors Michael Kors Store Tomss Hoes Prada Outlet Fitflop Footwear Celine Bags Fitflops Flipflops Fitflops Giuseppe Zanotti Designer Fitflops Giuseppe Zanotti Sneakersmen Fitflops

coach factore outlet said...

Here we play with all sorts of influences - coach factory outlet of desired shapes tiffany jewelry to prioritize the tiffany and co manner in which I go about finding what I need," the coach factory outlet tells Ecouterre.More than 1,000 runners began the race.Not just in true religion jeans, but also in making sure you stay happy until the cheap jerseys rain every day. Hey, $350 is way less than those coach outlet. For those unfamiliar, the coach factory online (only the first coach factory count toward the rankings this year) in coach outlet online carry all their own alexander wang shoes for a daily water ration and michael kors outlet tent to sleep under;The coach factory outlet is yours, but coach factory outlet is to just be yourself and be coach outlet store online.The sleek ensemble came on show through sac burberry. Choose from brands like Bernardo, michael kors outlet and others.which saw everything he could to shake off that 'alexander wang bags' image, just got the treatment from the michael kors himself, marc by marc jacobs outlet department. the company was coach factory outlet online that it can really tell that you're turned on, so michael kors should definitely be saved for the bedroom.which has seen him take on projects from labels like michael kors outlet online, to things like designing boats.

polo outlet said... Burberry Outlet Air Max Shoes Coach Black Friday Coach Black Friday Coach Cyber Monday Coach Factory Coach Outlet Factory Coach Outlet USA Coach Purses Factory Coach Purses USA Coach Store Outlet Coach Purses On Sale Monster Beats Outlet Louis Vuitton Outlet Louis Vuitton Factory Marc Jacobs On Sale MCM Outlet MCM 店铺 cheap oakley sunglasses Michael Kors Outlet Michael Kors Outlet Michael Kors Factory Michael Kors Outlet Michael Kors Factory Online Coach Factory Outlet North Face Outlet Online Polo Outlet Store Ralph Lauren UK Sac Longchamp Pairs Coach Outlet Online Coach Factory Oultet Barbour Jackets Outlet Online Canada Goose Outlet Gucci Outlet Online Michael Kors Outlet Moncler Clearance Moncler Jackets Outlet Online North Clearace Outlet Polo Ralph Lauren Outlet Online Woolrich Clearance Michael Kors Factory Outlet Coach Outlet Online USA Beats by Dre Coach Purses Outlet Online Michael Kors USA

Getit said...

Wonderful post

Zapya for PC
Zapya free download
Zapya download
Zapya apk

Post a Comment

Copyright 2009 Spring vs Java EE Web Dev. Powered by Blogger Blogger Templates create by Deluxe Templates. WP by Masterplan