Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Chapter 24. Working with Fabric Profiles

Profiles are applied to fabric containers, and they determine the function and behavior of their containers. A profile consists of code and configurations, which specify the type of service or application a container runs. The code may come from OSGi bundles, Fab Application Bundles (see Fuse Application Bundle Deployment Model in the Red Hat JBoss Fuse Deploying into the Container guide at https://access.redhat.com/site/documentation/JBoss_Fuse/), and Karaf features pulled from repositories, also specified in the profile. Defined hierarchically, profiles can be set up to inherit from other profiles, building on their parents' definitions.

24.1. Creating a new profile

Overview

The tooling provides access to numerous profiles, each of which imparts specific functionality and behaviors to the containers to which it's assigned. But you may want to create new profiles that inherit from these base profiles, so you can override, for example, configuration details. You may also want to create your own profiles to deploy your own code. To do so, you create a new profile based on an existing one, and then change its configuration and properties to generate the specific behaviors you want to deploy to the target containers.
Note
This procedure creates a brand new profile. If you want to create a new version of an existing profile to incrementally test changes to deployed containers, see Chapter 25, Working with Versions

Procedure

To create a new profile:
  1. In Fabric Explorer, expand the fabric in which you want to create a new profile.
  2. Expand the fabric's tree to the level of the profiles, as shown in Figure 24.1.

    Figure 24.1. Accessing the profiles

    accessing profiles in Fabric Navigator
  3. Select the profile on which you want to base the new profile, and right-click it to open the context menu.
    Important
    Because the selected profile is the parent of the new profile, the new profile inherits the selected profile's configurations, properties, features, repositories and bundles as well as those of the selected profile's ancestors. However, a child's configurations override an ancestor's when their configuration files have the same name.
    Note
    Neither configuration files nor properties are visible within the tooling, but you can view them in the Red Hat JBoss Fuse Management Console. For details, see the Red Hat JBoss Fuse Management Console documentation at https://access.redhat.com/site/documentation/JBoss_Fuse/.
  4. Select Create a new Profile.

    Figure 24.2. Create Profile dialog

    naming the profile
  5. In Profile name, enter a name for the new profile.
    Use a name that is descriptive of the new profile's function.
  6. Click OK to create and save the new profile.
    The new profile is added to the list of profiles in Fabric Explorer, under its parent profile.
  7. In Fabric Explorer, select the new profile to populate the Properties editor with the new profile's properties information and profile details.
  8. In the Properties editor, click the Details tab.

    Figure 24.3. Profiles page

    configuring new profile details
    On the Profiles page, you can add, delete, or edit features, the repositories from which features are downloaded, and bundles. You can also add or remove parent profiles. Profiles can have multiple parents, and they inherit the qualities of each
    Features are files that aggregate references to interdependent or related bundles that together define a feature. Typically, you'd use bundles only if the feature they define is not already included in a features file. For more information on bundles and features, see Fuse Application Bundle Deployment Model in the Red Hat JBoss Fuse Deploying into the Container guide at https://access.redhat.com/site/documentation/JBoss_Fuse/.
    Child profiles inherit everything (configurations, properties, features, repositories, and bundles) from their immediate parents and from all of their parents' ancestors. When the child's and any ancestor's configuration file have the same name, the child's configuration file replaces the ancestor's file. Otherwise, configurations are cumulative.
    Note
    The Profiles page displays only the features, repositories, and bundles added by the child profile, not those contributed by the profile's parents or other ancestors. The Parents pane shows (highlighted) the profile's immediate parents only.
  9. Make the changes you want to the new profile to configure it.
    Changes are automatically saved as you make them.
    Note
    In Fuse Integration perspective, you can easily add a Fuse project to the new profile by dragging it from Project Explorer and dropping it onto the new profile in Fabric Explorer. When you do, the fabric tooling builds the project, runs all tests, installs the project in the new profile, and uploads the profile into the fabric's internal Maven repository. Because profiles are stored in a fabric's internal repository, they cannot be shared across other fabrics.
    Important
    If you drop your project on a fabric container, rather than on a profile, the next time that container is provisioned, your project is wiped out.
    You can now assign the new profile to a container.
  10. In Fabric Explorer, select the container to which you want to assign the new profile.
    The fabric tooling populates the Properties editor with the container's properties information and profile details.
  11. Open the container's Details tab, and then select the new profile in the Profiles list.
    Repeat Step 10 and Step 11 for each container to which you want to assign the new profile.

Related topics

Section 25.1, “Creating a new version of a profile”
Section 11.3, “Deploying a Project to a Fabric Container”
Deploying a camel project to a fabric profile in the Red Hat JBoss Fuse Tooling for Eclipse Tutorials on the Red Hat Customer Portal