MicroProfile LRA Expandability Evaluation
This project is part of the evaluation of a Saga pattern implementation using MicroProfile LRA. The original Saga Pattern Realization with MicroProfile LRA has been extended by a CustomerService in order to evaluate the expandability of an implementation using Eventuate Tram to realize the Saga pattern. The CustomerService has to authorize the customer before a hotel is being booked.
Start the Application
-
Run
./gradlew clean build
-
Execute
docker-compose up
-
Requesting trip bookings is now possible. Either use
curl
commands, the providedTravelApplication.json
insomnia file, which includes different trip booking requests, or access the Swagger UI of the different services:
Service | URL to Swagger UI |
---|---|
TravelService | http://localhost:8090/openapi/ui/ |
LRA Coordinator (included in TravelService) | |
HotelService | http://localhost:8081/openapi/ui/ |
FlightService | http://localhost:8082/openapi/ui/ |
CustomerService | http://localhost:8083/openapi/ui/ |
An example for such a request:
{
"duration":
{
"start":"2021-12-01",
"end":"2021-12-12"
},
"start":
{
"country":"Scotland",
"city":"Stirling"
},
"destination":
{
"country":"Sweden",
"city":"Stockholm"
},
"travellerName": "Max Mustermann",
"boardType":"breakfast",
"customerId":"1"
}
To simulate a Saga that fails because no hotel or no flight is available, use one of the following Strings
as destination country
in the trip booking request:
"Provoke hotel failure"
"Provoke flight failure"
To simulate a Saga that fails because the customer validation failed, the customerId
in the trip booking request
has to be smaller than 1, for example:
{
...
customerId: "-1"
}
The services also provide a general health endpoint that shows information about the system whether it is up and running. These endpoints can be accessed via:
TravelService | http://localhost:8090/health |
HotelService | http://localhost:8081/health |
FlightService | http://localhost:8082/health |
CustomerService | http://localhost:8083/health |
If you are on Windows or Mac, you sometimes have to replace localhost with the default IP of your docker machine (use docker-machine ip default
to get this default IP).
Stop the Application
To stop the application and remove the created containers, execute the following command:
docker-compose down --remove-orphans
Code Link
MicroProfile_Implementations/MicroProfile_Expandability-Evaluation