camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen">
Subject RE: Deserializing mesage
Date Fri, 11 Jul 2008 04:00:15 GMT

As always with Camel there are several/many solutions. Some more elegant.

Yes your own processor would do fine. List<Map<String, Object>> is what you get
from JDBC. It's a list of rows, where each row is a Map object with the JDBC column name as
the string key, and the value is the Object.

I would use my own processor to do my transformation to the string that XMPP expects.

BTW: There is also the DataFormat solution where you can define your own data format and serialize/deserialize
to/from this format.

Or the type converter, then Camel will automatically pick it up and convert it.

public class MyConverter
public static String convertToString(List<Map<String, Object>> jdbcResult) {
   return string
Then you need a special marker file in the META-INF folder. Its all documented in the wiki.
You can check out camel-core.jar to see this marker file.

But I am not 100% sure the type converter solution will work as the type is a generic.

Feedback on the documentation is highly appreciated. And if the generic type converter works

Med venlig hilsen
Claus Ibsen
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576

-----Original Message-----
From: Vadim Chekan [] 
Sent: 11. juli 2008 04:18
Subject: Deserializing mesage

Hi all,
I'm trying to send message from jdbc to xmpp amd I'm getting 
deserialization error. Jdbc creates a message of type 
"ArrayList<HashMap<String, Object>>" but xmpp expects a String.
Should I add my own Processor or there  exist more elegant way to 
transform an object into text or even better into xml?


View raw message