Testing the Application Locally in a Docker Setup
Prerequisites
Docker installed on your machine.
Procedure
-
Execute the following command on a docker terminal to run the application image:
docker run -i -d -p 8080:8080 -p 8090:8090 -e COMMAND_NAME=WikiNews-Service bwce-hystrix.app
-
Execute the following command to view the logs to make sure that the application has started successfully.
docker logs <container name>
-
Get the IP address for the Docker machine.
-
Edit the
request_news.html file. Replace the URL "http://127.0.0.1:8080" with the IP address of the Docker machine and the port number.
-
Save the file.
-
Open the
request_news.html file in a web browser.
-
Click the
Get News from Wiki!
button to request headlines from the associated web page.
Result
In your Hystrix dashboard, use the following to view the configured command:
http://<DOCKER-HOST-IP>:8090/hystrix.stream
Copyright © 2021. Cloud Software Group, Inc. All Rights Reserved.