0

I work on a code that uses reactive-kafka module in Scala. My code uses lines such as:

val kafka = new ReactiveKafka()
kafka.consume(ConsumerProprties(...).readFromEndOfStream())
kafka.publish(ProducerProperties(...))

I have two questions:

  1. I see that my code imports the package com.softwaremill.react.kafka. Can you give me a link to a detailed documentation? All information I found so far is too consice.

  2. I want to check that the server is still connected to Kafka. How can I do it using com.softwaremill.react.kafka package?

CrazySynthax
  • 13,662
  • 34
  • 99
  • 183
  • ReactiveKafka is just a very small wrapper over official kafka client. Its source code is properly commented and is pretty easy to understand. – sarveshseri Aug 21 '16 at 18:00
  • And there is no "detailed" documentation. – sarveshseri Aug 21 '16 at 18:01
  • And just a hint to solve your problem. Create a new topic `heartbeat`. Create a consumer and producer stream for it. Whenever you want to check the connection, produce to `heartbeat` topic and check whether your consumer gets it. – sarveshseri Aug 21 '16 at 18:04
  • Are you talking about this documentation: https://github.com/akka/reactive-kafka ? What I see in this documentation is how to create a publisher and a subscriber, and not a consumer and a producer, as you said. – CrazySynthax Aug 22 '16 at 07:31
  • Well... that `Publisher` is a wrapper on top of `KafkaConsumer` which consumes messages from Kafka and publishes them downstream. Similarly that `Subscriber` is a wrapper on top of `KafkaProducer` which consumes the subscribed streams and publishes messages to Kafka. – sarveshseri Aug 22 '16 at 07:55
  • So... what is the difference between Consumer and Subscriber? Can I just create a Subscriber and treat it as if it were a Consumer? – CrazySynthax Aug 22 '16 at 08:05
  • Are you serious ? Do you mean to say that you are using ReactiveKafka without having any idea of what it does ? At least read the comment carefully. – sarveshseri Aug 22 '16 at 08:07
  • I read the documentation: https://github.com/akka/reactive-kafka and I found no anwer to my question. No, I don't know what ReactiveKafka actually does. That's why I posted this question. If you have any good resource/link you're more that welcome to post it. – CrazySynthax Aug 22 '16 at 08:17

0 Answers0