karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Winnall <st...@winnall.ch>
Subject Re: communication between Cellar instances
Date Sun, 07 May 2017 11:47:54 GMT
Hi JB

Thanks for this, it helps a lot! The documentation at docs.hazelcast.org seem to answer most
of my follow-up questions.

It's immensely valuable having someone point you in the right direction. Thanks.

Steve


> On 7 May 2017, at 07:57, Jean-Baptiste Onofré <jb@nanthrax.net> wrote:
> 
> Hi Steve,
> 
> In your code, you can use the Cellar Hazelcast instance (exposed as a service). Then,
you can store the data (shared between Cellar nodes) using a distributed list (or map or set).
NB: the class you put in the distributed resources has to implement Serializable.
> 
> For instance:
> 
> ServiceReference ref = bundleContext.getServiceReference(HazelcastInstance.class);
> HazelcastInstance cellar = bundleContext.getService(ref);
> List distributedList = cellar.getList("name");
> // add an element to the list
> distributedList.add(new MySerializableClass());
> // it's available on the other nodes
> 
> Cellar uses this internally to store the state of the features, bundles, config, DOSGi,
etc.
> 
> Regards
> JB
> 
>> On 05/06/2017 11:28 PM, Stephen Winnall wrote:
>> Is there a way for instances within a Cellar cluster to communicate with each other
and exchange data? I’d like to be able to associate objects with specific instances but
still allow other instances to retrieve objects via other instances in the cluster.
>> 
>> Steve
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com


Mime
View raw message