camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gert Villemos <>
Subject Cometd component
Date Tue, 12 Apr 2011 21:25:12 GMT
I have problems understanding how the cometd component publish objects.

I have my own class called 'Parameter'. I want to publish instances of
'Parameter' through cometd to a website. I would expect the data arriving
through cometd to have a structure similar to my Parameter definition.

However the only thing that arrives is a single field, holding the a value
i.e. it seems the object is transformed to a string using a simple toString
call. All field information is lost. Not very useful.

Is there a way to transform any POJO to a format (Map?) that can be
transfered using cometd, keeping the information in the POJO?

My route looks like;


I have tried inserting a Xstream data transformer in the route. Indeed I
receive a different set of data, but its an array of 160 integers, not a
structure reflecting the structure of my 'Parameter' class as I had

I know that I can create bean that converts the 'Parameter' instance into a
Map and put this into the body prior to sending the data over cometd.
However I then have to create a 'formatter' per data type. I had hoped to
have a generic formatter.

What am I doing wrong?

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message