>>>>> "jose.garnica.lomeli" <jose.garnica.lom...@protonmail.com>:

> Currently I have some bundles in my karaf solution starting by default
> as resolved, in just in specific scenarios when we need active them we
> execute the command bundle:start <bundle> but we want a find a option
> to persisit that configuration, to avoid re-start the bundle manually
> when the karaf instance is restarted.

I almost never (except for debugging why a bundle won't load, which was
something I used to do a lot, but now can't remember the last time I
did...) do bundle:start.

I write my karaf applications as a "cloud of bundles" with SCR/DD'S and
then use karaf features (thanks for karaf features, JB!) to load and
start the bundles (which thanks to the magic of SCR/DS interconnects and
creates the applications).

I have tried to outline what I do here
 
https://steinar.bang.priv.no/2020/04/05/composing-applications-with-karaf-features/

(But while it all is clear and simple in my head, I don't feel I managed
to put that clarity into text...:-) )

Anyway: what I always have experienced, is that when I load my
applications using features, the feature loading is persisted, so that
if karaf is stopped and then started, the same features are loaded.

I think this happens when you use bundle:start on individual bundles as
well, but, as I said, I haven't used it in a while.

The stored state is in the data directory in a running karaf, so if you
wish to start with a clean slate, just delete the data directory.

This is what I do in my karaf debian package, it was necessary to make
upgrades work.

Reinstalling all applications running in the same karaf instance after
an upgrade was a boring chore, so I created a master feature to install
all apps ("one feature to load them all, one feature to bind them"), and
what I do after a reinstall is to ssh into the running karaf instance,
and do:
 feature:repo-add mvn:no.priv.bang.myapps/myapps/LATEST/xml/features
 feature:install myapps

The master feature repository, looks like this:
 
https://github.com/steinarb/myapps/blob/master/src/main/filtered-resources/feature.xml

My applications are built on top of:
 - pax-jdbc
 - pax-web (thanks Grzegorz!)
 - apache shiro (for authentication and authorization)

Reply via email to