You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Anishek Agarwal <an...@gmail.com> on 2015/11/18 08:03:15 UTC
Using KeyValue Multi Scheme
Hello,
I have a kafka topic with keyed messages being send by a producer in it. I
want to write topology where i get the key as well as the value in the
storm topology, I have configured the kafka spount to use the following
scheme
*new KeyValueSchemeAsMultiScheme(new StringKeyValueScheme())*
i am now getting the map of key and value in the
tuple.getValues().iterator().next()
but this value is of type *SingletonImmutableBiMap* -- which is not a
public class and now i cant seem to find a way to access the values in the
object returned,
guava collections api doesnt seem to give a way to get typed objects, and
its not public so i cant explicitly type cast it either.
Has anyone done similar stuff.
using storm 0.9.4 -- with following dependencies in topology.
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-kafka</artifactId>
<version>0.9.4</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.10</artifactId>
<version>0.8.2.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
Thanks
Anishek