I'm not sure he's looking for clustering, he's looking for multi-tenant
support which is very different where the bundle is essentially aware of
the context it's being called in.

We use Karaf in a multi-tenant environment, and at the moment I know of no
way in Karaf to support multi-tenant calls. Honestly, Karaf doesn't really
have any context about who is making the call to a service out of the box.
To make it work for us we use Apache Shiro to authenticate our users as
they make requests into the OSGI context (CXF is our endpoint into OSGI
services). We expose the Shiro security manager as an OSGI service which
all the bundles have access to and are able to determine the user/tenant
the current thread is being executed on behalf of. It's not perfect because
it's based on ThreadLocal variables but it does work in most scenarios.
We've also written a custom Camel RoutePolicy that is able to also query
our Shiro service to determine what user/tenant a route is executing on
behalf of. This becomes very complicated if services/routes spawn threads
so we avoid that. It's also critical you have clean-up code so that when a
call ends the ThreadLocal stuff is cleaned up and not passed onto the next
call.

BTW - this doesn't allow you to run separate bundle instances per client,
it scopes each execution thread through a shared instance.

I would personally love to see more user/tenant context awareness at the
Karaf/Camel/ActiveMQ level but it's just not there yet and I haven't
figured out the right way to do it either at the container level. I'm still
pondering it.

Chris


On Wed, Aug 28, 2013 at 7:24 AM, Claus Ibsen <[email protected]> wrote:

> Celler is not *the* clustering solution, its *a* clustering solution ;)
>
> There is others on the open source market, such as fuse fabric
> http://fabric.fusesource.org/
>
> On Wed, Aug 28, 2013 at 4:15 PM, Achim Nierbeck <[email protected]>
> wrote:
> > You might be interested in taking a look at Karaf Cellar,
> > it's the clustering solution for Karaf.
> >
> > regards, Achim
> >
> >
> > 2013/8/28 amitsaini1976 <[email protected]>
> >>
> >> Hi,     Need some help/tips to have tenant aware bundles running in the
> >> karaf
> >> instance.Do we have any road map to support multi-tenancy like Gyrex or
> >> Amdatu*Gyrex*Multi-tenancy - A contextual runtime implemented right at a
> >> platform level enables application developer to run business logic in
> >> multiple instances for multiple tenants. Customization and extensibility
> >> is
> >> support using OSGi Services and Equinox Extension Points.How the
> Subsystem
> >> Specification can help in multi-tenancy.
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://karaf.922171.n3.nabble.com/Karaf-Multitenancy-Support-like-Gyrex-tp4029553.html
> >> Sent from the Karaf - User mailing list archive at Nabble.com.
> >
> >
> >
> >
> > --
> >
> > Apache Karaf <http://karaf.apache.org/> Committer & PMC
> > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer
> &
> > Project Lead
> > OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
> > Commiter & Project Lead
> > blog <http://notizblog.nierbeck.de/>
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: [email protected]
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

Reply via email to