Return-Path: X-Original-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 73186DF2A for ; Sat, 11 Aug 2012 03:16:35 +0000 (UTC) Received: (qmail 17124 invoked by uid 500); 11 Aug 2012 03:16:34 -0000 Delivered-To: apmail-incubator-kafka-dev-archive@incubator.apache.org Received: (qmail 16883 invoked by uid 500); 11 Aug 2012 03:16:29 -0000 Mailing-List: contact kafka-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: kafka-dev@incubator.apache.org Delivered-To: mailing list kafka-dev@incubator.apache.org Received: (qmail 16839 invoked by uid 99); 11 Aug 2012 03:16:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Aug 2012 03:16:27 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mumrah@gmail.com designates 209.85.213.47 as permitted sender) Received: from [209.85.213.47] (HELO mail-yw0-f47.google.com) (209.85.213.47) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Aug 2012 03:16:19 +0000 Received: by yhjj56 with SMTP id j56so2074460yhj.6 for ; Fri, 10 Aug 2012 20:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=CL2fBAubynpAY6mrjXfO/yPWalZcVZ493DP2zPLuG7I=; b=L1nkFzpgQoeHF7gLk3CFcFvnLK2/k233lJb/qa+S+XUo1rULMORaR7E2QiA2CYbrrG HJkLEfkiepwKbGVJQHva+VEs9qi+Oi7cn2Gcym6OzT/4BpKL6HjdoNqGK3uIcNG8MDFV 1djkxRHRwRH492rO38bXE5c9Kn1L0m8iYqxdN8FMalyNPVhuDphD5fOI4EIPfNmwULX3 uRjVqCM3V3+WlkPZoni9EtdWUNxHLqTuXViHSTkqZ+yZdIH88o38jSi5VtBBo7P1IfoT IHm9K4Cv7BURVV4IqpSELvNs8SI3WD3i9EsdNAwUlMKceyCIOfV1SnlD2YtezZooGemz 55oA== Received: by 10.236.170.106 with SMTP id o70mr5095636yhl.10.1344654959071; Fri, 10 Aug 2012 20:15:59 -0700 (PDT) Received: from [192.168.1.15] (cpe-076-182-029-172.nc.res.rr.com. [76.182.29.172]) by mx.google.com with ESMTPS id c64sm1312620yhj.17.2012.08.10.20.15.58 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Aug 2012 20:15:58 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1278) Subject: Re: Kafka REST interface From: David Arthur In-Reply-To: Date: Fri, 10 Aug 2012 23:15:57 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <892F7AA8-73FF-4FC3-9942-7BCA4F49F3C6@gmail.com> To: kafka-dev@incubator.apache.org X-Mailer: Apple Mail (2.1278) You make a good point about TCP not being the problem. But rather the = complex consumer logic and ZK dependency are barriers to entry for new = clients. I'm starting to like the idea of a standalone proxy that uses = an existing client (one with batteries included) to simply things for = HTTP clients. If this is going into Kafka, I think we should stick with = Scala/Java for implementation.=20 Are there any preferences for what HTTP server is used? Any particular = aversion to Jetty?=20 -David On Aug 10, 2012, at 3:50 PM, Jay Kreps wrote: > My personal preference would be to have only a single protocol in = kafka > core. I have been down the multiple protocol route and my experience = was > that it adds a lot of burden for each change that needs to be made and = a > lot of complexity to abstract over the different protocols. =46rom the = point > of view of a user they are generally a bit agnostic as to how bytes = are > sent back and forth provided it is reliable and easily implementable = in any > language. Generally they care more about the quality of the client in = their > language of choice. >=20 > My belief is that the main benefit of REST is ease of implementing a > client. But currently the biggest barrier is really the use of zk and > fairly thick consumer design. So I think the current thinking is that = we > should focus on thinning that out and removing the client-side zk > dependency. I actually don't think TCP is a huge burden if the = protocol is > simple, and there are actually some advantages (for example the = consumer > needs to consume from multiple servers so select/poll/epoll is natural = but > this is not always available from HTTP client libraries). >=20 > Basically this is an area where I think it is best to pick one way and > really make it really bullet proof rather than providing lots of = options. > In some sense each option tends to increase the complexity of testing > (since now there are many combinations to try) and also of = implementation > (since now a lot things that were concrete now need to be abstracted = away). >=20 > So from this perspective I would prefer a standalone proxy that could > evolve independently rather than retro-fitting the current socket = server to > handle other protocols. There will be some overhead for the extra hop, = but > then there is some overhead for HTTP itself. >=20 > This is just my personal opinion, it would be great to hear what other > think. >=20 > -Jay >=20 > On Mon, Aug 6, 2012 at 5:39 AM, David Arthur wrote: >=20 >> I'd be happy to collaborate on this, though it's been a while since = I've >> used PHP. >>=20 >> =46rom what it looks like, what you have is a true proxy that runs = outside >> of Kafka and translates some REST routes into Kafka client calls. = This >> sounds more in line with what the project page describes. What I have >> proposed is more like a translation layer between some REST routes = and >> FetchRequests. In this case the client is responsible for managing = offsets. >> Using the consumer groups and ZooKeeper would be another nice way of >> consuming messages (which is probably more like what you have). >>=20 >> Any maintainers have feedback on this? >>=20 >> On Aug 3, 2012, at 4:13 PM, Jonathan Creasy wrote: >>=20 >>> I have an internal one working and was hoping to have it open = sourced in >>> the next week. The one at Box is based on the CodeIgniter framework, = we >>> have about 45 RESTful interfaces built on this framework so I just = put >>> together another one for Kafka. >>>=20 >>>=20 >>> Here are my notes, these were pre-dev so may be a little different = than >>> what we ended up with. >>>=20 >>> = https://cwiki.apache.org/confluence/display/KAFKA/Restful+API+Proposal >>>=20 >>> I will read yours later this afternoon, we should work together. >>>=20 >>> -Jonathan >>>=20 >>>=20 >>> On Fri, Aug 3, 2012 at 7:41 AM, David Arthur = wrote: >>>=20 >>>> I'd like to tackle this project (assuming it hasn't been started = yet). >>>>=20 >>>> I wrote up some initial thoughts here: = https://gist.github.com/3248179 >>>>=20 >>>> TLDR; use Range header for specifying offsets, simple URIs like >>>> /kafka/topics/[topic]/[partition], use for a simple transport of = bytes >>>> and/or represent the messages as some media type (text, json, xml) >>>>=20 >>>> Feedback is most welcome (in the Gist or in this thread). >>>>=20 >>>> Cheers! >>>>=20 >>>> -David >>=20 >>=20