2

Running with a Consumer.plainSource, nothing happens. Isn't this one way of reading from kafka topic through streams .

val consumerSettings2 = ConsumerSettings(system,new StringDeserializer,new StringDeserializer)
        .withBootstrapServers("localhost:3333")
        .withGroupId("ssss")
        .withProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"earliest")

val source: Source[ConsumerRecord[String, String], Consumer.Control] =
Consumer.plainSource(consumerSettings2, Subscriptions.topics("candy"))

val sink = 
Sink.foreach[ConsumerRecord[String,String]](x=>println("consumed "+x))

source.runWith(sink)
Bruno Cadonna
  • 1,348
  • 7
  • 11
supernatural
  • 1,107
  • 11
  • 34

0 Answers0