RabbitMQ Implementation

CargoDocs API integrates with RabbitMQ to handle Asynchronous Messaging in order to carry out smooth queue-related operations.

For each Set Action operation performed by the customer on the company's 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.


Usual Queue Process

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}_${CustomerId}

e.g., Parcels_Status_Queue_Prod_0a2b924a-44e4-11e9-9ed6-0a24491b68de 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 Customer has one queue created against a single Company whenever a partner is assigned to a company.

Parcels Status Queue

The ParcelsStatus_Queue{ENVIRONMENT}_{CUSTOMER ID} gets a new message whenever a Customer performs an Action which actually uses Set Action endpoint as per the actions defined in Get List of Functional Actions. e.g. Parcels_Status_Queue_Prod_0a2b924a-44e4-11e9-9ed6-0a24491b68de


Here is how a usual MQ operates during the Set Action endpoint consumption

Subscribing to Customer's Queue

A Customer needs to subscribe to Rabbit MQ in order 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 = "http://test-queue.essdatabridge.com";
VIRTUAL_HOST = "{customerId}";
USERNAME = "******";
PASSWORD = "**********";
AMQ_PORT = 5672;
QUEUE_NAME = "Parcels_Status_Queue_{customerId}";