THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
<file:sender service="test:service" endpoint="endpoint" directory="file:target/componentOutput"> <file:marshaler> <sm:defaultFileMarshaler> <sm:fileName> <!-- lets use a header from the message --> <sm:xpathString xpath="concat($name, '.xml')"/> </sm:fileName> </sm:defaultFileMarshaler> </file:marshaler> </file:sender> |
Below is an example of a non-XML file marshaler. Using the binary marshaler sends a message with the file attached. This allows any file to be processed.
The contents below were used in an xbean.xml file for a service unit named filemover
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0"?>
<beans xmlns:f="http://servicemix.apache.org/file/1.0"
xmlns:proj="http://servicemix.apache.org/samples/filemover"
xmlns:sm="http://servicemix.apache.org/config/1.0">
<f:sender service="proj:fileSender"
endpoint="endpoint"
directory="file:///C:/opensrc/test/myOutbox"
autoCreateDirectory="true">
<property name="marshaler">
<bean class="org.apache.servicemix.components.util.BinaryFileMarshaler" />
</property>
</f:sender>
<f:poller
service="proj:filePoller"
endpoint="poller"
file="file:///C:/opensrc/test/myInbox"
targetService="proj:fileSender"
targetEndpoint="endpoint"
period="60000"
recursive="true"
autoCreateDirectory="true">
<property name="marshaler">
<bean class="org.apache.servicemix.components.util.BinaryFileMarshaler" />
</property>
</f:poller>
</beans>
|