Name: PCC-Sample-App-PizzaStore
Owner: Pivotal Cloud Foundry
Description: Example sample application which uses Pivotal Cloud Cache(PCC) as a service on Pivotal Cloud Foundry
Created: 2017-12-29 15:18:17.0
Updated: 2018-05-23 18:16:51.0
Pushed: 2018-05-23 20:07:13.0
Size: 98
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Sample application for Pivotal Cloud Cache
This is a Spring Boot application which can pushed to Pivotal Cloud Foundry(PCF) using cf push
command that demonstrates some of Pivotal Cloud Cache?s(PCC) interesting features.
Steps.
./gradlew build
commandcf push
command to push the application on PCF. A PCF manifest.yml
file already exists at the main directorycf bind-service APP_NAME SERVICE_INSTANCE [-c PARAMETERS_AS_JSON]
. If service instance is not created create that using cf create-service p-cloudcache PLAN_NAME SERVICE_INSTANCE
Once application is deployed, hit the REST endpoint <url>/healthcheck
and you should see a 200 response code, if request was successful.Pivotal Cloud Cache (PCC) is a high-performance, high-availability caching layer for Pivotal Cloud Foundry (PCF). This is a sample application which uses PCC as a provider of NoSQL store to a Spring Boot application. This application is a Pizza store application that can be used to create Pizzas with different sauces. All the Pizzas are stored in PCC clusters. It uses Spring Repository abstractions.
We have 2 types of Objects that go into PCC (regions
in PCC/Pivotal GemFire language are analogous to a Map<>
)
Both use the Repository pattern to write to PCC.
The application leverages Spring controllers that expose operations you can perform over REST.
/healthcheck
- Does save()
and findById()
on Pizza region to check if everything is setup properly. It creates 2 types of Pizzas, a Plain Pizza with red sauce and chicken Pizza with white sauce./pestoOrder/{name}
- Creates a Pizza with chicken and pesto
sauce.Application has a Continuous Query registered on Pizza region whenever there is pesto
sauce pizza created on region application will make a entry in the Name
region.
PCC/Pivotal GemFire supports the notion of Continuous Query, which means a developer can specify any OQL pattern on regions
and when that condition is satisfied an event would be returned with event object. For more details see here.
spring-boot
to org.springframework.boot
Example for build.gradle:
ompile("org.springframework.data:spring-data-gemfire:$springDataGemfireVersion"){
exclude module: "io.pivotal.gemfire"
}
compile("io.pivotal.gemfire:geode-core:$gemfireVersion")
compile("io.pivotal.gemfire:geode-cq:$gemfireVersion")
compile("io.pivotal.gemfire:geode-wan:$gemfireVersion")
compile("io.pivotal.gemfire:geode-lucene:$gemfireVersion")