The Movie Rating Splitter Service is a microservice that:
- Consumes from the movie-message Kafka topic
- Splits the Movie message by the ratings it has received to individual FilmRating messages
- Produces to the film-ratings-message Kafka topic
- Spring Boot: 1.5.12.RELEASE
- Apache Camel: 2.21.0
- Camel Kafka: 2.21.0
- Kafka clients: 1.0.0
In order to run locally you will need to have at least the following installed in your local development environment:
- IntelliJ Community Edition 2016.3.5 or above
- Maven 3.3.9 or above
- Minikube v0.17.1 or v0.21.0
- Kubernetes client version v1.5.3 or v1.7.0
- Kubernetes server version v1.5.3
- Java 1.8.0_XXX - Java8 openjdk or above
- Oracle VirtualBox 5.0.40 or 5.1.18
-
Clone or download the project:
git clone https://github.com/abnair2016/movie-rating-splitter.git
-
Navigate to movie-rating-splitter service root:
cd /path/to/movie-rating-splitter
and run the maven clean install command:mvn -U clean install -DskipTests
-
Navigate to the component-test folder:
cd /path/to/movie-rating-splitter/component-test
and run the./minikube-startup.sh
script to install kafka and zookeeper images in your local minikube. After the script runs, it opens a minikube dashboard to show the status of the pods. Please wait until the pods are in aRunning
state. -
Open the project in your IDE and add the following environment variables to be able to connect to kafka installed in your minikube:
`KAFKA_ENDPOINT=192.168.99.100:30092` `READ_TOPIC=movie-message` `WRITE_TOPIC=film-ratings-message` `NAMESPACE=minikube` `GROUP_ID=movie-rating-splitter`
-
Run the Application
-
Run a POST command in your REST client to the following URL:
http://localhost:9999/producer
-
Use any of the Movie message JSON files available under the
/path/to/movie-rating-splitter/service/src/test/resources/test-json-files
folder as text to be pasted in the Body section as Payload -
You can use KafkaTool to list the messages consumed and produced to the respective topics to verify the message was successfully produced and consumed respectively.
- Download the latest free version of Kafka Tool: http://www.kafkatool.com
- Connect to the Kafka installed in your minikube at the following host and port:
192.168.99.100:30092
- Monitor and manage the topics using the GUI