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:
Stable Releases
- 1.0.0 - 34ff2b4b760ef28eab1f8243a60d6739bb0d374a
- 2.0.0 - 8b8b5ea74daa0fe71d04ba858ce57f9b09d1d959
- 2.0.1 - 3840b38fd0bd6d89b863a64544d0286f5d4111e3 - Java / JDK17
- 2.0.2 - 77969471de7e36234c26c1e435744f44e4be0690 - Major refactoring / Java / JDK 17
- 2.0.3 - c04b5c679a7110a1ad898d2670b5e0a9cf7c9cba - JDK17 / Kotlin 1.8 / Major services in Kotlin with WebFlux (Flux/Mono)
- 2.0.4 - 91a26aa25970f3e0bbc14716e406e5b0ae99926e - Kotlin 1.8 / REST Fixes / Introducing E2E tests
Revision dates: 2020/01/29,
To start interacting with it, you need to start runnable modules:
- sea-shell-soap-service - SeaShellWiremockSoapLauncher - Soap mock service (The blocking source) - Runs on port 8090 - (DEPRECATED) - There will be a major mock update on a coming version sometime.
- sea-shell-rest-service - SeaShellApplication - WireMock Rest Service data provider (Uses the SOAP blocking, legacy, outdated SOAP service) - Runs on port 8080
- 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
- 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
sdk install java 19-open
sdk use java $(sdk list java | grep installed | grep "| 19" | cut -d'|' -f6- | cut -d' ' -f2-)
- http://localhost:8080/seashells
- http://localhost:8080/seashells/1
- http://localhost:8080/seashells/slogans
- http://localhost:8080/seashells/block
- http://localhost:8080/seashells/block/1
- http://localhost:8080/seashells/reactiveblock
- http://localhost:8080/seashells/reactiveWithDelay
- http://localhost:8080/seashells/reactiveWithForkJoins
- http://localhost:8080/seashells/reactive/1
- http://localhost:8080/seashells/reactive/rootCostume/1/1
- http://localhost:8080/seashells/reactive/rootShell/1/1
- http://localhost:8080/seashells/reactive/rootCostumeSlowTop/1/1
- http://localhost:8080/seashells/reactive/rootCostumeSlowLower/1/1
- http://localhost:8080/seashells/one
- http://localhost:8080/seashells/one/1
- http://localhost:8080/seashells/one/person/1
- http://localhost:8080/seashells/one/costume/1
- http://localhost:8080/seashells/one/account/1
- http://localhost:8080/seashells/one/top/1
- http://localhost:8080/seashells/one/lower/1
- http://localhost:8081/seashells/immutable
- http://localhost:8081/seashells/immutable/1
- http://localhost:8081/seashells/immutable/person/1
- http://localhost:8081/seashells/immutable/costume/1
- http://localhost:8081/seashells/immutable/account/1
- http://localhost:8081/seashells/immutable/top/1
- http://localhost:8081/seashells/immutable/lower/1
Please check the docs for more info.
- Java Records tortured with Lombok yet again (builder edition)
- Why does ForkJoinPool::invoke() block the main thread?
- Flight of the Flux 1 - Assembly vs Subscription
- Hanselminutes Podcast 198 - Reactive Extensions for .NET (Rx) with Erik Meijer
- Reactive Extensions
- Reactive Programming by Venkat Subramaniam
- The Essence of Reactive Programming - TU Delft Repositories
- Notes on Reactive Programming Part I: The Reactive Landscape by Dave Syer
- The essence of reactive programming in Java by Uladzimir Sinkevich
- Don't be Homer Simpson with your reactor by Sergei Egorov
- Avoid Reactor Meltdown by Phil Clay on YouTube
- Avoiding Reactor Meltdown by Phil Clay
- JsonView Chrome Plugin
- Spring WebFlux Tutorial
- Wiremock Running as a Standalone Process
- Move your apps to the cloud in weeks
- The Twelve Factors
- DDD and Microservices: Like Peanut Butter and Jelly - Matt Stine
- Reactive Streams
- Reactive Manifesto
- Hands on Reactive Programming in Spring
- QPI Architecture
- ITNext How to make legacy code reactive
- Spring 5 Reactive Security Example
- Block Hound
- Lombok Tips And Tricks
- In spring boot webflux based microservice, who is the subscriber?
- How REST endpoints are auto subscribed while calling from Browser/REST Client?
- Reactive Programming with Node.js
- Spring Data R2DBC
- Exception occurred during code generation for the WSDL : java.lang.NoClassDefFoundError:
- Apache Axis2 1.6.4 Release Note
- Index of /dist/axis/axis2/java/core/1.6.4
- AXIS2 JAVA.LANG.NOCLASSDEFFOUNDERROR: ORG/APACHE/WS/COMMONS/SCHEMA/UTILS/NAMESPACEPREFIXLIST
- Upgrade to JDK12?
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.