camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LavanyaKC <cko...@progress.com>
Subject Sending splitter output to a file throws InvalidPayloadException
Date Mon, 06 Oct 2008 13:46:28 GMT

I am using the following spring xml file to split the xml content of a file
to different files. 

<camelContext id="camelroute"
xmlns="http://activemq.apache.org/camel/schema/spring">
  <route>
    <from uri="file:///D:/testing/file1.xml"/>
    <splitter>       
      <xpath>//student/name</xpath>      
      <to uri="file:///D:/testing/file2"/>
    </splitter>
  </route>
</camelContext>

Running the above spring xml throws an InvalidPayloadException.

The example given in camel documentaion in Java DSL:
from("activemq:my.queue").splitter(xpath("//foo/bar")).to("file://some/directory")
also do not work since the splitter returns a DeferredElementNSImpl type
whereas the file endpoint expects the exchange to be an InputStream.  Since
it is Java DSL, there is a way to specify return type as "String.class" or
any other type in the xpath expression to fix this. But I need to use Spring
configuration for my requirement. 

Thanks for any help in this regard.
-- 
View this message in context: http://www.nabble.com/Sending-splitter-output-to-a-file-throws-InvalidPayloadException-tp19838250s22882p19838250.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message