开发者

Can I use Distributed OSGi and ConfigurationAdmin together?

If:

  • I have a bundle I wish to run on n OSGi containers exporting some service;
  • I am using DS to开发者_JS百科 register the modified method for when configuration changes, so I can update the service via ConfigurationAdmin, and to export the interfaces remotely as per RFC119;
  • I am using Discovery to call those services from other bundles on other boxes, is it possible to have a central configuration for this service using ConfigurationAdmin, so that I can publish a configuration change via the Configuration Admin and it is received by all instances of the service running?

It seems from everything that I have read that ConfigurationAdmin is not network aware, and is local to each OSGi container?

Thanks for your insight in advance :)


So your bundle runs on N containers, exports its service to that local container only, and it exports ManagedService using remote services to publish it to some "central" container that has ConfigurationAdmin running?

You are right that ConfigurationAdmin is not network aware, but if the bundle remotely publishes its ManagedService to that container running Configuration Admin it should work. The only caveat is that each ManagedService must have a unique service PID so you cannot simply publish the same bundle in N containers unless you ensure that each instance ends up using a unique PID.


You should probably check out Karaf Cellar. It provides cluster support for OSGi applications and synchronizes configuration changes across nodes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜