Red Hat DocumentationFuse ESBToggle FramesPrintFeedback

Setting Up Auto-Discovery

Overview

Auto-discovery is a mechanism that enables you to dynamically add components to your Fuse Mediation Router application. The component URI prefix is used as a key to load components on demand. For example, if Fuse Mediation Router encounters the endpoint URI, activemq://MyQName, and the ActiveMQ endpoint is not yet loaded, Fuse Mediation Router searches for the component identified by the activemq prefix and dynamically loads the component.

Availability of component classes

Before configuring auto-discovery, you must ensure that your custom component classes are accessible from your current classpath. Typically, you bundle the custom component classes into a JAR file, and add the JAR file to your classpath.

Configuring auto-discovery

To enable auto-discovery of your component, create a Java properties file named after the component prefix, component-prefix, and store that file in the following location:

/META-INF/services/org/apache/camel/component/component-prefix

The component-prefix properties file must contain the following property setting:

class=component-class-name

Where component-class-name is the fully-qualified name of your custom component class. You can also define additional system property settings in this file.

Example

For example, you can enable auto-discovery for the Fuse Mediation Router FTP component by creating the following Java properties file:

/META-INF/services/org/apache/camel/component/ftp

Which contains the following Java property setting:

class=org.apache.camel.component.file.remote.RemoteFileComponent

Note

The Java properties file for the FTP component is already defined in the JAR file, camel-ftp-Version.jar.

Comments powered by Disqus