How to send API request with RabbitMQ
Description
In this article, you will learn how to send API requests using RabbitMQ.
info
A unique parameter request_id is sent to identify requests.
Queues
When working with API in RabbitMQ, two queues are used:
api_req — queue for incoming requests;
api_resp — the queue that receives responses to requests (only if request_id is specified).
Structure of the sent JSON message
| Parameter | Type | Example | Required | Required |
|---|---|---|---|---|
| request_id | string | "abcd1234" | Yes, if the response to the request is necessary | Request ID |
| request | string | api/v1.1/campaigns/triggers/import_and_start_batch | Yes | API request path |
| body | JSON object | "body":{ | Yes | API request body |