Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D8FF2200D0B for ; Tue, 12 Sep 2017 19:41:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D7A2A1609B4; Tue, 12 Sep 2017 17:41:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2C0DB1609C8 for ; Tue, 12 Sep 2017 19:41:06 +0200 (CEST) Received: (qmail 19345 invoked by uid 500); 12 Sep 2017 17:41:04 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 19333 invoked by uid 99); 12 Sep 2017 17:41:04 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2017 17:41:04 +0000 Received: from Prometheus2.local (unknown [64.129.229.106]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id BCAD01A0015; Tue, 12 Sep 2017 17:41:03 +0000 (UTC) From: Carsten Ziegeler Subject: Re: [RT] Context-Aware Services - Multitenancy for SPI implementations To: dev@sling.apache.org, Stefan Seifert References: <0f1512a2205a44d79a594fc299d9c070@mailx01.intern.pro-vision.de> Message-ID: <8ccb5e9c-6d19-10b2-69d9-1817ea192592@apache.org> Date: Tue, 12 Sep 2017 10:41:02 -0700 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; de; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: <0f1512a2205a44d79a594fc299d9c070@mailx01.intern.pro-vision.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit archived-at: Tue, 12 Sep 2017 17:41:07 -0000 Hi Stefan this is definitely an interesting approach. I can see the potential, but so far I haven't really seen use cases (which doesn't mean there are non). If I understand correctly, you do the matching based on the path which avoids the need of introducing an explicit concept of a tenant. On the other it requires you to have a corresponding resource or request. I assume for most of the use cases this works as they are request bound anyway. And even for background tasks you should have at least some resource. I guess this should be sufficient. I'm a little bit worried about the reliability, for example if a bundle providing a specifc SPI interface is currently not active, you get (temporarily) a different result. This might be fine as well. In general, I'm unsure :) this sounds useful, but of course complicates things and the general execution. Regards Carsten Stefan Seifert wrote > consider the following use case: > - an OSGi/Sling-based library provides a SPI interface > - applications of multiple tenants are deployed on the same instance > - each tenant uses a different content tree, e.g. /content/tenant1 and /content/tenant2 > - each tenant's application wants to register a different implementation of the SPI, to be applied on resource requests on the tenant's content subtree > - this affects not only one SPI but multiple SPIs > - we do not want to implement a detect-the-matching-SPI-implementation-for-a-given resource for each library again > - we want to have a configuration of the mapping tenant's resource path -> SPI implementation in a central place and to be applied to all SPI implementation of a tenant's application > > i've implemented a solution for this some months ago, it's currently part of a wcm.io library. > documentation [1], source code [2] > > questions: > 1. do you have these use cases as well? (we had a lot of enterprise projects where we needed exactly this in the last years) > 2. does it make sense to contribute it to sling? > 3. do you have better ideas for configuring the mapping or the implementation? > > stefan > > [1] http://wcm.io/sling/commons/context-aware-services.html > [2] https://github.com/wcm-io/wcm-io-sling/tree/develop/commons/src/main/java/io/wcm/sling/commons/caservice > > >   -- Carsten Ziegeler Adobe Research Switzerland cziegeler@apache.org