Pavel, as I haven't coded in scala, this will take some digesting.
On Wed, Nov 18, 2015 at 1:30 PM, Pavel E. Shirshov <[email protected]> wrote: > That's exactly my sample about. > > It's simple idea how to implement complex config over Karaf k-v storage. > Even with dynamic reload. Just look at the gist. > > On 18/11/15 18:12, Benson Margulies wrote: >> I realize that I forgot to supply the motivation for this question. >> >> So long as the configuration is read-only (set up at >> karaf-assembly-build time), then there's really nothing objectionable >> about .cfg -> .yaml. I've started to think about the possibility of >> allowing for people to push changed configuration into the running >> system. I could arrange this as 'new yaml file, tell config-admin new >> prop value' and that would work, but I found myself wondering if >> anyone had a scheme other than that or flattening. >> >> >> On Wed, Nov 18, 2015 at 12:54 PM, Pavel E. Shirshov <[email protected]> >> wrote: >>> Any complex structure may be flattened. >>> >>> Example for HOCON: https://gist.github.com/FeiWongReed/44799f4461c43f8e83c2 >>> >>> On 18/11/15 17:44, Benson Margulies wrote: >>>> On Wed, Nov 18, 2015 at 12:39 PM, Jean-Baptiste Onofré <[email protected]> >>>> wrote: >>>>> Hi Benson, >>>>> >>>>> It's something that we do in Decanter (with elasticsearch.yaml, but it's >>>>> just a load), or in Cellar (with Hazelcast XML parsing), or in Pax Web >>>>> (when >>>>> refering the jetty.xml). >>>>> >>>>> What do you mean exactly ? You want to load the yaml configuration in >>>>> ConfigAdmin ? In that case, it's possible in an adapter. >>>>> >>>>> Please, can you elaborate a bit ? >>>> Here's what I do now, which might be the same as you: >>>> >>>> foo.cfg >>>> workerConfig=${karaf.etc}/worker-config.yaml >>>> >>>> Here's what I was wondering about: could I arrange for foo.'cfg' to >>>> actually be a YAML file, and use Jackson to parse it so that the >>>> <String, Object> dictionaries would contain interesting objects. >>>> >>>> Can you point me at more reading about 'adapters'? That sounds like >>>> the line I would want to follow. >>>> >>>> >>>> >>>> >>>>> Thanks, >>>>> Regards >>>>> JB >>>>> >>>>> >>>>> On 11/18/2015 06:36 PM, Benson Margulies wrote: >>>>>> I've got some cases where I made a .cfg file point to a .yaml file >>>>>> because I had a complex configuration. The API to config admin sort of >>>>>> suggests that it might be possible to have more complex data >>>>>> structures so long as the top-level is key-value; is this actually >>>>>> doable, and, if so, how? >>>>>> >>>>> -- >>>>> Jean-Baptiste Onofré >>>>> [email protected] >>>>> http://blog.nanthrax.net >>>>> Talend - http://www.talend.com >>> > >
