4.2 Docker Environment
Environment Setup
With completing this section the environment is configured. However, in the next few steps we will build theorder microservice and its container. After this section you will not be able
to start the environment as this container is still missing. You will be able to start it later.Changes to the docker-compose file
Since we are going to use Apache Kafka as a message broker, there are some changes to our docker-compose.yaml file.
Apache Kafka Broker
To use Apache Kafka the following was added to our docker-compose.yaml file:
| |
Kafka Viewer
Further a simple kafka-viewer microservice was added to the docker-compose.yaml. The kafka-viewer is a small web-UI which displays messages passing through our kafka topics.
| |
Microservice Configuration
To ensure your microservices will connect to the Kafka broker an additional property has been added to both microservices. The property KAFKA_BOOTSTRAP_SERVERS=kafka:9092 in the environment section will ensure that the microservices will connect to our kafka message broker.
Task 4.2.1 - Inspecting the docker environment
Have a look at the /code/kafka/docker folder and get familiar with the docker environment specified in docker-compose.yaml.