Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. 1.PDF - 1.XML
  2. 2.PDF - 2.XML
  3. 3.PDF - 3.XML
  4. etc.
  5.  
  6. @Grab('org.apache.camel:camel-core:2.13.0')
  7. @Grab('org.slf4j:slf4j-simple:1.6.6')
  8. import org.apache.camel.*
  9. import org.apache.camel.impl.*
  10. import org.apache.camel.builder.*
  11. import org.apache.camel.util.jndi.*
  12.  
  13. def jndiContext = new JndiContext();
  14.  
  15. def dataDir = "/${System.properties['user.home']}/test/file-poller-demo"
  16. def camelContext = new DefaultCamelContext(jndiContext)
  17. camelContext.addRoutes(new RouteBuilder() {
  18. def void configure() {
  19. from("file://${dataDir}/in")
  20. .aggregate(simple('${file:onlyname.noext}')).completionSize(2).groupExchanges()
  21. .split(body())
  22. .to("file://${dataDir}/out")
  23. }
  24. })
  25. camelContext.start()
  26.  
  27. No body available of type: java.io.InputStream but has value: Exchange[1.xml] of type: org.apache.camel.impl.DefaultExchange on: 1.txt. Caused by: No type converter available to convert from type: org.apache.camel.impl.DefaultExchange to the required type: java.io.InputStream with value Exchange[1.xml]. Exchange[1.txt].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement