Skip to content

A Spring Boot microservice showcasing CRUD (GET, POST, PUT, DELETE) with a JSON file as storage, leveraging Java 8 Streams for filtering, mapping, and aggregation. Demonstrates customer–order–product model, advanced queries, and simple REST APIs. Built with Spring Boot, Jackson, and Maven.

Notifications You must be signed in to change notification settings

CodeCraftByRamcharan/java8-streams-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This microservice demonstrates the power of Java 8 Streams using a complex JSON dataset of customers, orders, and products. It covers all major Stream operations, including:

Filtering: filter(), anyMatch(), allMatch(), noneMatch()

Mapping: map(), mapToDouble(), flatMap()

Sorting: sorted()

Reduction: reduce(), sum(), max()

Collecting: collect(), Collectors.groupingBy(), Collectors.toList(), Collectors.joining()

Parallel Streams: parallelStream() for performance testing

Matching & Validation: allMatch, anyMatch, noneMatch

Aggregation: Total revenue, spending per customer, top products

Advanced operations: Optional, Map.Entry, and LinkedHashMap usage for sorted results

This project is perfect for learning, showcasing, and experimenting with Java 8 Stream API features.

Features / Endpoints

Get all customer names

Concatenate all customer names into a single string

Retrieve orders for a customer by ID

Get the latest order per customer

Fetch top N most expensive products

Get frequently purchased products

Compute total revenue (sequential & parallel)

Find big spenders

Check customer data validation: emails, order existence

Find the most expensive product

All endpoints are fully documented with Swagger/OpenAPI, including request parameters and example responses.

About

A Spring Boot microservice showcasing CRUD (GET, POST, PUT, DELETE) with a JSON file as storage, leveraging Java 8 Streams for filtering, mapping, and aggregation. Demonstrates customer–order–product model, advanced queries, and simple REST APIs. Built with Spring Boot, Jackson, and Maven.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published