camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skg <saurabh_gar...@infosys.com>
Subject Re: putting a message in some text file using jms and camel from an end point
Date Tue, 01 Jul 2008 10:59:37 GMT

Hi,
i did the same thing, the service is deployed but the output file is not
created . Can u suggest me the reason for that and send me how to write in a
file component. I am able to read from a file component.

skg wrote:
> 
> Hi,
> I am working on the example to pass a message using jms through camel
> tooling.I am getting the message on service mix console but i want the
> message in some file.While doing that i am getting the error.
> ERROR - DeadLetterChannel              - On delivery attempt: 2 caught:
> org.apac 
> he.camel.InvalidPayloadException: No in body available of type:
> java.io.InputStr 
> eam but has value: javax.xml.transform.sax.SAXSource@11a70a7 of type:
> javax.xml. 
> transform.sax.SAXSource on the exchange: Exchange[FileMessage:
> C:\MavenCheckSend 
> er\reports.txt] 
> org.apache.camel.InvalidPayloadException: No in body available of type:
> java.io. 
> InputStream but has value: javax.xml.transform.sax.SAXSource@11a70a7 of
> type: ja 
> vax.xml.transform.sax.SAXSource on the exchange: Exchange[FileMessage:
> C:\MavenC 
> heckSender\reports.txt] 
>         at
> org.apache.camel.util.ExchangeHelper.getMandatoryInBody(ExchangeHelpe 
> r.java:117) 
>         at
> org.apache.camel.component.file.FileProducer.process(FileProducer.jav 
> a:71) 
>         at
> org.apache.camel.component.file.FileProducer.process(FileProducer.jav 
> a:60) 
>         at
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$Processor 
> ToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44) 
>         at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:7 
> 3) 
>         at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChanne 
> l.java:136)
> 
> 
> i am putting my code also to figure out if i have done anything wrong.
> 
> 
> from("timer://tutorial?fixedRate=true&period=10000").setBody(constant("<message>Hello
> saurabh!</message>")).to("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jms:provider");

> // 3
> 
>     	//...and receive messages sent by other JBI endpoints
>     
> from("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jms:consumer").process(new
> Processor(){public void process(Exchange exchange) { Message in =
> exchange.getIn();StreamSource source = in.getBody(StreamSource.class);if
> (source != null)
> {in.setBody(source.getInputStream());}}}).to("file:C:/MavenCheckSender/reports.txt");
> 

-- 
View this message in context: http://www.nabble.com/putting-a-message-in-some-text-file-using-jms-and-camel-from-an-end-point-tp18190573s22882p18213811.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message