6 Replies Latest reply on Oct 23, 2011 3:23 AM by Claus Ibsen

    Transform a file into a filename inside a route.

    mark kimsal Newbie

      I'm trying to setup an example that will watch a directory for new files and then alert another component about the name of this file.  I was thinking that I could stuff the name of the new file into a message queue and let another component deal with it from there.  The file may be a gigabyte or more, so I don't want to put the entire file into the MQ.

       

      I guess, my first question is:  Is using the mediation router a bad idea for such a large file?  Does it suck the entire contents of the file into the exchange or not until getIn().getBody() is called?

       

      Is there a built-in DSL way to transform the body of the message into just the name of a file or would you have to create a simple bean to do getOut().setBody(Exchange.FILE_NAME)?

       

       

      <from uri="file:/tmp&&amp;move=tagged/$"/>

      $</constant>

      </setBody>

      <to uri="activemq:queue:newFiles"/>

      </route>