Red Hat Training

A Red Hat training course is available for Red Hat Fuse

12.4. Manual Deployment

Overview

You can manually deploy and undeploy FABs by issuing commands at the Red Hat JBoss Fuse console.

Prerequisites

The implementation of FAB is provided by the fabric-bundle feature. To install this feature in the container, enter the following console command:
JBossFuse:karaf@root> features:install fabric-bundle

Installing a FAB using the fab scheme

FABs can be deployed using the fab: URL scheme, which is useful for installing FABs in a general context, such as a FAB URL embedded in an Apache Karaf features file. For example, to install a FAB using the osgi:install command, prefix the FAB's URL with the fab: scheme, as follows:
osgi:install fab:mvn:groupId/artifactId/version

Starting a FAB

To start a FAB, you must first obtain its bundle ID using the osgi:list command. You can then start the FAB using the fab:start command (which takes the bundle ID as its argument).
For example, if you have already installed the FAB named A Camel FAB, entering osgi:list at the console prompt might produce output like the following:
...
[ 175] [Active     ] [            ] [Started] [   60] ServiceMix :: FTP (2009.02.0.psc-01-00RC1)
[ 180] [Installed  ] [            ] [       ] [   60] A Camel FAB (1.0.0.SNAPSHOT)
You can now start the bundle with the ID, 180, by entering the following console command:
fab:start 180
The fab:start command recursively starts all of the FAB's dependent bundles, which ensures that services required by the FAB are available when the FAB starts up.

Stopping a FAB

To stop a FAB, invoke the fab:stop console command (which takes the FAB's bundle ID as its argument).
For example, to stop the FAB with the bundle ID, 180, enter the following console command:
fab:stop 180
The fab:stop command recursively stops all of the FAB's dependent bundles. If you would prefer to perform a shallow stop (that is, to stop only the bundle corresponding to the FAB), use the osgi:stop command instead.

Uninstalling a FAB

To uninstall a FAB, invoke the fab:uninstall console command (which takes the FAB's bundle ID as its argument).
For example, to uninstall the FAB with the bundle ID, 180, enter the following console command:
fab:uninstall 180
The fab:uninstall command also uninstalls the FAB's unused transitive dependencies. Hence, fab:uninstall can potentially uninstall multiple bundles from the OSGi container. If you would prefer to perform a shallow uninstall (that is, to uninstall only the bundle corresponding to the FAB), use the osgi:uninstall command instead.

Bundle lifecycle management commands

Seeing as how a FAB is ultimately transformed into a bundle (after it is deployed into the OSGi container), some of the standard bundle lifecycle commands are also of interest to FAB users. For details, see Section 7.3, “Lifecycle Management”.

URL schemes for locating and installing FABs

When specifying the FAB's URL to the osgi:install command, you can combine fab: with any of the URL schemes supported by Red Hat JBoss Fuse, which includes the following scheme types:
  • Maven scheme—use the combined schemes, fab:mvn:, as follows:
    fab:mvn:groupId/artifactId/version
    For more details about the mvn: scheme, see Section A.3, “Mvn URL Handler”.
  • File scheme—use the combined schemes, fab:file:, as follows:
    fab:file:PathName
    Note
    On Windows, use forward slashes, /, instead of backslashes, \, in the pathname, PathName.
    For more details about the file: scheme, see Section A.1, “File URL Handler”.
  • HTTP scheme—use the combined schemes, fab:http:, as follows:
    fab:http:Host[:Port]/[Path]
    For more details about the http: scheme, see Section A.2, “HTTP URL Handler”.