kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yang <teddyyyy...@gmail.com>
Subject generics type for Producer and Consumer do not need to match?
Date Thu, 05 Feb 2015 20:11:03 GMT
in the example
https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+Producer+Example

we use a String,String for <K,V>

in the same set of example
https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example

on the consumer side we use byte[], byte[] for K,V
        ConsumerIterator<byte[], byte[]> it = m_stream.iterator();



we tested in our own code that the above producer-consumer pair does work.


so the K,V types on the 2 sides do NOT need to match? if we argue that
"everything has to come down to byte[], then maybe we don't need the
generics types on the consumer side? in other words, how do we determine
the K,V types on consumer side?

thanks
Yang

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