[ 
https://issues.apache.org/jira/browse/STORM-2548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16178010#comment-16178010
 ] 

Manish Sharma commented on STORM-2548:
--------------------------------------

Hello, 
I am trying to use a custom ValueDeserializer when consuming from kafka, I 
tried the following 

{code}
        KafkaSpoutConfig kafkaSpoutConfig = KafkaSpoutConfig
                .builder(property.getKafka_consumer_bootstrap_servers(), topics)

.setFirstPollOffsetStrategy(KafkaSpoutConfig.FirstPollOffsetStrategy.EARLIEST)
                .setGroupId(property.getKafka_consumer_groupid())
                .setProp(ConsumerConfig.CLIENT_ID_CONFIG, "StormKafkaConsumer")
                .setProp(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, 
"EmailObjectDeserializer")
                .build();
{code}
It didnt take, In the logs I see 
{code}
6348 [Thread-18-SMTPInjectionKafkaSpout-executor[2 2]] INFO  
o.a.k.c.c.ConsumerConfig - ConsumerConfig values:
        auto.commit.interval.ms = 5000
        auto.offset.reset = latest
        bootstrap.servers = [XXXX.XXXX.XXXX:9092]
        check.crcs = true
        client.id = StormKafkaConsumer
        connections.max.idle.ms = 540000
        enable.auto.commit = false
        exclude.internal.topics = true
        fetch.max.bytes = 52428800
        fetch.max.wait.ms = 500
        fetch.min.bytes = 1
        group.id = dev_worker
        heartbeat.interval.ms = 3000
        interceptor.classes = null
        key.deserializer = class 
org.apache.kafka.common.serialization.StringDeserializer
        max.partition.fetch.bytes = 1048576
        max.poll.interval.ms = 300000
        max.poll.records = 100
        metadata.max.age.ms = 300000
        metric.reporters = []
        metrics.num.samples = 2
        metrics.recording.level = INFO
        metrics.sample.window.ms = 30000
        partition.assignment.strategy = [class 
org.apache.kafka.clients.consumer.RangeAssignor]
        receive.buffer.bytes = 65536
        reconnect.backoff.ms = 50
        request.timeout.ms = 305000
        retry.backoff.ms = 100
        sasl.jaas.config = null
        sasl.kerberos.kinit.cmd = /usr/bin/kinit
        sasl.kerberos.min.time.before.relogin = 60000
        sasl.kerberos.service.name = null
        sasl.kerberos.ticket.renew.jitter = 0.05
        sasl.kerberos.ticket.renew.window.factor = 0.8
        sasl.mechanism = GSSAPI
        security.protocol = PLAINTEXT
        send.buffer.bytes = 131072
        session.timeout.ms = 10000
        ssl.cipher.suites = null
        ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
        ssl.endpoint.identification.algorithm = null
        ssl.key.password = null
        ssl.keymanager.algorithm = SunX509
        ssl.keystore.location = null
        ssl.keystore.password = null
        ssl.keystore.type = JKS
        ssl.protocol = TLS
        ssl.provider = null
        ssl.secure.random.implementation = null
        ssl.trustmanager.algorithm = PKIX
        ssl.truststore.location = null
        ssl.truststore.password = null
        ssl.truststore.type = JKS
        value.deserializer = class 
org.apache.kafka.common.serialization.StringDeserializer <-------
{code}

Any thoughts on how to get custom value.deserializer working with 
storm-kafka-client-1.1.1?

> Simplify KafkaSpoutConfig
> -------------------------
>
>                 Key: STORM-2548
>                 URL: https://issues.apache.org/jira/browse/STORM-2548
>             Project: Apache Storm
>          Issue Type: Improvement
>          Components: storm-kafka-client
>    Affects Versions: 2.0.0, 1.1.0
>            Reporter: Stig Rohde Døssing
>            Assignee: Stig Rohde Døssing
>             Fix For: 2.0.0, 1.2.0
>
>          Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> Some suggestions for simplifying KafkaSpoutConfig off the mailing list:
> * We should not duplicate properties that users would normally set in the 
> KafkaConsumer properties map. We should just have a setter (setProp) for 
> setting properties in that map. For instance, setGroupId is just duplicating 
> a setting that the user should be able to set directly in the consumer 
> properties.
> * We should get rid of the key/value deserializer setters. Setting the 
> deserializers as classes is something the user can just as well do by using 
> setProp. The SerializableDeserializer class should be removed. It is only 
> offering extra type safety in the case where the user is defining their own 
> deserializer type, and has the opportunity to subclass 
> SerializableDeserializer. The setters don't work with the built in Kafka 
> deserializers.



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

Reply via email to