

Url: jdbc:mysql://localhost/univdb?autoReconnect=true&useSSL=false Here the connectivity to the local database has been specified using Spring Boot and looks like this:. This approach is demonstrated in the cf-db-services-sample-auto project. Approach 1 – Do nothing, let the Java buildpack handle the connectivity details Now that we have an application that works locally and on a sample local Cloud Foundry, these are the approaches to connecting to a service instance. If you have an installation of PCF Dev running locally, you can try out a deployment of the application the following way:Ĭf api -skip-ssl-validationĬf login # login with admin/admin credentialsĬreate a Mysql service instance: cf create-service p-mysql 512mb mydbĪnd push the app! (manifest.yml provides the binding of the app to the service instance) cf pushĪn endpoint should be available at Approaches to service connectivity GRANT ALL ON univdb.* TO up the Spring-Boot under cf-db-services-sample-auto: mvn spring-boot:runĪnd an endpoint with a sample data will be available at Trying this application on Cloud Foundry
Run a local cloud foundry instance mac osx#
To try the application locally, first install a local mysql server database, on a Mac OSX box with homebrew available, the following set of commands can be run: brew install mysql
Run a local cloud foundry instance code#
The entire source code and the approaches are available at this github location if you want to jump ahead. The domain instances are persisted to a MySQL database. The application is fairly simple Spring-Boot app, it is a REST service exposing three domain types and their relationships, representing a university – Course, Teacher and Student. The objective of this post is to list out of the options you have in integrating your Java application to a service instance – this demo uses mysql as a sample service to integrate with but the approach is generic enough. The rest of the post assumes that you have an installation of Cloud Foundry available to you and that you have a high level understanding of Cloud Foundry.

If you want to try out Cloud Foundry the simplest way to do that is to download the excellent PCF Dev or to create a trial account at the Pivotal Web Services site.
