From dev-return-98633-archive-asf-public=cust-asf.ponee.io@kafka.apache.org Sun Sep 30 21:31:39 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9F95D18064A for ; Sun, 30 Sep 2018 21:31:38 +0200 (CEST) Received: (qmail 13623 invoked by uid 500); 30 Sep 2018 19:31:37 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 13611 invoked by uid 99); 30 Sep 2018 19:31:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Sep 2018 19:31:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 0F43E1A157F for ; Sun, 30 Sep 2018 19:31:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.888 X-Spam-Level: * X-Spam-Status: No, score=1.888 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd2-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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 8Fpe2QRuUTfZ for ; Sun, 30 Sep 2018 19:31:35 +0000 (UTC) Received: from mail-oi1-f196.google.com (mail-oi1-f196.google.com [209.85.167.196]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C53C65F3ED for ; Sun, 30 Sep 2018 19:31:34 +0000 (UTC) Received: by mail-oi1-f196.google.com with SMTP id a203-v6so9511681oib.0 for ; Sun, 30 Sep 2018 12:31:34 -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; bh=i9NOKIfJVa4Ie3h3KXyFPpA4+LQyldIaDudg/PbB8PA=; b=uznX9TIALZ/NoV7to4X3bEz610hZEKpzqaeF3qq8agKzHCyGyYB0+lIYf9cL/j5u1q t0poW6gIpLME396zwK7SLRh/GYdO+e5GOnfRNCjQMJCTfOZwPZUN0tTeFhJNS+ArHJpd YTB8Sndfuti7ejdIg5kvbRg0aMDV2Tm+R7Jdbgm7jSeBLHoL4GgMuM+GfY5592HAmB/v k6IV02tBUBIlUn4Hhn9+fY7MwtT52wkokggGxc30e3F5VXZaJTsiLV0twxEv4Zkh83+D b/KNbw37YcP2dDqncwVEkeIdGsnJIvVMzo+c+ZCVRVyzJOpwvQjwmwyBf2ZeQ8TOdjYy Xh8w== 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; bh=i9NOKIfJVa4Ie3h3KXyFPpA4+LQyldIaDudg/PbB8PA=; b=JgpbnePMkqgDqvFNZMJsDZFmR8pGPdDVTfu4kDp1DvQXFvfXBIAzTIIZcUJdkMZvWP 7s4Aoj8nffOu+HycKk5RZOS3C8A38Au52HsIXb3+IhDyl2ZfD76B0N4ee0fweeop6yI7 9LRVAq0Bu7Uan6eq/trj7KyJP/4XdsDCKFcr8c5OtgB0CTWcf7Nf9yB8NDDMSevsI7AR RFpdO0K6Fm9eF8ECZ/Rm7ygggwO+glxKQDxExiqwDvDpQZyE+4ufDQiGGQX88Bt9nW+I +3iUL+bkaRsuFMS6D89M41NH39kCiwuyU5Muzj1gCWR+W19oaBi7ZXUxYWZzTVEs/jhV c7SA== X-Gm-Message-State: ABuFfoj9zQhuXaPktSjhCCAGZb6iTKKAWapyIvVUH15unbl+ylOvGEWU VNauMRme0zWbN7Gd4tRXld3HfHkYqJlepfTKI0wwC004 X-Google-Smtp-Source: ACcGV60JIAi93fMJdoI14P+QYhcza7wW6MuHlHN6+BAZcNJxeUQKnFNOQkCZyDzQM8fotYS56ZPlhv/jNW+gD/6Ren4= X-Received: by 2002:aca:d489:: with SMTP id l131-v6mr3402958oig.15.1538335893855; Sun, 30 Sep 2018 12:31:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:5dc3:0:0:0:0:0 with HTTP; Sun, 30 Sep 2018 12:31:33 -0700 (PDT) In-Reply-To: References: <17e1a4b8-1b45-c64c-db04-39be4cba1fe7@gmail.com> From: Guozhang Wang Date: Sun, 30 Sep 2018 12:31:33 -0700 Message-ID: Subject: Re: [DISCUSS] KIP-378: Enable Dependency Injection for Kafka Streams handlers To: dev Content-Type: multipart/alternative; boundary="0000000000007fa42005771bbcab" --0000000000007fa42005771bbcab Content-Type: text/plain; charset="UTF-8" Hello Wladimir, Thanks for proposing the KIP. I think the injection can currently be done by passing in the key/value pair directly into the properties which can then be accessed from the `ProcessorContext#appConfigs` or `#appConfigsWithPrefix`. For example, when constructing the properties you can: ``` props.put(myProp1, myValue1); props.put(myProp2, myValue1); props.put("my_app_context", appContext); KafkaStreams myApp = new KafkaStreams(topology, props); // and then in your processor, on the processor where you want to construct the injected handler: Map appProps = processorContext.appConfigs(); ApplicationContext appContext = appProps.get("my_app_context"); MyHandler myHandler = applicationContext.getBeanNamesForType(MyHandlerClassType); ``` Does that work for you? Guozhang On Sun, Sep 30, 2018 at 6:56 AM, Dongjin Lee wrote: > Hi Wladimir, > > Thanks for your great KIP. Let me have a look. And let's discuss this KIP > in depth after the release of 2.1.0. (The committers are very busy for it.) > > Best, > Dongjin > > On Sun, Sep 30, 2018 at 10:49 PM Wladimir Schmidt > wrote: > > > Dear colleagues, > > > > I am happy to inform you that I have just finished my first KIP > > (KIP-378: Enable Dependency Injection for Kafka Streams handlers > > < > > https://cwiki.apache.org/confluence/display/KAFKA/KIP- > 378%3A+Enable+Dependency+Injection+for+Kafka+Streams+handlers > > >). > > > > Your feedback on this submission would be highly appreciated. > > > > Best Regards, > > Wladimir Schmidt > > > > > -- > *Dongjin Lee* > > *A hitchhiker in the mathematical world.* > > *github: github.com/dongjinleekr > linkedin: kr.linkedin.com/in/dongjinleekr > slideshare: > www.slideshare.net/dongjinleekr > * > -- -- Guozhang --0000000000007fa42005771bbcab--