Giter Club home page Giter Club logo

sea-shell-archiver's Introduction

sea-shell-archiver


Generic badge GitHub release GitHub contributors

CircleCI Build status sea-shell-archiver

Codacy Badge codebeat badge BCH compliance Known Vulnerabilities

Codacy Badge Coverage Status codecov

GitHub language count GitHub top language GitHub top language


Technologies Used


alt text alt text alt text alt text alt text alt text alt text alt text

Description

This project is a Sea Shell archiver for an imaginary world.

This is the description of that world:

Imagine a world were beings live in gigantic sea shells. Sea shells are their home. Inside you can find one or more people. You can also find one or more costumes with different configuration. The value of the shell is evaluated by the sum of the values of all the individual costumes. Every shell has a slogan.

For the purposes of this example I decided to use Cardi B's rap solo in "Girls like you" by Maroon 5 to establish slogans. As persons living inside shells I chose Game of Thrones charachters. For the rest, just my vivid imagination :).

This application is very old. Its design still is base on the paradigms of the time. It's implemented in SOAP. Furthermore, every single entity has a dedicated read service associated with it. As a result, every time you need to get the data from a particular sea shell, you have to make multiple requests. This situation warrants a solution. Times have changed and applications need to move faster and be scalable, but due to business restrictions I cannot change my SOAP services. A solution could be using Reactive Streams in the context of a Reactive architecture.

This is what this application is about.

Essentially this is a fun exercise to help understand some of the mechanisms behind the concepts described in the Reactive Manifesto.

Topics discussed:

This project is also the official support project of my article on medium:

alt text Reactive Programming applied to Legacy Services โ€” A WebFlux example

Revision dates: 2020/01/29,

In order to start interacting with it you need to start runnable modules:

  1. sea-shell-soap-service - SeaShellWiremockSoapLauncher - Soap mock service (The blocking source) - Runs on port 8090
  2. sea-shell-rest-service - SeaShellApplication - WireMock Rest Service data provider (Uses the SOAP blocking, legacy, outdated SOAP service) - Runs on port 8080
  3. sea-shell-client - Three executables to be used in running against sea-shell-rest-service using futures and fork joins. Be sure to run the REST service and the WireMock SOAP service
  4. sea-shell-sea-shell-service-immutable - Standalone compact service running in an immutable fashion using Java records - Runs on port 8081

In order to run the full example, please create your local bin folder

make build local

This will create the bin folder. The jars are self-explanatory. To run each one of them please use the corresponding command in different terminal windows:

java -jar sea-shell-soap-service.jar
java -jar sea-shell-rest-service.jar
java -jar sea-shell-service-immutable.jar

You can, alternatively, with your docker machine/desktop running, run a docker container:

docker compose up

To terminate your tests, you can just run

docker compose down

This project makes usage of image:

dockeri.co

Java version

sdk install java 16.0.1.hs-adpt
sdk use java 16.0.1.hs-adpt

Testing endpoints

Blocking and Almost Reactive Methods

  1. http://localhost:8080/seashells
  2. http://localhost:8080/seashells/1
  3. http://localhost:8080/seashells/slogans
  4. http://localhost:8080/seashells/block
  5. http://localhost:8080/seashells/block/1
  6. http://localhost:8080/seashells/reactiveblock
  7. http://localhost:8080/seashells/reactiveWithDelay
  8. http://localhost:8080/seashells/reactiveWithForkJoins

Reactive endpoints

  1. http://localhost:8080/seashells/reactive/1
  2. http://localhost:8080/seashells/reactive/rootCostume/1/1
  3. http://localhost:8080/seashells/reactive/rootShell/1/1
  4. http://localhost:8080/seashells/reactive/rootCostumeSlowTop/1/1
  5. http://localhost:8080/seashells/reactive/rootCostumeSlowLower/1/1

Reactive One endpoints

  1. http://localhost:8080/seashells/one
  2. http://localhost:8080/seashells/one/1
  3. http://localhost:8080/seashells/one/person/1
  4. http://localhost:8080/seashells/one/costume/1
  5. http://localhost:8080/seashells/one/account/1
  6. http://localhost:8080/seashells/one/top/1
  7. http://localhost:8080/seashells/one/lower/1

Immutable Reactive endpoints (the real deal!)

  1. http://localhost:8081/seashells/immutable
  2. http://localhost:8081/seashells/immutable/1
  3. http://localhost:8081/seashells/immutable/person/1
  4. http://localhost:8081/seashells/immutable/costume/1
  5. http://localhost:8081/seashells/immutable/account/1
  6. http://localhost:8081/seashells/immutable/top/1
  7. http://localhost:8081/seashells/immutable/lower/1

References

Please check the docs for more info.

Technical

Domain knowledge

Legacy

Hints and Tricks

Please check my documentation on Hints&Tricks for more details

If for any reason, the import of this project fails or the upgrade fails, please close your IDE. Via a shell run the following command:

git clean -xdf

This will remove all non-versioned files from your repo. It will allow your IDE to re-import fresh from start. Make sure that the caches are invalidated and removed in this case.

About me ๐Ÿ‘จ๐Ÿฝโ€๐Ÿ’ป๐Ÿš€๐Ÿณ๏ธโ€๐ŸŒˆ

alt text alt text alt text alt text Generic badge alt text alt text alt text alt text alt text alt text alt text alt text GitHub followers alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text Twitter Follow alt text alt text alt text alt text alt text alt text alt text VMware Spring Professional 2021 Oracle Certified Professional, JEE 7 Developer Oracle Certified Professional, Java SE 11 Programmer IBM Cybersecurity Analyst Professional Certified Advanced JavaScript Developer Certified Neo4j Professional Deep Learning Generic badge Generic badge Generic badge

sea-shell-archiver's People

Contributors

jesperancinha avatar dependabot[bot] avatar snyk-bot avatar github-actions[bot] 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.