As Manikumar said, you need to use the Scala consumer if the client is v0.8.2.x. The Java consumer is only supported from 0.9.0.0. Is there a reason why you can't upgrade your client?
Ismael On Wed, Feb 8, 2017 at 5:28 PM, Jeffrey Zhang <xiuyan.zh...@salesforce.com> wrote: > Hi Hans, thanks for your reply. > > Here is what I see - > > for the Kafka client v0.8.2.2, the consumer.poll method returns an object > of Map<String, ConsumerRecords> while it returns ConsumerRecords from Kafka > Server v0.10.1.1. > that is why Kafka client v0.8.2.2 now does not work with my Kafka Kafka > Server v0.10.1.1. > > Were you saying that you have a way to change the returned format for > consumer.poll for v0.8.2.2? > If yes, pls advice how I could do it. > > regarding Deserializer, I use the following > from kafka-clients-0.8.2.2.jar. How to change it? > > > props.put("key.deserializer","org.apache.kafka.common.serialization. > StringDeserializer"); > > props.put("value.deserializer","org.apache.kafka.common.serialization. > StringDeserializer"); > > thanks a lot. > > Jeffrey > > > > On Wed, Feb 8, 2017 at 8:46 AM, <h...@confluent.io> wrote: > > > 0.8.x Java clients are supported for both producing and consuming with a > > 0.10.x broker. > > > > If you are seeing data when you poll but it's just in a different format > > between 0.8 and 0.10 consumers then you might not be using the same (or > > compatible) serdes libraries to deserialize the messages. > > > > -hans > > > > Sent from my iPhone > > > > > On Feb 8, 2017, at 8:17 AM, Manikumar <manikumar.re...@gmail.com> > wrote: > > > > > > Are you using new java consumer API? It is officially released as part > > of > > > 0.9 release. > > > 0.8.2.2 java consumer code may not be usable. You have to use old scala > > > consumer API. > > > > > > On Wed, Feb 8, 2017 at 9:35 PM, Jeffrey Zhang < > > xiuyan.zh...@salesforce.com> > > > wrote: > > > > > >> Any insight about these two versions, v0822 vs. v0101, of the Kafka > > >> behaviors as described below? > > >> Thanks > > >> > > >> Jeffrey > > >> > > >>> On Feb 7, 2017, at 7:42 PM, Jeffrey Zhang < > xiuyan.zh...@salesforce.com > > > > > >> wrote: > > >>> > > >>> hi > > >>> > > >>> I have difficulty to have Kafka Client 0.8.2.2 to consume the > messages > > >> on a Kafka Server 0.10.1.1, though I could produce message from this > > client > > >> 0.8.2.2 to the same server 0.10.1.1. > > >>> > > >>> My questions: > > >>> 1) could Kafka Client 0.8.2.2 be able to consume the messages from > > >> Server 0.10.1.1? > > >>> 1.1) If yes, would you pls provide an example? > > >>> 1.2) if no, do you have any work-around for these two versions to > talk > > >> in the way I described above? > > >>> > > >>> Note that I see the returned object from poll method at 0.8.2.2 is > > quite > > >> different from that from 0.10.1.1... > > >>> > > >>> thanks for your help > > >>> Jeffrey > > >>> > > >> > > >