Search code examples
springclasspathapache-camel

Apache Camel: Set body from resource


Basically, I'm trying to do this (incorrect code!):

  <camel:setBody>
    <camel:simple>resource:classpath:/myfiles/file.xml</camel:simple>
  </camel:setBody>

How would you do this properly?

Cheers!


Solution

  • You can possible try with

    <to uri="language:constant:resource:classpath:/myfiles/file.xml"/>
    

    To use the language component: http://camel.apache.org/language.html To load the content.