From users-return-7693-apmail-kafka-users-archive=kafka.apache.org@kafka.apache.org Thu Dec 12 16:07:38 2013 Return-Path: X-Original-To: apmail-kafka-users-archive@www.apache.org Delivered-To: apmail-kafka-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6D696108C4 for ; Thu, 12 Dec 2013 16:07:38 +0000 (UTC) Received: (qmail 63539 invoked by uid 500); 12 Dec 2013 16:07:37 -0000 Delivered-To: apmail-kafka-users-archive@kafka.apache.org Received: (qmail 63521 invoked by uid 500); 12 Dec 2013 16:07:37 -0000 Mailing-List: contact users-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@kafka.apache.org Delivered-To: mailing list users@kafka.apache.org Received: (qmail 63513 invoked by uid 99); 12 Dec 2013 16:07:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Dec 2013 16:07:37 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of junrao@gmail.com designates 209.85.219.48 as permitted sender) Received: from [209.85.219.48] (HELO mail-oa0-f48.google.com) (209.85.219.48) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Dec 2013 16:07:33 +0000 Received: by mail-oa0-f48.google.com with SMTP id l6so652200oag.7 for ; Thu, 12 Dec 2013 08:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=1dUELq4oIOitjqLJxa2aTtjOVkMpbVLw1Dr6AeIuCMQ=; b=mw+6Uth5gKHPtbicPWgRlHsq6zn/1vxVpclOrHtjOjlpf6afB8vAa/441LrXVC8G4S Sa3wMin3lvouZi969EKCiCwINijUiVdPR+CoMLKgkh4vT39xMMRpeKRAtpCNQQoXjR3j 4jrZ4ApqWd7FLEOaiYgVUfxFVAF5dc0twF2VwHflly8LrGGdSw1hRzAUUPv1KbF+qdY9 M5HdRV/KOGLpEB95hdMhXvsCMOvCE9WENsXxSlkMnTNfFbnbZJPfvu/p6Ykm6Yq0QCHa h34Ng4TJ+7NmoNOZe6EHcedfWNUVu95m/UqLLZ55KyYcpv5XF43u1gG5uBuRuqY0CTV3 0nPg== MIME-Version: 1.0 X-Received: by 10.182.250.200 with SMTP id ze8mr844581obc.72.1386864432332; Thu, 12 Dec 2013 08:07:12 -0800 (PST) Received: by 10.60.137.163 with HTTP; Thu, 12 Dec 2013 08:07:12 -0800 (PST) In-Reply-To: References: Date: Thu, 12 Dec 2013 08:07:12 -0800 Message-ID: Subject: Re: Embedding a Kafka 0.8 broker for testing From: Jun Rao To: "users@kafka.apache.org" Content-Type: multipart/alternative; boundary=089e0160c660d747dc04ed588913 X-Virus-Checked: Checked by ClamAV on apache.org --089e0160c660d747dc04ed588913 Content-Type: text/plain; charset=ISO-8859-1 You can take a look at KafkaServerTestHarness in our unit tests. Thanks, Jun On Thu, Dec 12, 2013 at 3:14 AM, Javier Alba wrote: > Hi, > > I would like to embed a Kafka broker in my Java program, for testing > purposes. > > The idea is being capable of running a Junit test that starts a local kafka > broker, and then perform tests on some custom producers and consumers. > > After searching around, I've found some pieces of code but none of them > seem to work with Kafka 0.8 API. > > Does anyone know about any guide/best practice or code example I could use > for this purpose? > > Thanks in advance! > --089e0160c660d747dc04ed588913--