This repository contains the university assignment. It was created for educational purposes only.
docker compose build
docker compose up
firefox localhost:3000
input-topic
(OnlineOrderRequest)output-topic-user
(UserServiceResponse)output-topic-order
(OrderServiceResponse)input-compensation-topic
(CompensationRequest)output-compensation-topic
(CompensationResponse)
OpenAPI 3 documentation is available at
localhost:8083/api/docs
Prepare a payload
payload='{
"id": null,
"payment": {
"cardNumber": "1234-5678-1234-5671",
"paymentId": "jg73bzlahf63vc9zfg",
"amount": 500
},
"order": [
{
"name": "milk",
"amount": 2
},
{
"name": "yoghurt",
"amount": 1
}
],
"user": {
"email": "[email protected]",
"firstName": "Ian",
"lastName": "Kowalski"
}
}'
Submit a new job
response=$(curl -X POST -H "Content-Type: application/json" --data "$payload" localhost:8083/api/shopping 2> /dev/null)
echo $response
Check for status (polling)
uuid=$(echo $response | grep -oP '(?<="id":").*?(?=")')
echo $(curl -H "Content-Type: application/json" "localhost:8083/api/shopping/$uuid" 2> /dev/null)
Prepare a payload
payload='{
"id": null,
"payment": {
"cardNumber": "1234-5678-1234-5671",
"paymentId": "jg73bzlahf63vc9zfg",
"amount": 500
},
"order": [
{
"name": "beer",
"amount": 2
},
{
"name": "yoghurt",
"amount": 1
}
],
"user": {
"email": "[email protected]",
"firstName": "Ian",
"lastName": "Kowalski"
}
}'
Submit a new job
response=$(curl -X POST -H "Content-Type: application/json" --data "$payload" localhost:8083/api/shopping 2> /dev/null)
echo $response
Check for status (polling)
uuid=$(echo $response | grep -oP '(?<="id":").*?(?=")')
echo $(curl -H "Content-Type: application/json" "localhost:8083/api/shopping/$uuid" 2> /dev/null)
If you ever doubt the quality of your code, take a look at this project.
*~ No philosopher has ever said*