Hello Pontus, How are you ? :) Actually that was the way I solved it, but I field that it should be an better solution on it, I don't now how much overhead it is to set the body as a header ? I think it should be an better way to set the body in the sql statement. Thanks
2014-05-20 23:20 GMT+02:00 Pontus Ullgren <ullg...@gmail.com>: > Hello Poyan, > > You could try something like this to assign a header the value of the > body and then use the header name. > ------ > <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> > <route> > <from uri="direct:start"/> > <setHeader headerName="theId"> > <simple>id</simple> > </setHeader> > <setHeader headerName="theMessage"> > <simple>body</simple> > </setHeader> > <to uri="sql:insert into messages (id, message) VALUES (:#theId, > :#theMessage)?dataSource=#myDataSource"/> > <to uri="mock:result" /> > </route> > </camelContext> > ------ > > Hope this helps > // Pontus > > On Tue, May 20, 2014 at 10:11 PM, Poyan G <poyan.ger...@gmail.com> wrote: > > Hello, > > > > I have an route there I want to insert complete message in an row in the > > database, the problem is that the insert statement want # header name or > > body name, and to have body name my body need to be hashmap, my body is > > just an String and I want to insert the complete string in to database. > > What is the best way to to this ? I do not use Java for my route it's > plain > > spring camel xml configuration. > > > > Thanks > > > > -- > > Poyan Gerami > > poyan.ger...@gmail.com > -- Poyan Gerami poyan.ger...@gmail.com