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 86C45200D26 for ; Fri, 6 Oct 2017 00:22:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 84CE8160BDA; Thu, 5 Oct 2017 22:22:56 +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 A1F091609E2 for ; Fri, 6 Oct 2017 00:22:55 +0200 (CEST) Received: (qmail 25281 invoked by uid 500); 5 Oct 2017 22:22:54 -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 25269 invoked by uid 99); 5 Oct 2017 22:22:54 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Oct 2017 22:22:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 6CB381808AF for ; Thu, 5 Oct 2017 22:22:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.379 X-Spam-Level: X-Spam-Status: No, score=0.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id j-8YkJvZr9KZ for ; Thu, 5 Oct 2017 22:22:51 +0000 (UTC) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D428E5FCF2 for ; Thu, 5 Oct 2017 22:22:50 +0000 (UTC) Received: by mail-lf0-f43.google.com with SMTP id a16so1025858lfk.0 for ; Thu, 05 Oct 2017 15:22:50 -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=cvq3iEwFY118za6f4QN1vpf6pev+WL1CBl+uVwsRq4o=; b=A75TpPDRnzJrl3hcJzpoEwwfJ6Q1uVRJ1TAPtU7leg0uMhJmwVYlHBRNZi6AI973Ku lFzXO/ps0AlRpsRSL9JJhNlLcOD6zCGcaNa1GdQnybzUT/9du4D7+b2uELBheu8EQ1RQ 6Q54bKHV5sCnP0LrLW2xgkVyMxVkvVxQR1zjXfPvvFMBcy1HguiI0e4xcpyNrmjanJjP RD8y53f8z6G84UJFxR0xn3Y8BbkUY8Q+pIGaMKIpOFCi7MAjjE+18ujJB/UqgSVPwvEs +87WrlHOdka+0fj/uqXXcKJ8vQGf/dS9cbMthOGmN+9ZEWst5gXlJsO0FjseSX5fFUH0 hTzA== 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=cvq3iEwFY118za6f4QN1vpf6pev+WL1CBl+uVwsRq4o=; b=T2GP9nPuExDixb2eF+V6+zQw6rpFs1ERg9svmNg2eWUHlovRq5LT39lTMpPoHECnUO Dvlvzprk/MFs6jFPGGFnq6vo1Yy2cyciFUpoMyY7hdMhghXZq4FSqtMQQOpQWNFoCBqi 4QkHBeyTF1QhR+PMHN2dRNrwOTtcvcXm/fHQmWANzHesZZCsTqHp8SsL1+/LSDPwlEoz IRbHbsP6rDbltMTVLAnKyFyQ5skout4GBf4SA4lgrSm+zIEANcG2+2LEm/HnhclztON2 3oXEyt9gksjGxufKYLuXwGeM+CNc9zfXulbf8juJEiEPPf4YuTMW12Scp8Uw6P1rU2U4 3geg== X-Gm-Message-State: AMCzsaWCBLxCg4P5srIHmGyGWEpitirjM3nV8nzvQW/6kro+X/DquXE6 6JjSTgHYvP1dkVtbT5B19GKhFWztXUQQk3jcy0dE4w== X-Google-Smtp-Source: AOwi7QAkdGcNUwXSRK8jl8F0hsD+5BQZ+LlkT6u8zUV3OT4ipDQV8Jdhli/WY6buUeSl/LTthrMx6n6r6lNFd+61GcI= X-Received: by 10.46.18.71 with SMTP id t68mr57111lje.132.1507242169990; Thu, 05 Oct 2017 15:22:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.22.218 with HTTP; Thu, 5 Oct 2017 15:22:49 -0700 (PDT) In-Reply-To: References: <1507227655.3564592.1129128368.1AB9F357@webmail.messagingengine.com> From: Clebert Suconic Date: Thu, 5 Oct 2017 18:22:49 -0400 Message-ID: Subject: Re: [DISCUSS] URIs on Producer and Consumer To: dev@kafka.apache.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable archived-at: Thu, 05 Oct 2017 22:22:56 -0000 Another useful feature for this... Say that I am writing an application... if I write this URI on any of my internal properties.. I can tweak my Consumer or Producer without changing any code. Say, you store the URI on your project's configuration xml..read it and start your consumer... later on you could just update the XML, and your user wouldn't need to rewrite his application. right now if you (as an user) want to do such thing.. you would have to write the parser yourself. On Thu, Oct 5, 2017 at 4:33 PM, Michael Pearce wrot= e: > To me, this is a lot more in line with many other systems connections, to= have the ability to have a single connection string / uri, is this really = that left field suggesting or wanting this? > > If anything this bring kafka more standardised approach imo, to have a un= ified resource identifier, protocol name and a set schema for that. > > e.g. > Database connection strings like > > oracle: > jdbc:oracle:thin:@(description=3D(address_list=3D > (address=3D(protocol=3Dtcp)(port=3D1521)(host=3DprodHost))) > (connect_data=3D(INSTANCE_NAME=3DORCL))) > > or > > postgres: > "jdbc:postgresql://localhost/test?user=3Dfred&password=3Dsecret&ssl=3Dtru= e" > > And then like wise on messaging front, systems like > > rabbitmq > =E2=80=9Camqp://myhost?heartbeat=3D10&connection_timeout=3D10000=E2=80=9D > > > I personally like the suggestion +1. > > > Cheers > Mike > > > On 05/10/2017, 20:10, "Clebert Suconic" wrote= : > > On Thu, Oct 5, 2017 at 2:20 PM, Colin McCabe wro= te: > > We used URIs as file paths in Hadoop. I think it was a mistake, fo= r a > > few different reasons. > > > > URIs are actually very complex. You probably know about scheme, ho= st, > > and port, but did you know about authority, user-info, query, fragm= ent, > > scheme-specific-part? Do you know what they do in Hadoop? The map= ping > > isn't obvious (and it wouldn't be obvious in Kafka either). > > URIs are just a hashmap of key=3Dstring.. just like Properties... > > The Consumer and Producer is just having such hashMap.. and these > values are easy to translate to boolean, integer.. etc. We would just > need to add such mapping as part of this task when done. I don't see > anything difficult there. > > > > > > When you flip back and forth between URIs and strings (and you > > inevitably will do this, when serializing or sending things over th= e > > wire), you run into tons of really hard problems. Should you prese= rve > > the "fragment" (the thing after the hash mark) for your URI, or not= ? It > > may not do anything now, but maybe it will do something later. URI= s > > also have complex string escaping rules. Parsing URIs is very mess= y, > > especially when you start talking about non-Java programming langua= ges. > > > Why flip back and forth? URIs would generate the same HashMap that's > being generated today.. I don't see any mess here. > Besides... This would be an addition, not replacement... > > And I'm talking only about the Java API now. > > Again, All the properties on ProducerConfig and ConsumerConfig seems > easy to be mapped as primitive types (String, numbers.. booleans). > > Serialization shouldn't be a problem there. it would generate the sam= e > properties it's generated now. > > > > > URIs are designed for a world where you talk to a single host over = a > > single port. That isn't the world distributed systems live in. Yo= u > > don't want your clients to fail to bootstrap because the single ser= ver > > you specified is having a bad day, even when the other 8 servers ar= e up. > > I have seen a few projects using this style of URI: I would make it > doing the same here: > > If you have multiple hosts: > > KafkaConsumer consumer =3D new > KafkaConsumer("kafka:(kafka://host1:port,kafka://host2:port)?property= 1=3Dvalue"); > > if you have a single host: > KafkaConsumer consumer =3D new > KafkaConsumer("kafka://host2:port?property1=3Dvalue&property2=3Dvalue= 2"); > > > One example of an apache project using a similar approach is qpid-jms= : > http://qpid.apache.org/releases/qpid-jms-0.25.0/docs/index.html#failo= ver-configuration-options > > > > The bottom line is that URIs are the wrong abstraction for the job. > > They just don't express what we really want, and they introduce a l= ot of > > complexity and ambiguity. > > I have seen the opposite to be honest. this has been simpler for me > and users I know than using a HashMap.. . users in my experience ten= d > to write this faster. > > users can certainly put up with the HashMap.. but this is easier to > remember. I'm just proposing what I think it's a simpler API. > > > > > Perhaps we should move into the KIP discussion itself here.. I first > intended to start this thread to see if it would make sense or not... > But I don't have authorization to create the KIP page.. so again.. > based on the contributing page.. can someone add me authorizations to > the WIKI space? > > > The information contained in this email is strictly confidential and for = the use of the addressee only, unless otherwise indicated. If you are not t= he intended recipient, please do not read, copy, use or disclose to others = this message or any attachment. Please also notify the sender by replying t= o this email or by telephone (+44(020 7896 0011) and then delete the email = and any copies of it. Opinions, conclusion (etc) that do not relate to the = official business of this company shall be understood as neither given nor = endorsed by it. IG is a trading name of IG Markets Limited (a company regis= tered in England and Wales, company number 04008957) and IG Index Limited (= a company registered in England and Wales, company number 01190902). Regist= ered address at Cannon Bridge House, 25 Dowgate Hill, London EC4R 2YA. Both= IG Markets Limited (register number 195355) and IG Index Limited (register= number 114059) are authorised and regulated by the Financial Conduct Autho= rity. --=20 Clebert Suconic