-
Return to the Fortune Teller application directory that you finished in Lab 7:
$ cd $COURSE_HOME/labs/initial/fortune-teller
-
Using Maven, build and package the application:
$ mvn package
Maven will automatically download all of Fortune Teller's dependencies. This may take a few moments.
-
Run
scripts/create_services.sh
to create the services that you need:$ scripts/create_services.sh Creating service instance config-server in org org platform-eng / space nfjs-workshop as [email protected]... OK Creating service instance service-registry in org platform-eng / space nfjs-workshop as [email protected]... OK Creating service instance circuit-breaker in org platform-eng / space nfjs-workshop as [email protected]... OK Creating service instance fortune-db in org org platform-eng / space nfjs-workshop as [email protected]... OK
-
In your PCF Space Dashboard, click Manage for your Config Server instance:
-
In the resulting Config Server Dashboard, ensure that Git is selected, paste
https://github.com/saurabhguptasg/cnw-config-repo.git
into the Git URI field, and click Submit: -
Push the microservices:
$ cf push -f manifest-apps.yml
This will push the fortunes service and the ui application.
-
In a browser, access the fortunes-ui application at the route that was created for you:
-
In your PCF Space Dashboard, click Manage for your Circuit Breaker Dashboard instance:
-
Access the fortunes-ui and show that the circuit breaker is registering successful requests.
-
Stop the fortunes application:
$ cf stop fortune-service
-
Access the fortunes-ui and see that the “fallback fortune” is being returned.
-
Access the fortunes-ui and show that the circuit breaker is registering short-circuited requests.
-
Start the fortunes application:
$ cf start fortune-service
-
Continue to access the fortunes-ui and watch the dashboard. After the fortunes service has re-registered with Eureka and the fortunes-ui load balancer caches are refreshed, you will see the circuit breaker recover. You should then start getting random fortunes again!