Skip to content

LearningByExample/reactive-ms-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

143 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reactive MicroServices Example

Build Status Coverage Status

info

This is an example of doing reactive MicroServices using spring 5 functional web framework and spring boot 2.

This service provide and API that will greet the user with a quote.

This example cover several topics:

  • Functional programing.
  • Reactive types.
  • Router Functions.
  • Static Web-Content.
  • Creation on Reactive Java Services/Components.
  • Error handling in routes and services.
  • Reactive Web Client to consume external REST Services.
  • Organizing your project in manageable packaging.

Includes and in depth look to testing using JUnit5:

  • Unit, Integration and System tests.
  • Mocking, including reactive functions.
  • BDD style assertions.
  • Test tags with maven profiles.

usage

To run this service:

$ mvnw spring-boot:run

Sample requests

API

Run the API via the embedded Swagger UI

Project Structure

  • main/java
    • /application : Main Spring boot application and context configuration.
    • /routers : Reactive routing functions.
    • /handlers : Handlers used by the routers.
    • /services : Services for the business logic needed by handlers.
    • /exceptions : Businesses exceptions.
    • /model : POJOs.
  • test/java:
    • /application : Application system tests.
    • /routers : Integration tests for routes.
    • /handlers : Unit tests for handlers.
    • /services : Unit tests for services.
    • /categories : Tests categories.
    • /model : POJOs used by the test.
    • /test : Helpers and base classes for testing.

References