Hi, You could use direct endpoint instead of activemq endpoint to combine the below 2 body transforms. In this way the message will not be send and take from activemq again.
from("activemq:Integration.Status").setHeader("Body")...to("direct:ToJdbc"); from("direct:ToJdbc").setBody().el("declare @h uniqueidentifier; "+ ... to("jdbc:Status"); I am also try to figure out the real reason of https://issues.apache.org/activemq/browse/CAMEL-393, It is may relate with your issue in Camel DSL implementation. Please feel free to fill the JIRA if you have any thing to comment. Willem On Sat, Aug 30, 2008 at 8:17 AM, Vadim Chekan <[EMAIL PROTECTED]> wrote: > I'm having problem with the following expression: > from("activemq:Integration.Status"). > setHeader("Body").el("${in.body}"). > setBody().el("${in.headers}"). > marshal(). > xstream().convertBodyTo(String.class). > setBody().el("declare @h uniqueidentifier; "+ > "begin dialog conversation @h "+ > "from service StatusResponseService "+ > "to service 'StatusService' "+ > "with encryption=off; "+ > "send on conversation @h > ('${in.body.replace('\'','\'\'')}'); "). > to("jdbc:Status"); > > The line before last returns Object so it can not be sent "to". > I'm trying to serialize a message, including all headers into xml, > than craft a sql expression which would contain this xml as a > parameter and send it to jdbc endpoint. > I spent several hors trying all possible combinations and still have > no clue how to do this double body transform. > I feel like I need to use "pipeline" pattern but I can not understand > what two elements should be inside this pipe. > > So far I made it working using 2 queues but it feels wrong: > from("activemq:Integration.Status"). > setHeader("Body").el("${in.body}"). > setBody().el("${in.headers}"). > marshal(). > xstream().convertBodyTo(String.class). > to("activemq:Integration.Status2"); > > from("activemq:Integration.Status2"). > setBody().el("declare @h uniqueidentifier; "+ > "begin dialog conversation @h "+ > "from service StatusResponseService "+ > "to service 'StatusService' "+ > "with encryption=off; "+ > "send on conversation @h > ('${in.body.replace('\'','\'\'')}'); "). > to("jdbc:Status"); > > And another question: in "el" this fragment > "'${in.body.replace('\'','\'\'')}" gives me an error: syntax error at > position 187, encountered ',', expected ')' > How can I replace single quote in the body with two single quote chars? > > Vadim. > > -- > From RFC 2631: In ASN.1, EXPLICIT tagging is implicit unless IMPLICIT > is explicitly specified >