jed1337 / Microservices-REST-APIs-Using-Spring-Data-REST

Code used in Kesha William's Building Microservices REST APIs Using Spring Data REST Pluralsight course

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Microservices REST APIs Using Spring Data REST

Code used in Kesha William's Building Microservices REST APIs Using Spring Data REST Pluralsight course.

The original code can be found at her Gitlab repository.

Changes from the original code

A pom.xml file was added in each of the microservices so that Intellij will detect them as separate modules.

The project structure for each microservice is as follows (when applicable):

Folder type Path
Source Folders src\main\java
Test Source Folders src\test\main\java
Resources Folders src\main\resources
Excluded Folders target

Information

The application is split into three microservices: TicketManagement, ApplicationCatalog, and UserManagement.

Each microservice is ran on a different port and has its own H2 In Memory database.

We initialise the contents of the H2 database from onApplicationEvent(ContextRefreshedEvent) from each microservice.

On either initializing or refreshing the ApplicationContext, Spring raises the ContextRefreshedEvent. Typically a refresh can get triggered multiple times as long as the context has not been closed -Baeldung.

H2 credentials

Field Value
jdbc url jdbc:h2:mem:testdb
Username sa
Password (empty)

Usage

Start all three microservices. Their data can then be accessed via Postman.

About

Code used in Kesha William's Building Microservices REST APIs Using Spring Data REST Pluralsight course


Languages

Language:Java 100.0%