dentinger / pcf-workspace-devops

PCF Workspace for DevOps Workshop

Home Page:https://github.com/cf-platform-eng/spring-boot-cities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building and consuming a cloud-ready Microservice

This repository contains a sample project to demonstrate building and deploying a simple Spring Boot based microservice and a web app to consume the microservice.

This project contains three sub-projects:

Components

The following sections describe the components from the bottom up.

cities-service

The cities-service subproject is an example of a very simple but fully functional microservice. The microservice is built using:

Key concepts:

cities-client

The cities-client subproject provides a client library for use by Java apps consuming the microservice. The main goal of this library is to show an example of a Spring Cloud Connectors extension for consuming a microservice in a cloud environment.

The client library uses Feign to expose the microservice REST API using a Repository pattern. This provides a nice analog to the Repository abstraction used by Spring Data.

The same Spring Cloud Connectors extension technique could be used to create lower-level REST API connection objects like Spring RestTemplate or Apache HttpClient.

Key concepts:

cities-ui

The cities-ui subproject is a web UI application that uses the client library to consume the microservice REST API. It is built using Spring Boot and AngularJS.

Key concepts:

Note on data import

The microservice loads a very large dataset at startup to show the power of the paging, sorting, and search capabilities in Spring Data. The default import.sql file contains just under 43,000 small rows (representing all postal codes in the United States) that get loaded when the application starts.

Free database service tiers on public Cloud Foundry services often limit the size of the database you can use and the number of records you can load at startup. You will likely need to reduce the size of the dataset when deploying to a public Cloud Foundry service with a free database tier.

The default import.sql file works with the in-memory HyperSQL database (HSQLDB) and MySQL.

About

PCF Workspace for DevOps Workshop

https://github.com/cf-platform-eng/spring-boot-cities


Languages

Language:Java 40.8%Language:CSS 30.2%Language:HTML 19.3%Language:JavaScript 6.7%Language:Shell 3.0%