Pratibha,

It would really help if you would post the actual error message it gives. Now we can only guess what the problem is. Just one guess: did you close the <from> tag, because in your mail, it isn't closed?

Setting the message body through the XML syntax has only recently been added (cfr. https://issues.apache.org/activemq/browse/CAMEL-195), so if you want to use that, you'll have to build Camel locally and afterwards build ServiceMix locally to include the 1.4-SNAPSHOT of Camel.

Gert

pratibhaG wrote:
thanks for your reply.

I got it in camel 1.3.0 documentation.

I tried to use it. I could implement content based router in file
MyRoter.java. I am also using timer component.
Here is the code I have written:

from("timer://tutorial?fixedRate=true&period=10000") // 1 .setBody(constant("<message>Hello world!</message>")) // 2 .to("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jmsP1:provider1") .to("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jmsP2:provider2")
                .choice()
                        .when(body().isEqualTo("<message>Hello 
world</message>"))
                
.to("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jmsP3:provider3");
                
from("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jmsC:consumer") // 1 .to("log:tutorial-jbi") // // 2 .convertBodyTo(String.class) // 3 .to("log:tutorial-string"); This is working fine. But I want to do all this in camel-context.xml.

First problem is :
if i give <from uri ="timer://tutorial?fixedRate=true&period=10000">

It gives me error. How to use timer in camel- context.xml?
I searched the doc but did not get. Also can I set the message body using
camel- context.xml?

please help me.

thanks,
Pratibha



Reply via email to