Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sarakhild/resttemplate-integration-microservices

This project simplify the RestTemplate with Spring Boot
https://github.com/sarakhild/resttemplate-integration-microservices

integration mysql resttemplate springboot

Last synced: about 2 months ago
JSON representation

This project simplify the RestTemplate with Spring Boot

Awesome Lists containing this project

README

        

# Microservices Communication using RestTemplate


## Overview
In synchronous communication, the client sends a request and waits for a response from the service.And one of Synchronous Communication multiple Microservices is RestTemplate.


In this project, I have implemented department-service, user-service, and integration-service that communicate with these two Microservices. Besides that, I have separated the database for each Microservice.




## Usages
- Spring Boot
- Lombok
- RestTemplate
- MySQL


## Architecture of the Project

### 1-src folder

- User
- controller
- model
- dto
- objectmapper
- service
- repository

- Department
- controller
- model
- dto
- objectmapper
- service
- repository

- Integration
- client
- controller
- model

### 2-Maven pom.xml

- User and Department pom.xml:

```


org.springframework.boot
spring-boot-starter-data-jpa


org.springframework.boot
spring-boot-starter-web


com.mysql
mysql-connector-j
runtime


org.projectlombok
lombok
true


org.springframework.boot
spring-boot-starter-test
test

```


- Integration pom.xml:

```


org.springframework.boot
spring-boot-starter-web


org.projectlombok
lombok
true


org.springframework.boot
spring-boot-starter-test
test

```

### 3- User Application.properties.yml

```
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3312/db
spring.datasource.username=db
spring.datasource.password=nFLhPPKOnkW1FA1e
spring.jpa.show-sql=true

server.port = 8081

```

### 3- Department Application.properties.yml

```
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3312/db
spring.datasource.username=db
spring.datasource.password=nFLhPPKOnkW1FA1e
spring.jpa.show-sql=true

server.port = 8080

```
### 3- Integration Application.properties.yml

```
server.port = 8082

```

###### Output :star_struck:

resttemplateoutput

---

### Good Luck