kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ismael Juma <ism...@juma.me.uk>
Subject Re: [0.10.1.0-SNAPSHOT] KafkaProducer.close() not committing
Date Wed, 13 Apr 2016 22:54:55 GMT
Hi Greg,

It may be worth passing a callback to the `send` to see if there's any
error (or calling `get` on the Future returned).

Ismael

On Wed, Apr 13, 2016 at 2:59 PM, Greg Zoller <gwzoller@yahoo.com.invalid>
wrote:

> So I rebuilt last night with the latest from master branch.
> Unfortunately same problem--producer doesn't seem to commit/close().
> After inserting a few records (which *seem* to go ok), close() times out
> and no offsets are updated--still set to 0.
> Any ideas?Thanks,Greg
>
>       From: Greg Zoller <gwzoller@yahoo.com.INVALID>
>  To: "users@kafka.apache.org" <users@kafka.apache.org>; Greg Zoller <
> gwzoller@yahoo.com>
>  Sent: Tuesday, April 12, 2016 11:49 AM
>  Subject: Re: [0.10.1.0-SNAPSHOT] KafkaProducer.close() not committing
>
> Sorry the formatting was all messed up.I re-tested this code with 0.9.0.1
> and it worked fine--KafkaProducer closed and committed the number of
> records expected into the partitions.
> So this seems like a SNAPSHOT issue.  Will continue looking.
>
>       From: Greg Zoller <gwzoller@yahoo.com.INVALID>
>  To: "users@kafka.apache.org" <users@kafka.apache.org>
>  Sent: Tuesday, April 12, 2016 10:40 AM
>  Subject: [0.10.1.0-SNAPSHOT] KafkaProducer.close() not committing
>
> Hello,
> I'm trying to run the latest master build in github.  I've got producer
> code like below:
>    val props = Map(      "bootstrap.servers" -> host,
> "key.serializer" ->
> "org.apache.kafka.common.serialization.ByteArraySerializer",
> "value.serializer" ->
> "org.apache.kafka.common.serialization.StringSerializer"    )    val p =
> new KafkaProducer[Array[Byte], String](props)    (1 to num).foreach { i =>
>     p.send(new ProducerRecord[Array[Byte], String](topic, s"msg-$i"))    }
>   p.close(10000, java.util.concurrent.TimeUnit.MILLISECONDS)
>
>
> This code will wait 10 seconds then close the KafkaProducer.  At that
> point if I check the offsets in my server (same build) I see all offsets
> set to 0...no data committed.  If I put some kind of println in my loop I
> see the p.send() call seeming to work happily.
> Any ideas?
> Thanks,Greg
>
>
>
>
>

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