Skip to content

This project simplify the Spring WebFlux MicroServices and WebClient Integration.

Notifications You must be signed in to change notification settings

SaraKhild/Reactive-APIs-Micorservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie Reactive API MicroService


Overview

In this project I built MicroServices using the concept of Spring WebFlux where communicating with each other by WebClient and handling requests.

Usages

  • SpringBoot
  • Spring WebFlux
  • WebClient
  • JUnit5 test
  • Mongodb

Architecture of the Project

1-src folder

  • MovieInfo

    • controllers folder
    • models folder
    • services folder
    • repositories
  • MovieReview

    • exceptions folder
    • handlers folder
    • models folder
    • services folder
    • repositories folder
    • routers folder
  • Movie

    • Client folder
    • controllers folder
    • exceptions folder
    • handlers folder
    • models folder

2-Maven pom.xml


  • MoiveInfo and MovieReview pom.xml:
 <dependencies>
	<dependency>
	   <groupId>org.springframework.boot</groupId>
	   <artifactId>spring-boot-starter-webflux</artifactId>
        </dependency>
  
        <dependency>
	  <groupId>io.projectreactor</groupId>
          <artifactId>reactor-test</artifactId>
	  <scope>test</scope>
	</dependency>
  
        <dependency>
	  <groupId>org.projectlombok</groupId>
	  <artifactId>lombok</artifactId>
	  <version>1.18.20</version>
	  <scope>provided</scope>
	</dependency>
  
        <dependency>
	  <groupId>org.springframework.boot</groupId>
	  <artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
	  <version>2.7.4</version>
	</dependency>

	<dependency>
	  <groupId>org.springframework.boot</groupId>
	  <artifactId>spring-boot-starter-test</artifactId>
	  <scope>test</scope>
	  <exclusions>
	    <exclusion>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
	    </exclusion>
	 </exclusions>
	</dependency>
  
	<dependency>
	  <groupId>org.junit.jupiter</groupId>
	  <artifactId>junit-jupiter-engine</artifactId>
	  <scope>test</scope>
	</dependency>

	<dependency>
	  <groupId>io.projectreactor</groupId>
	  <artifactId>reactor-test</artifactId>
	  <scope>test</scope>
        </dependency>
  
        <dependency>
	  <groupId>org.springframework.boot</groupId>
	  <artifactId>spring-boot-starter-validation</artifactId>
	  <version>2.7.4</version>
	</dependency>
</dependencies>

  • Movie pom.xml:
<dependencies>
	 <dependency>
	    <groupId>org.springframework.boot</groupId>
	    <artifactId>spring-boot-starter-webflux</artifactId>
	</dependency>

        <dependency>
	  <groupId>org.springframework.boot</groupId>
	  <artifactId>spring-boot-starter-test</artifactId>
	  <scope>test</scope>
	</dependency>
 
        <dependency>
	    <groupId>org.springframework.cloud</groupId>
	    <artifactId>spring-cloud-contract-wiremock</artifactId>
	    <version>3.1.4</version>
	</dependency>

	<dependency>
	   <groupId>com.github.tomakehurst</groupId>
	   <artifactId>wiremock-jre8</artifactId>
	   <version>2.34.0</version>
	   <scope>test</scope>
	</dependency>

        <dependency>
	  <groupId>io.projectreactor</groupId>
	  <artifactId>reactor-test</artifactId>
	  <scope>test</scope>
	</dependency>
	
	<dependency>
	  <groupId>org.projectlombok</groupId>
	  <artifactId>lombok</artifactId>
	  <version>1.18.20</version>
	  <scope>provided</scope>
	</dependency>
 
        <dependency>
	  <groupId>org.springframework.boot</groupId>
	  <artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
	  <version>2.7.4</version>
	</dependency>

	<dependency>
	  <groupId>com.github.tomakehurst</groupId>
	  <artifactId>wiremock-standalone</artifactId>
	  <version>2.27.2</version>
	  <scope>test</scope>
	</dependency>
</dependencies>

3-Application.properties.yml

spring:
    data:
       mongodb:
         database: moviedb
         host: localhost
         port: 27017

spring.datasource.username: moviedb
spring.datasource.password: nFLhPPKOnkW1FA1e
spring.data.mongodb.auto-index-creation: "true" 

Let's Start 🦾

Run the program


  • 1- run MovieInfo and add information on postman

movieInfo-get

  • 2- run MovieReview and add information on postman

movieReview-get

  • 3- run Movie to get information and review about movie by id on postman

movie-get



Good Luck

About

This project simplify the Spring WebFlux MicroServices and WebClient Integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages