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 8286411888 for ; Tue, 17 Jun 2014 22:07:04 +0000 (UTC) Received: (qmail 32502 invoked by uid 500); 17 Jun 2014 22:07:03 -0000 Delivered-To: apmail-kafka-users-archive@kafka.apache.org Received: (qmail 32467 invoked by uid 500); 17 Jun 2014 22:07:03 -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 32425 invoked by uid 99); 17 Jun 2014 22:07:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jun 2014 22:07:03 +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 (nike.apache.org: domain of neha.narkhede@gmail.com designates 209.85.212.170 as permitted sender) Received: from [209.85.212.170] (HELO mail-wi0-f170.google.com) (209.85.212.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jun 2014 22:06:59 +0000 Received: by mail-wi0-f170.google.com with SMTP id cc10so7607826wib.3 for ; Tue, 17 Jun 2014 15:06:35 -0700 (PDT) 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=gHDK0G6Is4RsypqtzgRAQhZWhFkr37o6xZ4SARe9Ti8=; b=goU66m7cBsu8r7A9uXSI6JvMTydl12Pj4u7CClTLbRyjvSOTZ2tNaohVpNmoUb0VYr zeccNFA7vsLLjlyjaZBxwi29PF75VhUqTp9mA8HDx+p6glveRjYIM4Ei8pdtAnXuvIQf gIPW8elSmHVbxn9GbR/uxdmgX/bhZ7y9GJlLVtKiFvzXdyKv4PH9g/LEFlf7+qXlIe4m U79bWMpZme0J0fvPt+kFwOOxUkNtPpuowE1gQiT9WyqQDpA7MFY5D5kHCN8f40+Y1i62 KuLHE0kx8q4lVk8UWrDS+bHtQUwxsI0fdvlsyOsK6ymxH1A1CcQ7u08WMaV4157/1RfD fMxA== MIME-Version: 1.0 X-Received: by 10.180.91.162 with SMTP id cf2mr403541wib.57.1403042795486; Tue, 17 Jun 2014 15:06:35 -0700 (PDT) Received: by 10.216.93.5 with HTTP; Tue, 17 Jun 2014 15:06:35 -0700 (PDT) In-Reply-To: References: Date: Tue, 17 Jun 2014 15:06:35 -0700 Message-ID: Subject: Re: is it smarter to go with a java class for message serialization/des? From: Neha Narkhede To: "users@kafka.apache.org" Content-Type: multipart/alternative; boundary=f46d0438933b6e04f304fc0f5bf8 X-Virus-Checked: Checked by ClamAV on apache.org --f46d0438933b6e04f304fc0f5bf8 Content-Type: text/plain; charset=UTF-8 Yes, backwards incompatibility is a problem when using Java/Scala object serialization. At LinkedIn, we use Avro as the serialization format for Kafka data. Thanks, Neha On Tue, Jun 17, 2014 at 11:58 AM, S Ahmed wrote: > My app is in scala and a quick search on serializing a scala class seems to > have potential issues with different versions of scala (I could be wrong as > I did a quick search). > > Is it generally just a better idea to use plain old java classes for kafka > messages? > > i.e. I simply use jackson like: > > public class User implements Serializable { > ... > } > > // kakfa > val it = stream.iterator() > while (it.hasNext()) { > val messageAndTopic = it.next > > val user = mapper.readValue(messageAndTopic.message(), classOf[User]) > --f46d0438933b6e04f304fc0f5bf8--