LibraryLink ToToggle FramesPrintFeedback

Deploying a Feature

You can deploy a feature in one of the following ways:

After you have created a feature (by adding an entry for it in a feature repository and registering the feature repository), it is relatively easy to deploy the feature using the features:install console command. For example, to deploy the example-camel-bundle feature, enter the following pair of console commands:

karaf@root> features:refreshUrl
karaf@root> features:install example-camel-bundle

It is recommended that you invoke the features:refreshUrl command before calling features:install, in case any recent changes were made to the features in the feature repository which the kernel has not picked up yet. The features:install command takes the feature name as its argument (and, optionally, the feature version as its second argument).

[Note]Note

Features use a flat namespace. So when naming your features, be careful to avoid name clashes with existing features.

To uninstall a feature, invoke the features:uninstall command as follows:

karaf@root> features:uninstall example-camel-bundle
[Note]Note

After uninstalling, the feature will still be visible when you invoke features:list, but its status will now be flagged as [uninstalled].

You can hot deploy all of the features in a feature repository simply by copying the feature repository file into the InstallDir/deploy directory.

As it is unlikely that you would want to hot deploy an entire feature repository at once, it is often more convenient to define a reduced feature repository or feature descriptor, which references only those features you want to deploy. The feature descriptor has exactly the same syntax as a feature repository, but it is written in a different style. The difference is that a feature descriptor consists only of references to existing features from a feature repository.

For example, you could define a feature descriptor to load the example-camel-bundle feature as follows:

<?xml version="1.0" encoding="UTF-8"?>
<features name="CustomDescriptor">
  <repository>RepositoryURL</repository>
  <feature name="hot-example-camel-bundle">
    <feature>example-camel-bundle</feature>
  </feature>
</features>

The repository element specifies the location of the custom feature repository, RepositoryURL (where you can use any of the URL formats described in Appendix A). The feature, hot-example-camel-bundle, is just a reference to the existing feature, example-camel-bundle.

If you want to provision copies of the Apache Felix Karaf for deployment on multiple hosts, you might be interested in adding a feature to the boot configuration, which determines the collection of features that are installed when Apache Felix Karaf boots up for the very first time.

The configuration file, /etc/org.apache.felix.karaf.features.cfg, in your install directory contains the following settings:

This configuration file has two properties:

You can modify the configuration to customize the features that are installed as FUSE ESB kernel starts up. You can also modify this configuration file, if you plan to distribute FUSE ESB kernel with pre-installed features.

[Important]Important

This method of adding a feature is only effective the first time a particular Apache Felix Karaf instance boots up. Any changes made subsequently to the featuresRepositories setting and the featuresBoot setting are ignored, even if you restart the Apache Felix Karaf.

You could force the Apache Felix Karaf instance to revert back to its initial state, however, by deleting the complete contents of the InstallDir/data/cache (thereby losing all of the Apache Felix Karaf instance's custom settings).