Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 9. Introduction to the File Binding Component
Abstract
Overview Link kopierenLink in die Zwischenablage kopiert!
- poller endpoint
- A poller endpoint polls a specified location on the file system for files. When it finds a file it reads the file and sends it to the NMR for delivery to the appropriate endpoint.ImportantA poller endpoint can only create in-only message exchanges.
- sender endpoint
- A sender endpoint receives messages from the NMR. It then writes the contents of the message to a specified location on the file system.
Key features Link kopierenLink in die Zwischenablage kopiert!
- custom filters for selecting files
- custom marshalers for converting the contents of a file to and from a normalized message
- custom locking mechanism for controlling file access during reads
- archiving of read files
Contents of a file component service unit Link kopierenLink in die Zwischenablage kopiert!
xbean.xml
- The
xbean.xml
file contains the XML configuration for the endpoint defined by the service unit. The contents of this file are the focus of this guide.NoteThe service unit can define more than one endpoint. meta-inf/jbi.xml
- The
jbi.xml
file is the JBI descriptor for the service unit. Example 9.1, “JBI descriptor for a file component service unit” shows a JBI descriptor for a file component service unit.Example 9.1. JBI descriptor for a file component service unit
<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0"> <services binding-component="false" /> </jbi>
<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0"> <services binding-component="false" /> </jbi>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow TipThe developer typically does not need to hand code this file. It is generated by the Red Hat JBoss Fuse Maven tooling.
OSGi Packaging Link kopierenLink in die Zwischenablage kopiert!
- you will need to include an OSGi bundle manifest in the
META-INF
folder of the bundle. - You need to add the following to your service unit's configuration file:
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Namespace Link kopierenLink in die Zwischenablage kopiert!
http://servicemix.apache.org/file/1.0
namespace. You will need to add a namespace declaration similar to the one in Example 9.2, “Namespace declaration for using file endpoints” to your xbean.xml
file's beans
element.
Example 9.2. Namespace declaration for using file endpoints
<beans ... xmlns:file="http://servicemix.apache.org/file/1.0" ... > ... </beans>
<beans ...
xmlns:file="http://servicemix.apache.org/file/1.0"
... >
...
</beans>
beans
element's xsi:schemaLocation
as shown in Example 9.3, “Schema location for using file endpoints”.
Example 9.3. Schema location for using file endpoints