kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S Ahmed <sahmed1...@gmail.com>
Subject is it smarter to go with a java class for message serialization/des?
Date Tue, 17 Jun 2014 18:58:56 GMT
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

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])

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message