我可以同时使用分布式 OSGi 和 ConfigurationAdmin 吗?

发布于 2024-08-28 16:36:27 字数 360 浏览 10 评论 0原文

如果:

  • 我有一个捆绑包,希望在 n 个导出某些服务的 OSGi 容器上运行;
  • 我使用 DS 注册配置更改时的修改方法,这样我就可以通过 ConfigurationAdmin 更新服务,并根据 RFC119 远程导出接口;
  • 我正在使用 Discovery 从其他盒子上的其他捆绑包中调用这些服务, 是否可以使用 ConfigurationAdmin 对此服务进行集中配置,以便我可以通过配置管理发布配置更改,并且运行的服务的所有实例都会收到该更改?

从我读到的所有内容看来,ConfigurationAdmin 不支持网络感知,并且对于每个 OSGi 容器来说都是本地的?

感谢您提前提供的见解:)

If:

  • I have a bundle I wish to run on n OSGi containers exporting some service;
  • I am using DS to 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 :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

霞映澄塘 2024-09-04 16:36:27

因此,您的捆绑包在 N 个容器上运行,仅将其服务导出到该本地容器,并使用远程服务导出 ManagedService 以将其发布到某个运行 ConfigurationAdmin 的“中央”容器?

您说得对,ConfigurationAdmin 不支持网络感知,但如果捆绑包将其 ManagedService 远程发布到运行 Configuration Admin 的容器,它应该可以工作。唯一需要注意的是,每个 ManagedService 必须有一个唯一的服务 PID,因此您不能简单地在 N 个容器中发布相同的包,除非您确保每个实例最终都使用唯一的 PID。

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.

苍白女子 2024-09-04 16:36:27

您可能应该查看 Karaf Cellar。它为 OSGi 应用程序提供集群支持并跨节点同步配置更改。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文