0

I am using karaf 3.0.1 with my bundle (https://github.com/johanlelan/camel-cxfrs-blueprint-example). I want to manage properties at runtime but I see that config:update does not create file on /etc, why?

<cm:property-placeholder persistent-id="org.apache.camel.examples.cxfrs.blueprint"
    update-strategy="reload">
    <!-- list some properties for this test -->
    <cm:default-properties>
        <cm:property name="cxf.application.in"
            value="cxfrs:bean:rest.endpoint?throwExceptionOnFailure=false&amp;bindingStyle=SimpleConsumer&amp;loggingFeatureEnabled=true"/>
        <cm:property name="common.tenant.in" value="direct-vm:common.tenant.in"/>
        <cm:property name="common.authentication.in" value="direct-vm:common.authentication.in"/>
        <cm:property name="application.put.in" value="direct-vm:application.putById"/>
        <cm:property name="application.post.in"
            value="direct-vm:application.postApplications"/>
        <cm:property name="log.trace.level" value="INFO"/>
    </cm:default-properties>
</cm:property-placeholder>

In karaf I try to modify an endpoint url:

karaf@root()> config:edit org.apache.camel.examples.cxfrs.blueprint
karaf@root()> config:property-set common.tenant.in direct-vm:test
karaf@root()> config:property-list
   service.pid = org.apache.camel.examples.cxfrs.blueprint
   common.tenant.in = direct-vm:test
   felix.fileinstall.filename = file:/F:/travail/servers/karaf-lan/etc/org.apache.camel.examples.cxfrs.blueprint.cfg    
karaf@root()> config:update
karaf@root()>

I precise that my bundle is updated after config:update but no file exists in /etc... I think it works in karaf 2.3.5.

Johan Le Lan
  • 47
  • 1
  • 8

2 Answers2

1

Configurations are persisted by the ConfigurationAdmin service. If you are using Karaf, it uses the implementation from Felix ConfigAdmin [1]. By default Karaf configures ConfigAdmin to store files in its local bundle storage area under /data, but that can be changed by editing the felix.cm.dir property.

Also, the support for the .cfg files comes from Felix FileInstall [2].

[1] http://felix.apache.org/documentation/subprojects/apache-felix-config-admin.html [2] http://felix.apache.org/site/apache-felix-file-install.html

mjmeno
  • 76
  • 1
  • 2
1

It is a known issue at karaf 3.0.1

You may use apache karaf 3.0.2 that this bug is fixed.