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 F1DD4200CD9 for ; Thu, 3 Aug 2017 08:27:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EF6C816AF16; Thu, 3 Aug 2017 06:27:08 +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 1AFDB16AF12 for ; Thu, 3 Aug 2017 08:27:07 +0200 (CEST) Received: (qmail 52392 invoked by uid 500); 3 Aug 2017 06:27:07 -0000 Mailing-List: contact dev-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list dev@karaf.apache.org Received: (qmail 52380 invoked by uid 99); 3 Aug 2017 06:27:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2017 06:27:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 37B4FC1B65 for ; Thu, 3 Aug 2017 06:27:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id PecapZjPyHYS for ; Thu, 3 Aug 2017 06:26:54 +0000 (UTC) Received: from mail-qt0-f178.google.com (mail-qt0-f178.google.com [209.85.216.178]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C05835FB06 for ; Thu, 3 Aug 2017 06:26:53 +0000 (UTC) Received: by mail-qt0-f178.google.com with SMTP id p3so2416530qtg.2 for ; Wed, 02 Aug 2017 23:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=LpzYUlwrIM+XFGVc/hxTxo96Guvo+1+sZIWWbKmOT0A=; b=EcHAfnYw1+MuTDrhbyw/Dnv3Bjdg1/cG312E5HZz8jjWmwUtOLTLNmEZ7BwmBqgyi2 X2Al2/DJ3ETvXphmK7NFzm50b5jpvxhiTYNnUXQPV2DofY+nnLFrWcwBOm/aNCMu6Ugo Y2uRqKNo9c3G4Qgw/Pf38P5QkledreR+iLup9iF+RISLa2x6MZfcXsdQWRKuLeV6gtzo tuWI/0bIAcp/omMqzt5wnRc4FKrkJaL673pNaLlXu6WNgNfq/Kn/MrDXqlsW5oY38XhE CoOmnJRRQuJOejhNEMj5o3vfpjJcvawzWeHOOrEao1v/6p3GWQi/Kz2ylebLNNzcD6Gx 8PbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=LpzYUlwrIM+XFGVc/hxTxo96Guvo+1+sZIWWbKmOT0A=; b=YdFG7sL8z/20/IgqxO0osAGWeKyPGmKMVZwqNjmKsWGMVNeoBd6bWyFaygrb9Nx+dQ 8wu7XFYBgE2O/6Uk41D3f2IZCcxX3x3S+kw/yb+ZsZxg7jHD2etrfV0hkFXqEgVFEVgT /4XyfHBgUFWo9YredvqcjlOGoX0gwfTrDyll4EZMOpWZkOxGP7FKif75E5MhUJCpJ5LH ODQgBDeyw1Y851FBZHJcFqCrg6OuzmR0UhH7KAM4lfnqtP8KowXohzjpAlV2yFjGL6rZ bf3O0dXJBcgsNllDOd53XvTudf/Zh0lJmTaZtrKsClrbOgFLBL2spl57+EjwC50EU8DG p7ag== X-Gm-Message-State: AIVw1132UVi+cP+ULbMadAkcLMNjWbcbSkI02GG8rzJuq3tri9kZRMf4 UKUatY2JtOIPnT+Z+RdGyNtbCjlbq1fgEDY= X-Received: by 10.200.41.45 with SMTP id y42mr846264qty.54.1501741591006; Wed, 02 Aug 2017 23:26:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.24.17 with HTTP; Wed, 2 Aug 2017 23:26:30 -0700 (PDT) In-Reply-To: <08443db5-ec7d-7106-0e41-2c8e9e8faff3@nanthrax.net> References: <9518195e-14c9-53ee-0c12-86cf3830e790@die-schneider.net> <08443db5-ec7d-7106-0e41-2c8e9e8faff3@nanthrax.net> From: Luca Burgazzoli Date: Thu, 3 Aug 2017 08:26:30 +0200 Message-ID: Subject: Re: [Proposal] New subproject rcomp - Reactive components framework To: dev@karaf.apache.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable archived-at: Thu, 03 Aug 2017 06:27:09 -0000 In camel there is now a camel-reactive-streams component that bridges camel and reactive-streams specs so the integration with the proposed subproject should be easy. There is also a camel-reactor and - I hope soon - a camel-rxjava2 component to provide an implementation of the camel-reactive-streams api based on reactor or rxjava2. Maybe we could have a new "camel-rcomp" component to ease the integration. --- Luca Burgazzoli On Thu, Aug 3, 2017 at 8:02 AM, Jean-Baptiste Onofr=C3=A9 = wrote: > Hi Christian, > > the proposal is interesting, and I see a first potential use in Decanter = for > sure. > > The comment about Camel is fair as it looks very similar at first glance. > > However, the scope is slightly different IMHO. > > I checked about the legal. The code should be cleanup for donation (ASF > headers, package names, ...). About the dependency license, for the > reactive-streams, it' OK as it uses Creative Commons Zero into the Public > Domain. And Reactor is already under Apache license. > > The DSL is a hot topic. I understand that leveraging Akka or Reactor is > easier, but I'm a bit concern that we could be too much "coupled". > Maybe our own simple DSL could help. Thoughts ? > > Thanks anyway ! > Regards > JB > > > On 07/19/2017 01:02 PM, Christian Schneider wrote: >> >> >> Scope >> >> I recently experimented with reactive streams and built a small componen= t >> framework on top of this spec. >> See https://github.com/cschneider/reactive-components >> >> The goal is to have a small API that can encapsulate a protocol and >> transport. The code using such a reactive component should not directly >> depend on the specifics of the transport or protocol. Another goal is to >> have reactive features like back pressure. Ultimately I am searching for >> something like Apache Camel Components but with a lot less coupling. In >> camel the big problem is that components depend on camel core which >> unfortunately is much more than a component API. So any camel component = is >> coupled quite tightly to all of camel core. >> >> >> Proposal >> >> I propose to donate my code to Apache and establish this as a Apache Kar= af >> sub project. Some people like Jean-Baptiste and Hadrian have already >> expressed that they support this and I hope for some more feedback and h= elp. >> >> I chose the Karaf project at the moment but am also open to placing this >> in another Apache project. Some matching projects would be Apache Camel, >> Aries or Felix. >> >> >> Component API >> >> I was trying to find the simplest API that would allow similar component= s >> to camel in one way mode. >> >> public interface RComponent { >> Publisher from(String destination, Class type); >> Subscriber to(String destination, Class type); >> } >> >> A component is a factory for Publishers and Subscribers. From and to hav= e >> similar meaning as in camel. The component can be given a source / targe= t >> type to produce / consume. So with the OSGi Converter spec this would al= low >> to have type safe messaging without coding the conversion in every >> component. Each component is exposed as a service which encapsulates mos= t of >> the configuration. All endpoint specific configuration can be done using= the >> destination String. >> >> Publisher and Subscriber are interfaces from the reactive streams api >> (http://www.reactive-streams.org/). So they are well defined and have ze= ro >> additional dependencies. >> >> I also considered to use OSGi push streams which is an OSGi spec and wou= ld >> also be an interesting foundation. I decided against that though as push >> streams have no API that is separate from the DSL and will probably not = be >> used a lot outside of OSGi. >> >> See the examples for how to use this in practice. >> https://github.com/cschneider/reactive-components >> >> >> Possible use cases >> >> Two big use cases are reactive microservices that need messaging as well >> as plain camel like integrations. >> Another case are the Apache Karaf decanter collectors and appenders. >> Currently they use a decanter specific API but they could easily be >> converted into the more general rcomp api. >> We could also create a bridge to camel components to leverage the many >> existing camel components using the rcomp API as well as offering rcomp >> components to camel. >> >> Components alone are of course not enough. One big strength of Apache >> Camel is the DSL. In case of rcomp I propose to not create our own DSL a= nd >> instead use existing DSLs that work well in OSGi. Two examples: >> >> Akka and reactive streams >> https://de.slideshare.net/ktoso/reactive-integrations-with-akka-streams >> >> Reactor and reactive streams >> >> https://de.slideshare.net/StphaneMaldini/reactor-30-a-reactive-foundatio= n-for-java-8-and-spring >> >> Another integration is with REST. It is already possible to integrate CX= F >> Rest services with reactive streams using some adapters but we could hav= e >> native integration. >> >> >> Risks and Opportunities >> >> The main risk I see is not gathering a critical mass of components to dr= aw >> more people. >> Another risk is that the RComponent API or the reactor streams have some >> unexpected limitations. >> The big opportunity I see is that the rcomp API is very simple so the >> barrier of entry is low. >> I also hope that this might become a new foundation for a simpler and mo= re >> modern Apache Camel. >> >> So this all depends on getting some support by you all. >> >> Christian >> >> > > -- > Jean-Baptiste Onofr=C3=A9 > jbonofre@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com