0
votes

Is there a way of controlling the order in which OSGi bundles inside a fuse esb fabric feature are loaded so that later bundles are dependent on the complete loading of earlier ones? For example, in the following feature, I want the simple-client module to only start up once the previous bundles have fully loaded:

  <features name="simple-service-features">
    <feature>
       <bundle>mvn:com.company/simple-datasource/0.0.0</bundle>
       <bundle>mvn:com.company/simple-model/0.0.0</bundle>
       <bundle>mvn:com.company/simple-service/0.0.0</bundle
       <bundle>mvn:com.company/simple-client/0.0.0</bundle>
    </feature>
  </features>
1
I don't know how Fuse ESB manages its bundle loading, however from an OSGi perspective the correct approach is to always install ALL of the bundles before starting ANY of them. If you do this then the order of installation does not matter.Neil Bartlett
Is there some hook that tells us when all bundles are initialised?Ellis
OSGi wouldn't be able to tell you this because it doesn't know how many bundles you intend to install. Your launcher or management agent will know when it's done installing.Neil Bartlett

1 Answers

0
votes

You can use the attribute start-level of bundle tag in the features.xml to sequence the OSGI bundles start.

A start level is associated with every bundle. The start level is a positive integer value that controls the order in which bundles are activated/started. Bundles with a low start level are started before bundles with a high start level. Hence, bundles with the start level, 1, are started first and bundles belonging to the kernel tend to have lower start levels, because they provide the prerequisites for running most other bundles.