[ 
https://issues.apache.org/jira/browse/KAFKA-5799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Juhong NamGung updated KAFKA-5799:
----------------------------------
    Summary: New KafkaSpoutConfig(Scheme)-ByteArrayKeyValueScheme  (was: New 
KafkaSpoutConfig(Scheme))

> New KafkaSpoutConfig(Scheme)-ByteArrayKeyValueScheme
> ----------------------------------------------------
>
>                 Key: KAFKA-5799
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5799
>             Project: Kafka
>          Issue Type: New Feature
>    Affects Versions: 0.11.0.0
>         Environment: apache-storm 1.1.0
>            Reporter: Juhong NamGung
>            Priority: Minor
>         Attachments: 1.JPG, 2.JPG, bakvs.JPG
>
>
> I try to integrate Kafka with Apache Strom.
> I want to get data from Kafka, using KafkaSpout in Apache Storm. 
> To get data from Kafka using KafkaSpout, SpoutConfig-scheme must be setting. 
> (Scheme is an interface that dictates how the ByteBuffer consumed from Kafka 
> gets transformed into a storm tuple)
> I want to get both key and value in Kafka, so I used to KafkaSpoutConfig 
> ‘KeyValueSchemeAsMultiScheme’.
> KeyValueSchemeAsMultiScheme’s Constructor is as follows.
> !2.JPG|thumbnail!
> But, as you can see in the picture, implementing classes of Interface 
> KeyValueScheme are only StringKeyValueScheme.
> !1.JPG|thumbnail!
> Using StringKeyValueShceme causes problems when importing Integer data from 
> Kafka. Because StringKeyValueScheme deserialize Bytebuffer to String.
> So I implement ByteArrayKeyValueScheme that deserialize ByteBuffer to 
> ByteArray.
> ByteArrayKeyValueScheme imports data as BtyeArray.
> If you use ByteArrayKeyValueScheme, you can import data regardless of data 
> type from Kafka without error.
> (But, you should convert data type ByteArray to data type that you want(e.g. 
> String, Integer...))
> !bakvs.JPG|thumbnail!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to