Incoming message queue handling
1. Reading the API queue
All incoming messages come through the same endpoint and they can be fetched from the API queue by HTTP GET to the certain endpoint. There are different endpoints for APIs and also different endpoints for test and production. See the correct endpoints from the API documentation of the implemented integration.
The Jakamo API will return messages from the queue one message at a time. Running multiple GET requests would always return the same message if the message is not cleared from the queue. The oldest undeleted message in the queue will be returned first.
Depending on the API, incoming messages can be for example Order or OrderChange messages (SO API), OrderResponse or order StatusMessage messages (PO API), or Claim response or claim StatusMessage messages (Claim API). Check all the message types from the specific API documentation of the implemented integration.
2. Clearing the API queue
After processing the incoming message (for example, after validation, save it on the disk, parse, import, etc.), the message should be clear from the queue. All incoming messages contain a value in the x-acknowledge-uri header. No message body content is needed and should not be used when sending a POST request to remove the message from the queue.
Steps how to remove the message from the API queue:
- HTTP POST to address found from x-acknowledge-uri to remove the message from the queue.
- The API will return HTTP response code
200 OK
and body message<Info>Message cleared from the queue</Info>
if your request succeeds.