Github user koeninger commented on the issue:

    https://github.com/apache/spark/pull/11863
  
    Moved the prefered location and consumer creation strategies to an explicit 
interface, let me know if that's more usable from your point of view.
    
    Scala api looks like
    
    KafkaUtils.createDirectStream[String, String](
         ssc, 
         PreferConsistent,
         Subscribe[String, String](topics, kafkaParams)
    )
    
    For starting from given offsets, the subscribe line would look like
    
    FromOffsets[String, String](offsets,
       Subscribe[String, String](topics, kafkaParams))
    
    so that starting offsets can be used with arbitrary other setup strategies.
    The ConsumerStrategy interface is public so that people can do arbitrary 
setup if need be.
    
    Java api looks like
    
    JavaInputDStream<ConsumerRecord<String, String>> istream2 = 
KafkaUtils.createDirectStream(
            ssc,
            String.class,
            String.class,
            PreferConsistent.create(),
            Subscribe.create(String.class, String.class, Arrays.asList(topic2), 
kafkaParams2)
    );



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to