Plugin startup order / service dependency between plugins

7 views
Skip to first unread message

Morgan

unread,
Feb 4, 2026, 9:41:42 AM (19 hours ago) Feb 4
to Kill Bill users mailing-list
Hi,

I'm running into an issue with plugin startup order and would like to ask for the recommended approach.

I have two Java plugins where one depends on an OSGi service provided by the other:

- Provider: "plugin-a" registers a service (e.g. SomeService).
- Consumer: "plugin-b" needs that service in its activator and uses ServiceTracker.waitForService(timeout).

Sometimes the consumer starts before the provider. In that case the consumer's blocking wait never sees the service and times out, so the consumer fails to start.

From the platform code I see that:

1. Plugin discovery uses PluginFinder.getLatestJavaPlugins(), which iterates over a HashMap (no defined order).
2. Directory listing comes from File.listFiles() in PluginFinder.loadPluginsForLanguage(), which does not guarantee order.
3. BundleRegistry.startBundles() then starts bundles in the order they were installed.

So plugin startup order appears undefined for me.

I'd like to ask:

1. Is there an official or recommended way to control plugin startup order (e.g. start levels, ordering of plugin directories, or a naming/convention)?
2. If not, is the intended approach that consumers must not block on provider services at startup (e.g. use a background thread or lazy ServiceTracker and treat the dependency as eventually available)?
3. Are there any plans to support explicit plugin dependencies or ordering (e.g. in the platform or in plugin metadata)?

I'm on Kill Bill 0.24.16 with plugins under the standard plugins/java/<plugin-name>/ layout

Thanks in advance for any guidance.

Best regards
Reply all
Reply to author
Forward
0 new messages