Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 78064 invoked from network); 20 Aug 2008 11:35:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Aug 2008 11:35:45 -0000 Received: (qmail 4438 invoked by uid 500); 20 Aug 2008 11:35:42 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 4360 invoked by uid 500); 20 Aug 2008 11:35:41 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 4229 invoked by uid 99); 20 Aug 2008 11:35:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2008 04:35:41 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [195.69.129.177] (HELO exsmtp01.exserver.dk) (195.69.129.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2008 11:34:41 +0000 Received: from EXVS04.exserver.dk ([10.10.10.84]) by exsmtp01.exserver.dk with Microsoft SMTPSVC(6.0.3790.1830); Wed, 20 Aug 2008 13:33:04 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Marshaling jdbc output with xstream Date: Wed, 20 Aug 2008 13:32:49 +0200 Message-ID: <4C1FB9C00D24A140906239533638C4D2051C61FB@EXVS04.exserver.dk> In-Reply-To: <19065283.post@talk.nabble.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Marshaling jdbc output with xstream Thread-Index: AckCohltG61VhmQZS4iKCNgYLaMOowAFj8VA From: "Claus Ibsen" To: X-OriginalArrivalTime: 20 Aug 2008 11:33:04.0283 (UTC) FILETIME=[8276C6B0:01C902B8] X-Virus-Checked: Checked by ClamAV on apache.org 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 =20 Claus Ibsen ...................................... Silverbullet Skovsg=E5rdsv=E6nget 21 8362 H=F8rning Tlf. +45 2962 7576 Web: www.silverbullet.dk -----Original Message----- From: dkozic [mailto:drazen.kozic@asw.eu]=20 Sent: 20. august 2008 10:54 To: camel-user@activemq.apache.org Subject: Marshaling jdbc output with xstream Hi, I am trying to marshal sql output with xstream like this from("timer://whcTimer?period=3D20000&delay=3D10000").setBody( constant("select 1 ID, 'addRequest|38765405818||' skript from dual")).to("seda:whcLog").to("jdbc:dataSource").to("seda:whcLog").splitte= r(body()).to("seda:whcLog").to("seda:whcA"); from("seda:whcA").to("seda:whcLog").marshal().xstream().to("seda:whcB"); from ("seda:whcB").to("seda:whcLog"); from("seda:whcLog").to("log:asw.someLogger?level=3DDEBUG&showHeaders=3Dtr= ue"); =09 The log output is this: 2008-08-20 10:42:05,890 [seda:whcLog thread:3] DEBUG asw.someLogger:73 = - Exchange[Headers:{}, BodyType:String, Body:select 1 ID,=20 'addRequest|38765405818||' skript from dual] 2008-08-20 10:42:07,906 [seda:whcLog thread:3] DEBUG asw.someLogger:73 = - Exchange[Headers:{jdbc.columnCount=3D2}, BodyType:java.util.ArrayList, Body:[{SKRIPT=3DaddRequest|38765405818||, ID=3D1}]] 2008-08-20 10:42:07,921 [seda:whcLog thread:3] DEBUG asw.someLogger:73 = - Exchange[Headers:{org.apache.camel.splitSize=3D1, org.apache.camel.splitCounter=3D0, jdbc.columnCount=3D2}, BodyType:java.util.HashMap, Body:{SKRIPT=3DaddRequest|38765405818||, = ID=3D1}] 2008-08-20 10:42:07,921 [seda:whcLog thread:3] DEBUG asw.someLogger:73 = - Exchange[Headers:{org.apache.camel.splitSize=3D1, org.apache.camel.splitCounter=3D0, jdbc.columnCount=3D2}, BodyType:java.util.HashMap, Body:{SKRIPT=3DaddRequest|38765405818||, = ID=3D1}] 2008-08-20 10:42:08,218 [seda:whcLog thread:3] DEBUG asw.someLogger:73 = - Exchange[Headers:{org.apache.camel.splitSize=3D1, org.apache.camel.splitCounter=3D0, jdbc.columnCount=3D2}, BodyType:[B, = Body:] After xstream marshalling message body is something strange, not xml. I searched forum and find this entry: http://www.nabble.com/xstream-usage-td18548989s22882.html#a18548989 and this jira issue: http://issues.apache.org/activemq/browse/CAMEL-744 and this one: http://issues.apache.org/activemq/browse/CAMEL-749 I allready have xstream-1.3.jar in my classpath. also I have tryed with -Dfile.encoding=3DUTF-8, with no results. Please help --=20 View this message in context: = http://www.nabble.com/Marshaling-jdbc-output-with-xstream-tp19065283s2288= 2p19065283.html Sent from the Camel - Users mailing list archive at Nabble.com.