2

I'm migrating our code from Fuse 6 to to Fuse 7 (Developer editions).

We spin up lots of instances, so I need to automate the features loading like in Fuse 6, and it's not working.

I add the following to the /etc/org.apache.karaf.features.cfg

featuresBoot = \
    ...
    transaction-manager-narayana/5.7.2.Final, \ 
    camel-hl7/2.21.0.fuse-000077-redhat-1,\
    camel-mina2/2.21.0.fuse-000077-redhat-1,\
    camel-beanio/2.21.0.fuse-000077-redhat-1

and would expect it to install camel-hl7, camel-mina2 and camel-beanio. But when I check in the client, it shows "Uninstalled".

They install if I do it manually with feature:install

What else do I need to do? Help me Obi-wan.

djb
  • 1,635
  • 3
  • 26
  • 49
  • I am now having this issue with fuse 6.3, and would LOVE to know how you resolved it... – Hans.Loven.work Jul 18 '19 at 15:18
  • Hi Hans, I ended up running a bash script to ping Fuse until it was up, and then call the client with 'features:install' commands. If you're still out of luck on Monday, I can post the script. – djb Jul 19 '19 at 17:52
  • aha. Thanks for your response. I share similar sentiment to yours below--i.e., that _I_ may have made some odd/stupid mistake in this new installation. However, I am lucky--I have a local environment wherein I have since confirmed that an older fuse-6.3 ansible playbook of mine, creates a working* fuse-6.3. I am in the process of removing deltas between the 2 playbooks, and hope to nail this down to a single error somewhere in my newer playbook. When I do, I will post what I find as an answer to this question. – Hans.Loven.work Jul 19 '19 at 18:41

2 Answers2

4

featuresBoot property of Red Hat Fuse 7 (and Karaf 4 and even earlier) is used only once - when Karaf feature service starts for the first time. When etc/org.apache.karaf.features.cfg file is read and processed, feature service sets its bootDone flag to true.

If you want the feature to be processed after you run Fuse/Karaf and added new features later, you have to remove data/cache directory.

However it's usually not the way to do it. If you start Fuse/Karaf, you can simply install additional features you want - without adding to etc/org.apache.karaf.features.cfg. Just call feature:install.

If you need special Karaf distro with the features you want, please check a section of Karaf manual about custom distributions.

For Red Hat Fuse 7, there's special quickstart that shows how to do it - check FUSE_HOME/quickstarts/custom.

Grzegorz Grzybek
  • 6,152
  • 3
  • 29
  • 42
  • Thanks, my issue is that my additions to featuresBoot aren't being installed. I'm adding with feature:install currently, to move forward, but I'll need to get featuresBoot working eventually, as we have 12 Fuses, so I need to automate it. The custom Karaf is useful, thanks, I will read through it. But ideally, featuresBoot should work as advertised. etc/org.apache.karaf.features.cfg has camel-hl7, but camel-hl7 doesn't show up in the logs, at all, and is "uninstalled" when I load the client. Probably something obvious, but can't work it out yet. – djb Aug 15 '18 at 09:24
  • If you could provide some steps to reproduce (like the version/archive you start with + commands you invoke / files you edit), I could maybe help. – Grzegorz Grzybek Aug 16 '18 at 11:22
  • Thanks for the offer. Here's a simplified example: Download Fuse 7.0.0 (Karaf Installer, 175MB). Edit etc/org.apache.karaf.features.cfg. Add camel-hl7/2.21.0.fuse-000077-redhat-1 to the end of the featuresBoot list, after transaction-manager-narayana. Save file. Start fuse.bat... try 'list' or 'features:list' or check the logs. No 'hl7', camel-hl7 still uninstalled. – djb Aug 16 '18 at 15:45
  • Any idea? featuresBoot doesn't work in Linux or Windows, for me. – djb Aug 27 '18 at 12:38
  • works for me... is `etc/org.apache.karaf.features.cfg` the one you've shown before? – Grzegorz Grzybek Aug 28 '18 at 13:09
  • Yeah. Pretty bizarre. I literally just DL from the website, change that file, save, and start fuse, and the feature isn't installed. – djb Aug 29 '18 at 08:30
  • Again, I checked your steps - I downloaded the distro from https://developers.redhat.com/products/fuse/download/, unzipped, didn't run `bin/fuse` yet, added 3 entries to `etc/org.apache.karaf.features.cfg`, started using `bin/fuse` and I saw both the bundles and features installed... – Grzegorz Grzybek Sep 03 '18 at 06:15
  • Ok thanks for trying. I will start again from scratch. Maybe I did something stupid. – djb Sep 03 '18 at 10:46
2

Mystery solved. Ugh, indeed this is stupid--albeit, not on our part, I would argue.

The error is a trailing space, following the line continuation backslash on the line above the one where your 'missing' features are. I found this in my org.apache.karaf.features.cfg, and verified it as the culprit. I also see it in what is presumably a copy-paste of a snippet of yours.

    transaction-manager-narayana/5.7.2.Final, \ 
                                               ^
                                               |
                                               here

I feel like it is a major oversight in the Karaf code. Presumably the config-admin service has some format rules--so that is probably the place to address it. If it would at least log an error, that would be good.

Hans.Loven.work
  • 108
  • 1
  • 6