Hi,
I have modified route acording to your suggestion. It is now:
from("timer://whcTimer?period=20000&delay=10000").setBody(
constant("select 1 ID, 'addRequest|38765405818||' skript from dual")).
to("seda:whcLog").to("jdbc:dataSource").to("seda:whcLog").splitter(body()).to("seda:whcLog").to("seda:whcA");
from("seda:whcA").to("seda:whcLog").marshal().xstream().convertBodyTo(String.class).to("seda:whcB");
from("seda:whcB").to("seda:whcLog");
from("seda:whcLog").to("log:asw.someLogger?level=DEBUG&showHeaders=true");
But the log output is the same as before:
2008-08-20 14:35:27,640 [seda:whcLog thread:3] DEBUG asw.someLogger:73 -
Exchange[Headers:{}, BodyType:String, Body:select 1 ID,
'addRequest|38765405818||' skript from dual]
2008-08-20 14:35:30,015 [seda:whcLog thread:3] DEBUG asw.someLogger:73 -
Exchange[Headers:{jdbc.columnCount=2}, BodyType:java.util.ArrayList,
Body:[{SKRIPT=addRequest|38765405818||, ID=1}]]
2008-08-20 14:35:30,015 [seda:whcLog thread:3] DEBUG asw.someLogger:73 -
Exchange[Headers:{org.apache.camel.splitSize=1,
org.apache.camel.splitCounter=0, jdbc.columnCount=2},
BodyType:java.util.HashMap, Body:{SKRIPT=addRequest|38765405818||, ID=1}]
2008-08-20 14:35:30,046 [seda:whcLog thread:3] DEBUG asw.someLogger:73 -
Exchange[Headers:{org.apache.camel.splitSize=1,
org.apache.camel.splitCounter=0, jdbc.columnCount=2},
BodyType:java.util.HashMap, Body:{SKRIPT=addRequest|38765405818||, ID=1}]
2008-08-20 14:35:30,312 [seda:whcLog thread:3] DEBUG asw.someLogger:73 -
Exchange[Headers:{org.apache.camel.splitSize=1,
org.apache.camel.splitCounter=0, jdbc.columnCount=2}, BodyType:String,
Body:]
What is wrong with my route?
By the way, great product!!!
Claus Ibsen wrote:
>
> Hi
>
> You need to convert to body after xstream marshal to what you want - eg
> String.
>
> This is part of a route I have used for POC with Camel, where we want to
> store on JMS queue as readable String
>
> from("gsoQueue")
> // map the input from GS to our inhouse format
> .processRef("mapper")
> // marhsal the inhouse format to a xml stream and as a string
> so we can browse
> // it on the queue (xstream is default byte arrays)
> .marshal().xstream().convertBodyTo(String.class)
> .to("inhouseQueue");
>
>
>
> Med venlig hilsen
>
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
>
>
--
View this message in context:
http://www.nabble.com/Marshaling-jdbc-output-with-xstream-tp19065283s22882p19068605.html
Sent from the Camel - Users mailing list archive at Nabble.com.