This is test application which calculates current price of different crypto currencies. Information goes to kafka. Then, price is available by REST API. Coefficients of each stock is located in application.yml
file.
- Python3 and kafka-python library
- Java 8
- Maven
- Docker
- Run kafka in docker-container
docker-container up
- Run application
mvn spring-boot:run
- Send messages to kafka (you can use tests/producer.py script with 3 arguments: product name, source name, price)
- Get price of product by REST API GET request
localhost:8080/api/v1/{product}/price
- Package application:
mvn clean package
- Go to
tests/
folder - There are several bash scripts which are tests (suffix *test.sh)
- Run test
bash run-test.sh large_test
Tests are not stable for every environment because sleep
is used after commands to run kafka or spring-boot application. So, sometimes (first launching) it takes much time and tests fail. In near future I'm going to integrate application with kafka to docker container, then integrate it to JUnit by Maven plugin and use this approach as test infrastructure.