RabbitMQ Implementation
CargoDocs API integrates with RabbitMQ to handle Asynchronous Messaging to carry out smooth queue-related operations.
For each Set Action operation performed by the Partner on the Companies' behalf, the CargoDocs API process the request and update the partner's queue with the response. Against each update within the queue, the partner receives a notification to retrieve the message and process the parcel tracking accordingly.
Queue Naming Convention
The queues within CargoDocs follow singular conventions throughout to identify the type, environment, and partner directly. Naming convention is ${queue}Queue${enviroment}_${PartnerAPIKey}
e.g., Parcels_Shared_Queue_Dev_Voltron denotes the queue is for Shared Parcel status. And it is specifically available for Voltron (Partner) over the Dev environment.
API-Rabbit MQ Flow
Each Partner has three queues created against a single Company whenever a partner is assigned to a company.
Customers Assignment Queue
This queue CustomersAssignment_Queue{ENVIRONMENT}_{PARTNER} gets triggered when the CargoDocs admin assigns a partner to a specific company. The naming convention is consistent throughout the system. e.g. Customers_Assignment_Queue_Dev_Voltron. Voltron is a partner's name.
Set Action Initiation
Partner is notified through this queue to perform a Set Action method on behalf of a Company against a specific parcel.
Parcels Shared Queue
Whenever a Customer/Company logins to DocEx, share a parcel via UI. A new message is sent to the ParcelsShared_Queue{ENVIRONMENT}_{PARTNER} upon which the Partner gets notified. e.g. Parcels_Shared_Queue_Dev_Voltron.
Parcels Status Queue
The ParcelsStatus_Queue{ENVIRONMENT}_{PARTNER} gets a new message whenever a Customer performs an Action which uses Set Action endpoint as per the actions defined in Get List of Functional Actions. e.g. Parcels_Status_Queue_Dev_Voltron
Company / Partner Relationship
- A Company can have multiple partners under its wing. Company is also referred to as Customer within the documentation.
- A single partner can be under multiple Companies.
Subscribing to Partner's Queue
A Partner or Company needs to subscribe to Rabbit MQ to stay updated about all the ongoing transactions related to their entities.
Rabbit MQ Default Port
By default, the Rabbit MQ is accessible over Port
5672
The following RabbitMQ details to access our Sandbox AMQ service.
Env: RabitMQ access for Sandbox
HOST_NAME = "test-queue.essdatabridge.com";
VIRTUAL_HOST = "{customerId}";
USERNAME = "******";
PASSWORD = "**********";
AMQ_PORT = 5672;
QUEUE_NAME = "Parcels_Status_Queue_{customerId}";
Updated over 1 year ago