Giter Site home page Giter Site logo

k1729p / study02 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 529 KB

Batchfile 9.66% Dockerfile 1.13% Java 76.96% HTML 12.26%
alps annotated-controllers docker docker-compose java mock-mvc mongodb reactive-mongo-repository reactive-rest-services reactive-streams springboot springboot-actuator webflux

study02's Introduction

Study02 README Contents

Topics: SpringBoot ● Spring WebFlux ● Reactive Streams ● Reactive REST ● MongoDB ● Docker ● MockMvc

Research the Reactive REST Web Service

On the server-side WebFlux supports two distinct programming models:

  • Functional Endpoints
  • Annotated Controllers
Project Study02 implements one of them, the "Annotated Controllers" programming model.


The flowchart with Docker containers 'study02' and 'mongo'.

The sections of this project:

  1. Docker Build
  2. Web Browser Client
  3. Curl Client

Java source code. Packages:

application sources :  kp



The domain objects class diagram.

The repositories for the document database MongoDB:

These repositories extend Spring ReactiveMongoRepository.


Java API Documentation


❶ Docker Build

Action:

1. With batch file "01 Docker build and run.bat" build the image and
start the container with the SpringBoot server.

1.1. Docker image is built using these files: Dockerfile and compose.yaml.


The screenshot of the created Docker containers.

Back to the top of the page


❷ Web Browser Client

Action:

1. With the URL http://localhost:8380 open in the web browser the home page.
2. On this home page select 'Load sample dataset' http://localhost:8380/loadSampleDataset.

2.1. The home page on the Docker link: http://localhost:8380.


The screenshot of the home page.

Below are presented the results from some selected links on the home page.

2.2. The 'Find department and employees by department name' (Mono) link: http://localhost:8380/aggregate/find/findByDepartmentName?departmentName=D-Name-1.

The controller method: kp.company.controller.CompanyController::findAggregateByDepartmentName.


The result from the 'Find department and employees by department name' (Mono).

2.3. The 'Find department and employees by department name' (Flux) link: http://localhost:8380/aggregateFlux/find/findByDepartmentName?departmentName=D-Name-1.

The controller method: kp.company.controller.CompanyController::findAggregateFluxByDepartmentName.


The result from the 'Find department and employees by department name' (Flux).

2.4. The 'Find all departments' link: http://localhost:8380/departments.

The controller method: kp.company.controller.DepartmentController::findDepartments.


The result from the 'Find all departments'.

2.5. The 'Find department by name' link: http://localhost:8380/departments/find/findByName?name=D-Name-1.

The controller method: kp.company.controller.DepartmentController::findDepartmentByName.


The result from the 'Find department by name'.

2.6. The 'Find all employees' link: http://localhost:8380/employees.

The controller method: kp.company.controller.EmployeeController::findEmployees.


The result from the 'Find all employees'.

2.7. The 'Find employee by first and last name' link: http://localhost:8380/employees/find/findByFirstNameAndLastName?firstName=EF-Name-101&lastName=EL-Name-101.

The controller method: kp.company.controller.EmployeeController::findEmployeeByFirstNameAndLastName.


The result from the 'Find employee by first and last name'.

2.8. The 'List of actuator endpoints' link: http://localhost:8380/actuator.


The result from the 'List of actuator endpoints'.

Back to the top of the page


❸ Curl Client

Action:

1. With batch file "03 CURL call server.bat" load the sample dataset and get departments and employees.

3.1. The screenshot of the console log from the run of the batch file "03 CURL call server.bat"

Back to the top of the page


study02's People

Contributors

k1729p avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.