These components write messages to files in a directory or poll files or directories (possibly recursively) to send files into the JBI.
Firstly here is the poller which will poll a file or directory (recursively by default) to find files, which are then sent into the JBI bus
Wiki Markup |
---|
{snippet:id=poll|lang=xml|url=http://svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/file/example.xml} |
Then here's the sender. We're using a FileMarshaler here to turn JBI messages into files with an expression using XPath from the message content to generate the file name in the directory.
Wiki Markup |
---|
{snippet:id=send|lang=xml|url=http://svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/file/example.xml} |
You can if you prefer let the operating system generate temporary file names in the directory specifying an optional prefix and suffix.