Thanks to visit codestin.com
Credit goes to github.com

Skip to content

guilhermescherer/reactive-foo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MS-Foo

A reactive Spring Boot microservice built with Java 21, WebFlux, and R2DBC for PostgreSQL integration.

Features

  • Reactive Programming: Built with Spring WebFlux and R2DBC
  • Real-time Streaming: Server-Sent Events (SSE) for live data updates
  • Database Integration: PostgreSQL with Flyway migrations
  • CRUD Operations: Full REST API for Foo entities
  • Containerized: Docker Compose setup included

Tech Stack

  • Java 21
  • Spring Boot 3.5.5
  • Spring WebFlux
  • Spring Data R2DBC
  • PostgreSQL 16
  • Flyway
  • Docker

Quick Start

Prerequisites

  • Java 21+
  • Docker & Docker Compose
  • Maven 3.6+

Running the Application

  1. Start PostgreSQL:

    docker-compose up -d
  2. Run the application:

    ./mvnw spring-boot:run

The application will start on http://localhost:8080

API Endpoints

REST API

  • GET /foo - List all Foo entities
  • POST /foo - Create new Foo entity
  • DELETE /foo/{id} - Delete Foo entity

Streaming API

  • GET /foo/stream - Server-Sent Events stream of Foo updates

Database

PostgreSQL database runs on port 1111 with:

  • Database: foo
  • Username: postgres
  • Password: postgres

Flyway handles database migrations automatically on startup.

Development

Build

./mvnw clean package

Test

./mvnw test

Docker Build

docker build -t ms-foo .

Project Structure

src/
├── main/java/com/guilhermescherer/msfoo/
│   ├── controller/     # REST controllers
│   ├── dto/           # Data Transfer Objects
│   ├── model/         # Entity models
│   ├── repository/    # R2DBC repositories
│   └── service/       # Business logic
└── main/resources/
    ├── db/migration/  # Flyway migrations
    └── application.properties

License

This project is licensed under the MIT License.

About

Spring Boot 3.5.5 reactive microservice (ms-foo) built with Java 21, WebFlux, and R2DBC for PostgreSQL. Features CRUD operations for Foo entities with reactive streams, SSE endpoints, Flyway migrations, and Docker Compose setup. Uses reactive programming patterns with Mono/Flux and includes real-time data streaming capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages