All Projects → pivotal-cf → PCC-Sample-App-PizzaStore

pivotal-cf / PCC-Sample-App-PizzaStore

Licence: Apache-2.0 License
Example sample application which uses Pivotal Cloud Cache(PCC) as a service on Pivotal Cloud Foundry

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to PCC-Sample-App-PizzaStore

cf-k8s-networking
building a cloud foundry without gorouter....
Stars: ✭ 33 (+83.33%)
Mutual labels:  cloudfoundry
antifreeze
Cloud Foundry CLI plugin to detect if an app doesn't match the manifest
Stars: ✭ 21 (+16.67%)
Mutual labels:  cloudfoundry
credhub-cli
CredHub CLI provides a command line interface to interact with CredHub servers
Stars: ✭ 38 (+111.11%)
Mutual labels:  cloudfoundry
go-cfclient
Golang client lib for Cloud Foundry
Stars: ✭ 61 (+238.89%)
Mutual labels:  cloudfoundry
cf-python-client
Small cloudfoundry client implemented in python
Stars: ✭ 50 (+177.78%)
Mutual labels:  cloudfoundry
credhub
CredHub centralizes and secures credential generation, storage, lifecycle management, and access
Stars: ✭ 203 (+1027.78%)
Mutual labels:  cloudfoundry
gitlabby-dockerish-laravel
What happens when you Dockerize your Laravel testing environment and throw it at Gitlab CI?
Stars: ✭ 33 (+83.33%)
Mutual labels:  cloudfoundry
heroku-buildpack-deno
Heroku Buildpack for Deno
Stars: ✭ 72 (+300%)
Mutual labels:  cloudfoundry
mssql-server-broker
Cloud Foundry service broker for Microsoft SQL Server
Stars: ✭ 13 (-27.78%)
Mutual labels:  cloudfoundry
openbrokerapi
A python package for the V2 CF Service Broker API
Stars: ✭ 32 (+77.78%)
Mutual labels:  cloudfoundry
cf-abacus
CF usage metering and aggregation
Stars: ✭ 100 (+455.56%)
Mutual labels:  cloudfoundry
paas-templates
Bosh, CFAR, CFCR and OSB services templates for use with COA (cf-ops-automation) framework
Stars: ✭ 16 (-11.11%)
Mutual labels:  cloudfoundry
cf-sample-app-spring
Introduction to Cloud Foundry app deployment and management concepts.
Stars: ✭ 30 (+66.67%)
Mutual labels:  cloudfoundry
logistics-wizard
The Logistics Wizard is an end-to-end, smart supply chain management solution that showcases how to execute hybrid cloud, microservices, and predictive data analytics in the real world.
Stars: ✭ 99 (+450%)
Mutual labels:  cloudfoundry
cf-swagger
Collection of Swagger descriptions and applications for CloudFoundry BOSH
Stars: ✭ 22 (+22.22%)
Mutual labels:  cloudfoundry
uaa-cli
CLI for UAA written in Go
Stars: ✭ 22 (+22.22%)
Mutual labels:  cloudfoundry
loggregator
Archived: Now bundled in https://github.com/cloudfoundry/loggregator-release
Stars: ✭ 61 (+238.89%)
Mutual labels:  cloudfoundry
routing-release
This is the BOSH release for cloud foundry routers
Stars: ✭ 36 (+100%)
Mutual labels:  cloudfoundry
spring-cloud-app-broker
Spring Cloud project for implementing service brokers that conform to the Open Server Broker API specification
Stars: ✭ 26 (+44.44%)
Mutual labels:  cloudfoundry
cf-tools
Useful shell scripts for Cloud Foundry API v2
Stars: ✭ 22 (+22.22%)
Mutual labels:  cloudfoundry

Example Spring Boot Application for VMware Tanzu GemFire For VMs

This versioned example app for VMware Tanzu GemFire is a Spring Boot app that can be used with a Tanzu GemFire service instance. This branch demonstrates deployment scenarios for an app, and how the app's location affects communication with a Tanzu GemFire For VMs service instance. Branches of this git repository correspond to the Tanzu GemFire version that this app will work with. Check out and run the app from the branch that matches your Tanzu GemFire tile version. For example, if your Tanzu GemFire service instance is version 1.13, check out this repository's release/1.13 branch.

The app uses Spring Boot for Apache Geode (SBDG) to talk to the Tanzu GemFire service instance. The app provides a REST interface that lets a user view pizzas, place orders, and view an order. The app leverages Spring Web MVC controllers to expose data access operations.

Pizzas are stored in the Tanzu GemFire servers running within the Tanzu GemFire service instance. The app uses a Spring Data Repository to store, access, and query data stored on the servers. The app stores data in the Pizza repository (repositories are referred to as regions in Tanzu GemFire). See GemFire Basics for the briefest of introductions to Tanzu GemFire, and see Region Design for a quick tour of Tanzu GemFire regions.

Interacting With the App

The app talks to a Tanzu GemFire service instance. The app does create, read, and delete CRUD operations on data held in a region within service instance.

The app exposes these endpoints:

  • https://APP-URL/

    Prints the available app endpoints.

  • https://APP-URL/ping

    Prints PONG! if the app is running.

  • https://APP-URL/preheatOven

    Creates three pre-defined pizzas, which adds them to the region.

  • https://APP-URL/pizzas

    Gets all pizzas from the region.

  • https://APP-URL/pizzas/{name}

    Gets details of a pizza specified by its name.

  • https://APP-URL/pizzas/order/{name}

    Orders a given pizza, which does a create operation. For example: https://APP-URL/pizzas/order/myCustomPizza?sauce=MARINARA&toppings=CHEESE,PEPPERONI,MUSHROOM orders a pizza named myCustomPizza, which has MARINARA sauce and three toppings.

  • https://APP-URL/cleanSlate

    Deletes all pizzas from the region.

Prerequisites

  • The cf CLI will be used.
  • Log in to your CF (TAS) environment.
  • The CF (TAS) environment should have a Tanzu GemFire for VMs Tile installed.

App Location

An app that uses a Tanzu GemFire service instance may be located in one of three locations, as specified in The App's Location. This app demonstrates all three possibilities of app location using Spring profiles.

In addition, the app may be run locally, without having a Geode or Tanzu GemFire service instance. All four running environments are described.

Run the App in a Local Environment

This Spring Boot app can run locally, without having an Apache Geode or Tanzu GemFire service instance. Uncomment the annotation @EnableClusterAware in the app's source file src/main/java/io/pivotal/cloudcache/app/config/PizzaConfig.java to enable redirecting cache operations operations to LOCAL regions when there is no service instance to talk to. It implements an embedded cache on the client.

To run the app in the local environment,

$ ./mvnw spring-boot:run

Ignore the ConnectException: Connection refused from the root of this repository.

Use the running app:

Use a web browser to talk to the app at http://localhost:8080.

Run the App in the Same Foundation as the Service Instance (Services Foundation App)

When the app and the service instance are in the same foundation, SBDG eliminates the need to do any security configuration. Credentials and TLS configurations are auto applied.

Run the app as a services foundation app:
  1. Make note of the SERVICE-INSTANCE-NAME when you Create a Service Instance. The service instance may be TLS-enabled or not TLS-enabled.

  2. Modify the manifest.yml file to provide the service instance name. Replace SERVICE_INSTANCE with your noted SERVICE-INSTANCE-NAME. Remove the # character so that the line is no longer a comment.

  3. Build the app:

    $ ./mvnw clean install
    
  4. With a current working directory of PCC-Sample-App-PizzaStore, push the app to your services foundation with a cf push command. Note the app's route (APP-URL).

Use the running app:

Interact with the running app by hitting the endpoints exposed by the app.

You can use gfsh to inspect the service instance. Follow the instructions in Accessing a Service Instance to connect to the cluster using gfsh.

Run the App in an App Foundation

Running an app foundation app requires a service gateway. To set up a service gateway, follow the directions in Configure a Service Gateway.

Run the app as an app foundation app:

  1. Make note of the SERVICE-INSTANCE-NAME when you Create a Service Instance. Provide the optional parameters for enabling TLS and specifying the creation of a service gateway.

  2. Follow these instructions to Create Truststore for the App. Note the password you set for the truststore.

  3. Copy the truststore to the resources directory within the app source code.

  4. Follow these instructions to Create a Service Key.

  5. Edit the app's src/main/resources/application-app-foundation.properties file, and specify the properties described in Specifying Application Properties. Find the values needed in the service key and the truststore.

  6. Edit the app's manifest_app_foundation.yml file to specify the truststore password noted when you created the truststore.

  7. Build the app:

    $ ./mvnw clean install
    
  8. Do a cf login that targets the app foundation's org and space. With a current working directory of PCC-Sample-App-PizzaStore, push the app to the app foundation, specifying the manifest:

    $ cf push -f manifest_app_foundation.yml
    

    Note the app's route (APP-URL).

Use the running app:

Interact with the running app by hitting the endpoints exposed by the app.

Run the App Off Platform

Running an app that is not on any Cloud Foundry foundation requires a service gateway. To set up a service gateway, follow the directions in Configure a Service Gateway.

Run the app locally, and not on any foundation:

  1. Make note of the SERVICE-INSTANCE-NAME when you Create a Service Instance. Provide the optional parameters for enabling TLS and specifying the creation of a service gateway.

  2. Follow these instructions to Create Truststore for the App. Note the password you set for the truststore.

  3. Copy the truststore to the resources directory within the app source code.

  4. Follow these instructions to Create a Service Key.

  5. Edit the app's src/main/resources/application-off-platform.properties file, and specify the properties described in Specifying Application Properties. Find the values needed in the service key and the truststore.

  6. Build the app:

    $ ./mvnw clean install
    
  7. Run the app locally:

    $ ./mvnw spring-boot:run -Dspring-boot.run.profiles=off-platform -Dspring-boot.run.jvmArguments="-Djavax.net.ssl.trustStore=/tmp/mytruststore1.jks -Djavax.net.ssl.trustStorePassword=PASSWD-HERE"
    

    replacing PASSWD-HERE with the truststore password noted when you created the truststore.

Use the running app:

Interact with the running app by hitting the endpoints exposed by the app at http://localhost:8080.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].