Guaranteed Delivery Sample¶
This sample demonstrates the Guaranteed Delivery
or the Fail Safe Delivery
concept.
This sample consists of a REST API called UserRegistrationAPI
, an Endpoint called UserRegistrationEP
, a Message processor called UserRegistrationMP
, a Message store called UserRegistrationMS
and two Sequences called UserRegistrationErrorSeq
and UserRegistrationResponseSeq
.
Also, it contains another REST API called MockAPI
to mimic the backend.
UserRegistrationAPI
receives the requests and stores them in the massage store. The message processor periodically polls from the message store and forwards the messages to the specified endpoint. The response return from the endpoint is injected to the response sequence. This payload will be logged and dropped at the end.
Deploying the sample¶
- Open the sample by clicking on the Guaranteed Delivery card.
- Give a folder location to save the sample.
- Open the
UserRegistrationMS
Message Store artifact and edit itsRabbitMQ credentials
accordingly. - Start the RabbitMQ broker.
- Build and run the sample in your Micro Integrator.
Running the sample¶
-
Once the sample is running you will get a runtime services view with the API swagger definition. You can test the API using the swagger editor or follow step 2 for manual invocation.
-
Open a terminal and run the following command to invoke the API.
curl --location --request POST 'http://localhost:8290/registeruserapi' --header 'Content-Type: application/json' \ --data-raw '{ "id": 1, "name": "Leanne Graham", "username": "Bret", "email": "[email protected]", "address": { "street": "Kulas Light", "suite": "Apt. 556", "city": "Gwenborough", "zipcode": "92998-3874", "geo": { "lat": "-37.3159", "lng": "81.1496" } }, "phone": "1-770-736-8031 x56442", "website": "hildegard.org", "company": { "name": "Romaguera-Crona", "catchPhrase": "Multi-layered client-server neural-net", "bs": "harness real-time e-markets" } }'