How to set a specific start order for bundles in a Red Hat Fuse instance

Solution Verified - Updated -

Environment

  • Red Hat Fuse
    • 6.x
    • 7.x

Issue

  • How to set a specific start order for bundles?
  • How to set the start sequence on Fuse?
  • How to set load sequence on Fuse?

Resolution

Set the bundle start level in the container shell or set it configuring a Feature.
The default Fuse start level is 80, so just set a start level that is less than 80 to a bundle to start first or set more than 80 to a bundle to start after.

The command will be like this:

> bundle:start-level <bundle-id> <start-level>

For example, Fuse has bundle A and bundle B installed. The ids of the bundles are:

  • A - 180
  • B - 181

To make sure that bundle A start first than bundle B, just run the command:

> bundle:start-level 180 70

Now the start level for both bundles are:

  • A - 70
  • B - 80 (the default start level)

It is also possible to develop a Feature and set the start level in the bundle definition. When deploying the feature, the bundles will start with the start level defined in the feature.

Here is a example:

<?xml version="1.0" encoding="UTF-8"?>
<features name="custom-feature-repo">
  <feature name="my-feature">
     <bundle start-level="70">mvn:group/bundle-A/1.0</bundle>
     <bundle>mvn:group/bundle-B/1.0</bundle>
  </feature>
</features>

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.