Spring Microservices In Action Chapter 4
Welcome to Spring Microservices in Action, Chapter 4. Chapter 4 builds on the material from Chapter 3 and introduces the concept of service registration and discovery patterns using Spring Cloud and Netflix's Eureka server. Using service discovery, you will be able to add and remove service instances without the clients having to know the physical locations of the service.
By the time you are done reading this chapter you will have built and/or deployed:
To build the code examples for Chapter 4 as a docker image, open a command-line window change to the directory where you have downloaded the chapter 4 source code.
Run the following maven command. This command will execute the Spotify docker plugin defined in the pom.xml file.
mvn clean package docker:build
Running the above command at the root of the project directory will build all of the projects. If everything builds successfully you should see a message indicating that the build was successful.
Now we are going to use docker-compose to start the actual image. To start the docker image, change to the directory containing your chapter 4 source code. Issue the following docker-compose command:
docker-compose -f docker/common/docker-compose.yml up
If everything starts correctly you should see a bunch of Spring Boot information fly by on standard out. At this point all of the services needed for the chapter code examples will be running.