Deploying the Hystrix Application

The following steps describe how to deploy the application to your Cloud Foundry environment using the cf command line interface tool.

Procedure

  1. Log into your Cloud Foundry environment using the cf command line interface.
  2. Copy the manifest file from the samples directory to the location where you placed your EAR file in the previous section.
  3. Edit the path variable in the manifest.yml file.
    Make sure you have the name of your Circuit Breaker service in your manifest file.
    This ensures that the Circuit_Breaker service will automatically bind to this application at deployment.
  4. Set the path to the location of the EAR file.
    Check the user provided or managed service name, it should match with the service in your Cloud Foundry environment.
  5. Save the file.
  6. In your Cloud Foundry environment change to the directory where you placed your EAR file.
  7. Execute the following command:
    
    cf push -f manifest.yml
    
    
  8. Copy the routable URL of the application once it starts executing.
  9. Edit the request_news.html page found in samples > container > cloudfoundry > core > Basic > Hystrix directory.
  10. Replace the URL http://127.0.0.1:8080 with the routable URL of the application.
    For example,
    bwce-hystrix.<domainName>.com).
  11. Save the file.
  12. Open the request_news.html file in a web browser
  13. Click the Get News from Wiki! button to request headlines from the associated web page.

Result

To see the log output use the command:
cf logs application name --recent

When the application deploys successfully, you will see a similar output in the console log:

16:13:31.231 INFO [Framework Event Dispatcher: Equinox Container: 007ddba5-b2ac-0016- 16a8-b400b6aea43d] com.tibco.thor.frwk.Application - TIBCO-THOR-
FRWK-300018: Deploying BW Application[tibco.bwce.sample.core.hystrix.application:1.0].
16:13:36.025 INFO [Framework Event Dispatcher: Equinox Container: 007ddba5-
b2ac-0016- 16a8-b400b6aea43d] com.tibco.thor.frwk.Application - TIBCO-THOR-FRWK-300021: All Application dependencies are resolved for Application[tibco.bwce.sample.core.hystrix.application:1.0]
16:13:38.266 INFO [Thread-21] com.tibco.thor.frwk.Application - TIBCO-THOR-FRWK-300006: Started BW Application[tibco.bwce.sample.core.hystrix.application:1.0] 05:00:28.966 INFO [bwEngThread:In-Memory Process Worker-2] c.t.b.p.g.L.t.b.s.p.h.R.Log - Response sent successfully!!

You can see the Hystrix dashboard in your Cloud Foundry environment as shown below: