Coder Social home page Coder Social logo

souravbh / greeting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spring-cloud-services-samples/greeting

0.0 1.0 0.0 415 KB

Sample applications demonstrating use of Service Registry for Pivotal Cloud Foundry.

Java 77.47% Batchfile 10.34% Shell 12.19%

greeting's Introduction

Service Registry sample

Expedition and Camelboy are example applications demonstrating the use of Service Registry for Pivotal Cloud Foundry. (For information on the Service Registry product, please see the documentation.)

Building and Deploying

  1. Build the two projects from the root (greeting) directory. If using Maven, run:

    $ mvn package

    If using Gradle, run ./gradlew build (OS X, Linux) or gradlew.bat build (Windows).

    $ ./gradlew build
  2. Run the deployment script (if you used Maven, scripts/deploy_mvn.sh or scripts/deploy_mvn.bat; if you used Gradle, scripts/deploy_gradle.sh or scripts/deploy_gradle.bat).

    $ ./scripts/deploy_gradle.sh

    The script will create a Service Registry service instance and then push the applications and bind them to the service.

Trying It Out

  1. Visit [ROUTE]/hello, where [ROUTE] is the route bound to the Camelboy application. The Camelboy application will use the Service Registry to look up the Expedition app and get a greeting message, which (to begin with) should be “Hello, camel boy!”

    link:docs/images/greeting.png
  2. You can see what the Expedition application is sending back by viewing its logs. Run cf logs expedition.

    $ cf logs expedition
    Connected, tailing logs for app expedition in org myorg / space outer as user...
    
    2015-07-16T13:07:35.86-0500 [App/0]      OUT 2015-07-16 18:07:35.861  INFO 29 ---
                         [o-61612-exec-10] expedition.ExpeditionApplication
                                                      : Now saying "Hello" to camel boy
    2015-07-16T13:07:35.87-0500 [RTR/0]      OUT expedition.wise.com:80 -
                         [16/07/2015:18:07:35 +0000]
                         "GET /greeting?salutation=Hello&name=camel%20boy HTTP/1.1" 200
                         31 "-" "Apache-HttpClient/4.3.6 (java 1.5)" 10.68.204.250:39929
                         x_forwarded_for:"10.68.204.43, 10.68.204.250"
                         vcap_request_id:66b782b6-9953-45b3-52ab-da369ad81f44
                         response_time:0.016146581
                         app_id:bd594ad5-2653-4949-afc6-e5f1ae568259
  3. To get a different greeting message, you can provide salutation and name parameters, as in [ROUTE]/hello?salutation=Come%20on&name=Jesse. The Camelboy application will send those parameters to the Expedition application and the resulting greeting will be customized to match.

    link:docs/images/greeting-with-parameters.png

greeting's People

Contributors

fifthposition avatar

Watchers

Sourav avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.