Apache Kafka is a distributed publish-subscribe messaging system and a robust queue that can handle a high volume of data and enables you to pass messages from one end-point to another.
Generally, data is published to topic via Producer API and Consumers API consume data from subscribed topics.
In this blog, we will see how to do unit testing of kafka.
Unit testing your Kafka code is incredibly important. It’s transporting your most important data. As of now we have to explicitly run zookeeper and kafka server to test the Producer and Consumer.
Now there is also an alternate to test kafka without running zookeeper and kafka broker.
Thinking how ? EmbeddedKafka is there for you.
Embedded Kafka is a library that provides an in-memory Kafka broker to run your ScalaTest specs against. It uses Kafka 0.10.2.1 and ZooKeeper 3.4.8.
It will start zookeeper and kafka broker
View original post 367 more words