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.此内容没有您所选择的语言版本。
2.2. Basic configuration
Overview
复制链接链接已复制到粘贴板!
				The basic requirements for configuring a poller endpoint are straightforward. You need to supply the following information:
			
- the endpoint's name
- the endpoint's service name
- the file or directory to be monitored
- the endpoint to which the resulting messages will be sent
				All of this information is provided using attributes of the 
poller element.
			Identifying the endpoint
复制链接链接已复制到粘贴板!
				All endpoints need to have a unique identity. An endpoint's identity is made up of two pieces of information:
			
- a service name
- an endpoint name
				Table 2.1, “Attributes for identifying a poller endpoint” describes the attributes used to identify a poller endpoint.
			
Specifying the message source
复制链接链接已复制到粘贴板!
				You specify the location in which the poller endpoint looks for new messages using the 
poller element's file attribute. This attribute takes a URI that identifies a location on the file system.
			
				If you want the endpoint to poll a specific file, you use the standard file:location URI. If you do not use the 
file prefix, the endpoint will assume the URI specifies a directory on the file system and will consume all valid XML files placed in the specified directory.
			
				For example, the URI file:inbox tells the endpoint to poll for a file called 
inbox. The URI inbox instructs the endpoint to poll the directory inbox.
			Important
					Relative URIs are resolved from the directory in which the Red Hat JBoss Fuse container was started.
				
Specifying the target endpoint
复制链接链接已复制到粘贴板!
				There are a number of attributes available for configuring the endpoint to which the generated messages are sent. The poller endpoint will determine the target endpoint in the following manner:
			
- If you explicitly specify an endpoint using both thetargetServiceattribute and thetargetEndpointattribute, the ESB will use that endpoint.ThetargetServiceattribute specifies the QName of a service deployed into the ESB. ThetargetEndpointattribute specifies the name of an endpoint deployed by the service specified by thetargetServiceattribute.
- If you only specify a value for thetargetServiceattribute, the NMR will attempt to find an appropriate endpoint on the specified service.
- If you do not specify a service name or an endpoint name, you must specify the name of an interface that can accept the message using thetargetInterfaceattribute. The NMR will attempt to locate an endpoint that implements the specified interface and direct the messages to it.Interface names are specified as QNames. They correspond to the value of thenameattribute of either a WSDL 1.1serviceTypeelement or a WSDL 2.0interfaceelement.
Important
					If you specify values for more than one of the target attributes, the poller endpoint will use the most specific information.
				
Example
复制链接链接已复制到粘贴板!
				Example 2.1, “Simple poller endpoint” shows the configuration for a simple poller endpoint.
			
Example 2.1. Simple poller endpoint