You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Ronny Bräunlich <r....@gmail.com> on 2015/01/03 20:38:29 UTC

Re: Sharing configuration with Cellar

Hello Jean-Baptiste,

did you make the change so that the factoryPid gets shared?
If yes, do I have to set a certain property?

Cheers,
Ronny

Am 23.12.2014 um 08:38 schrieb Jean-Baptiste Onofré <jb...@nanthrax.net>:

Hi Ronny,

No, it mean that the PID are normally created on the fly right ? So locally to one node.

Let me build a SNAPSHOT without the factoryPid filtering, you will be able to test it. I keep you posted.

Regards
JB

On 12/23/2014 08:28 AM, Ronny Bräunlich wrote:
> Hi Jean-Baptiste,
> 
> I was using version 3.0.0 and I don't mind using a SNAPSHOT versionsince
> it's only my free time project ;)
> 
> So, what you're saying is, that it would be better if a bundle would
> create the properties and pass them to the configuration admin than a
> *.cfg file in the /etc directory?
> 
> Cheers,
> Ronny
> 
> 2014-12-23 8:10 GMT+01:00 Jean-Baptiste Onofré <jb@nanthrax.net
> <ma...@nanthrax.net>>:
> 
>    Hi Ronny,
> 
>    which version of Cellar do you use ?
> 
>    Do you mind to make a quick test with a SNAPSHOT ?
> 
>    Basically, the reason for filtering the factoryPid is that normally,
>    they are local to a node (they are created locally), so not sure if
>    it makes sense to sync it as it should be created by the bundle/factory.
> 
>    Regards
>    JB
> 
> 
>    On 12/23/2014 07:04 AM, Ronny Bräunlich wrote:
> 
>        Hi Achmin, hi Jean-Baptiste,
> 
>        thank you for your quick responses.
>        Please, you could explain to me why the service.factoryPid was
>        excluded and why you think that I shouldn't use a config-factory?
> 
>        What I try to achive is that on one Karaf instance the service gets
>        configured and the ManagedServiceFactory on every Karaf creates the
>        same service. That ways I hope to achieve better scaling (at
>        least in
>        my mind ;) ) because the service exists several times.
> 
>        Cheers,
>        Ronny
> 
>        PS. Happy holidays guys!
> 
>        2014-12-22 21:22 GMT+01:00, Jean-Baptiste Onofré
>        <jb@nanthrax.net <ma...@nanthrax.net>>:
> 
>            Hi Ronny,
> 
>            as you can see in the Cellar ConfigurationSupport:
> 
>            private static String[] EXCLUDED_PROPERTIES =
>            {"service.factoryPid",
>            "felix.fileinstall.filename", "felix.fileinstall.dir",
>            "felix.fileinstall.tmpdir",
>            "org.ops4j.pax.url.mvn.__defaultRepositories"};
> 
>            The service.factoryPid is not sync by Cellar: it's an
>            expected behavior
>            as it doesn't make sense to sync it: the main configuration
>            should
>            create the pid.
> 
>            I created a Jira to let the user configure the excluded
>            properties (as
>            his own risk).
> 
>            If your configuration is a regular conf, it should be sync
>            without
>            problem by Cellar. I don't think it's a good idea to sync
>            config factory
>            (and use config factory generally speaking ;))
> 
>            Let me implement the command to allow you to change the excluded
>            properties.
> 
>            Regards
>            JB
> 
>            On 12/22/2014 09:10 PM, Ronny Bräunlich wrote:
> 
>                Hi all,
> 
>                I know I already had some similar question but I think I
>                am getting
>                closer to the real problem.
>                There is an example project, too, which you can find here:
>                https://github.com/__rbraeunlich/karaf-managed-__service-factory-example
>                <https://github.com/rbraeunlich/karaf-managed-service-factory-example>
> 
>                Basically I have two Karaf instances synchronized with
>                the help of
>                Cellar.
>                In the etc/ directory I placed a file
>                named de.blogspot.wrongtracks.__simple.factory.Factory-1.cfg
>                The log of the first Karaf shows the expected log entries:
>                "Got pid:
>                de.blogspot.wrongtracks.__simple.factory.Factory.__6b9773c4-a828-4ddc-bbdc-__ecbdd99535cb
>                with following dictionary.“
>                Unfortunately, the second Karaf doesn’t want to
>                participate. The
>                configuration arrived (visible via config:list
>                "(service.pid=de.blogspot*)“ but no log entries are visible.
>                Shouldn’t the second factory write the log entries, too?
> 
>                Cheers,
>                Ronny
> 
> 
>            --
>            Jean-Baptiste Onofré
>            jbonofre@apache.org<ma...@apache.org>
>            http://blog.nanthrax.net
>            Talend - http://www.talend.com
> 
> 
>    --
>    Jean-Baptiste Onofré
>    jbonofre@apache.org <ma...@apache.org>
>    http://blog.nanthrax.net
>    Talend - http://www.talend.com
> 
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: Sharing configuration with Cellar

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hey Ronny,

I did the change to let you tweak the property that you want to exclude.
I push and publish a SNAPSHOT for you.

Regards
JB

On 01/03/2015 08:38 PM, Ronny Bräunlich wrote:
> Hello Jean-Baptiste,
>
> did you make the change so that the factoryPid gets shared?
> If yes, do I have to set a certain property?
>
> Cheers,
> Ronny
>
> Am 23.12.2014 um 08:38 schrieb Jean-Baptiste Onofré <jb@nanthrax.net
> <ma...@nanthrax.net>>:
>
> Hi Ronny,
>
> No, it mean that the PID are normally created on the fly right ? So
> locally to one node.
>
> Let me build a SNAPSHOT without the factoryPid filtering, you will be
> able to test it. I keep you posted.
>
> Regards
> JB
>
> On 12/23/2014 08:28 AM, Ronny Bräunlich wrote:
>> Hi Jean-Baptiste,
>>
>> I was using version 3.0.0 and I don't mind using a SNAPSHOT versionsince
>> it's only my free time project ;)
>>
>> So, what you're saying is, that it would be better if a bundle would
>> create the properties and pass them to the configuration admin than a
>> *.cfg file in the /etc directory?
>>
>> Cheers,
>> Ronny
>>
>> 2014-12-23 8:10 GMT+01:00 Jean-Baptiste Onofré <jb@nanthrax.net
>> <ma...@nanthrax.net>
>> <ma...@nanthrax.net>>:
>>
>>    Hi Ronny,
>>
>>    which version of Cellar do you use ?
>>
>>    Do you mind to make a quick test with a SNAPSHOT ?
>>
>>    Basically, the reason for filtering the factoryPid is that normally,
>>    they are local to a node (they are created locally), so not sure if
>>    it makes sense to sync it as it should be created by the
>> bundle/factory.
>>
>>    Regards
>>    JB
>>
>>
>>    On 12/23/2014 07:04 AM, Ronny Bräunlich wrote:
>>
>>        Hi Achmin, hi Jean-Baptiste,
>>
>>        thank you for your quick responses.
>>        Please, you could explain to me why the service.factoryPid was
>>        excluded and why you think that I shouldn't use a config-factory?
>>
>>        What I try to achive is that on one Karaf instance the service gets
>>        configured and the ManagedServiceFactory on every Karaf creates the
>>        same service. That ways I hope to achieve better scaling (at
>>        least in
>>        my mind ;) ) because the service exists several times.
>>
>>        Cheers,
>>        Ronny
>>
>>        PS. Happy holidays guys!
>>
>>        2014-12-22 21:22 GMT+01:00, Jean-Baptiste Onofré
>>        <jb@nanthrax.net <ma...@nanthrax.net>>:
>>
>>            Hi Ronny,
>>
>>            as you can see in the Cellar ConfigurationSupport:
>>
>>            private static String[] EXCLUDED_PROPERTIES =
>>            {"service.factoryPid",
>>            "felix.fileinstall.filename", "felix.fileinstall.dir",
>>            "felix.fileinstall.tmpdir",
>>            "org.ops4j.pax.url.mvn.__defaultRepositories"};
>>
>>            The service.factoryPid is not sync by Cellar: it's an
>>            expected behavior
>>            as it doesn't make sense to sync it: the main configuration
>>            should
>>            create the pid.
>>
>>            I created a Jira to let the user configure the excluded
>>            properties (as
>>            his own risk).
>>
>>            If your configuration is a regular conf, it should be sync
>>            without
>>            problem by Cellar. I don't think it's a good idea to sync
>>            config factory
>>            (and use config factory generally speaking ;))
>>
>>            Let me implement the command to allow you to change the
>> excluded
>>            properties.
>>
>>            Regards
>>            JB
>>
>>            On 12/22/2014 09:10 PM, Ronny Bräunlich wrote:
>>
>>                Hi all,
>>
>>                I know I already had some similar question but I think I
>>                am getting
>>                closer to the real problem.
>>                There is an example project, too, which you can find here:
>> https://github.com/__rbraeunlich/karaf-managed-__service-factory-example
>>                <https://github.com/rbraeunlich/karaf-managed-service-factory-example>
>>
>>                Basically I have two Karaf instances synchronized with
>>                the help of
>>                Cellar.
>>                In the etc/ directory I placed a file
>>                named
>> de.blogspot.wrongtracks.__simple.factory.Factory-1.cfg
>>                The log of the first Karaf shows the expected log entries:
>>                "Got pid:
>>
>> de.blogspot.wrongtracks.__simple.factory.Factory.__6b9773c4-a828-4ddc-bbdc-__ecbdd99535cb
>>                with following dictionary.“
>>                Unfortunately, the second Karaf doesn’t want to
>>                participate. The
>>                configuration arrived (visible via config:list
>>                "(service.pid=de.blogspot*)“ but no log entries are
>> visible.
>>                Shouldn’t the second factory write the log entries, too?
>>
>>                Cheers,
>>                Ronny
>>
>>
>>            --
>>            Jean-Baptiste Onofré
>> jbonofre@apache.org
>> <ma...@apache.org>
>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>            Talend -http://www.talend.com <http://www.talend.com/>
>>
>>
>>    --
>>    Jean-Baptiste Onofré
>> jbonofre@apache.org
>> <ma...@apache.org>
>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>    Talend -http://www.talend.com <http://www.talend.com/>
>>
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org <ma...@apache.org>
> http://blog.nanthrax.net <http://blog.nanthrax.net/>
> Talend -http://www.talend.com <http://www.talend.com/>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com