anchor.diff: -= Fortune Teller
  += Spring Cloud Services
   
  -*Fortune Teller* is a very basic application composed of two services:
  -
  -. link:fortune-teller-fortune-service[Fortune Service] - serves up random Chinese fortune cookie fortunes
  -. link:fortune-teller-ui[Fortune UI] - presents a UI that consumes the fortune service
  +Spring Cloud Services for Pivotal Cloud Foundry® (PCF) packages server-side components of Spring Cloud projects, such as Spring Cloud Netflix and Spring Cloud Config, and makes them available as services in the Marketplace. This frees you from having to implement and maintain your own managed services in order to use the included projects. Taking advantage of these battle-tested patterns, and of the libraries that implement them, can now be as simple as including a few dependencies in your application build file and applying the appropriate annotation in your source code.
   
   It leverages libraries and services from Spring Cloud and Netflix OSS to compose the system.
   
  -Fortune Teller is deployable to any Cloud Foundry environment utilizing the service components that have been packaged with the project.
  -However, it is most easily deployed to Pivotal Cloud Foundry environments that have installed the https://network.pivotal.io/products/p-spring-cloud-services[Spring Cloud Services] package.
  +https://network.pivotal.io/products/p-spring-cloud-services[Spring Cloud Services] package.
  +
  +> These services are for deployment in a local dev machine or on Pivotal Web Services on run.pivotal.io
   
   == Building
   
  
positive.code: Creating service fortunes-db in org platform-eng / space nfjs-workshop as mstine@pivotal.io...
  OK
  ----
  
  . Push the microservices:
  +
  ----
  $ cf push -f manifest-apps.yml
  ----
  +
  This will push the fortunes service and the ui application.
  
  == Testing the Application
  
  . In a browser, access the fortunes-ui application at the route that was created for you:
  +
  image:docs/images/fortunes_1.png[]
  
  . Now, in another browser tab, access the Hystrix Dashboard at the route that was created for you.
  Enter the route for the UI application and click the ``Monitor Stream.''
  +
  NOTE: On Pivotal Cloud Foundry, you can access a pre-configured Hystrix Dashboard by clicking on the *Manage* link for *Circuit Breaker Dashboard*. You will *NOT* need to paste in the route.
  +
  image:docs/images/fortunes_2.png[]
  
  . Access the fortunes-ui and show that the circuit breaker is registering successful requests.
  +
  image:docs/images/fortunes_3.png[]
  
  . Stop the fortunes application:
  +
  ----
  $ cf stop fortunes
  ----
  
  . Access the fortunes-ui and see that the ``fallback fortune'' is being returned.
  +
  image:docs/images/fortunes_4.png[]
  
  . Access the fortunes-ui and show that the circuit breaker is registering short-circuited requests.
  +
  image:docs/images/fortunes_5.png[]
  
  . Start the fortunes application:
  +
  ----
  $ cf start fortunes
  ----
  
  . 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!
  
negative.code: $ mvn package
  ----
  +
  Maven will automatically download all dependencies. This may take a few moments.
  
  
  == Deploying to Pivotal Cloud Foundry with Spring Cloud Services
  