当前位置: 动力学知识库 > 问答 > 编程问答 >

How to use OSGi to achieve Multi tenancy? Can any one explain

问题描述:

Recently we are trying to implement multitenancy using OSGi framework... am unable to proceed, how to start multi tenancy using OSGi? Can anyone post related information for developing multi tenancy...

Thanks

网友答案:

Until recently OSGi did not have an official answer to that, but that changed with the 'subsystems' specification in OSGi 5.

David Bosschaert wrote a nice article about it:

http://coderthoughts.blogspot.nl/2013/04/osgi-subsystems.html

Mind you, this stuff is far from mainstream yet, so you might run into some early adopter problems, if you are on a tight schedule I'd advise against it.

Alternatively, you could look at:

  • Apache Karaf instances. Apache Karaf is a lightweight OSGi container and can create nested instances which can share code / services with their parents.
  • Nest OSGi instances yourself. Starting an OSGi yourself is actually not that heavy weight, and you can choose which packages and services you want to share with the child instances.
网友答案:

By far the easiest solution is to just start a framework per instance. OSGi is NOT an app server and trying to (ab)use it like a general app server means you do not the the idea behind OSGi. OSGi is a way to organize an application so you can build (large) apps out of reusable components.

网友答案:

In general I agree with Peter about the fact that in many cases just starting multiple frameworks is by far the easiest way. There are some downsides however (mostly in the area of deployment).

The Amdatu project has a way to use multi tenancy at the OSGi services level. You can basically modify an existing bundle to become multi tenant without any actual code changes. Documentation can be found on the website: https://amdatu.org/application/multitenancy/

分享给朋友:
您可能感兴趣的文章:
随机阅读: