No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

SpringBoot JPA Bootstrap Employee Demo

The following demo shows how to use a H2 database while developing locally and then how to switch to a MySQl bound service instance in Pivotal Cloud Foundry. The blog entry below does into detail on how this works as well as how to enable the H2 web console in DEV mode.

alt tag

Running Locally

  • Clone and package as follows
$ git clone
$ mvn package
  • Run as follows

Note: You will need a Eureka Server running locally with @EnableEurekaServer annotation on your Spring Boot main class for this demo to run locally.

$ mvn spring-boot:run

Push to Pivotal Cloud Foundry

  • Create required services on PCF
$ cf create-service cleardb spark apples-mysql
$ cf create-service p-service-registry standard service-registry
  • Push using manifest.yml as follows ensuring you use the correct MySQL service name
- name: springboot-bootstrap-employee
  memory: 1G
  instances: 1
  random-route: true
  timeout: 180
  path: ./target/springbootjpabootstrapemployeedemo-0.0.1-SNAPSHOT.jar
    - apples-mysql
    - service-registry
  • Deploy to PCF
$ cf push 

Spring Cloud Service Registry - Bound Service Instance

alt tag

Pas Apicella [papicella at] is a Senior Platform Architect at Pivotal Australia