Skip to main content
Version: 2.4.0

Monitor a delivery request progress

Introduction​

This section describes how to subscribe to events sent by rs-delivery microservice about submitted delivery requests as described in Publish a delivery request event.

Regards AMQP api​

The Regards AMQP API concept describe how AMQP interfaces must be handled to submit events or to subscribe to events.

Exchange​

Delivery requests responses from REGARDS are sent to exchange :

ExchangeVirtual host
regards.broadcast.fr.cnes.regards.modules.ltamanager.amqp.output.DeliveryResponseDtoEventregards.multitenant.manager

Queue​

Every consumer of this exchange must create its own queue bound to this exchange.

Message format​

Properties​

ParameterTypeDescription
app_idStringStandard RabbitMQ property to track message origin.
priorityIntegerStandard RabbitMQ property to sort messages by priority order.
content_encodingStringStandard RabbitMQ property for the encoding type of the message
content_typeStringStandard RabbitMQ property for the MIME Type of the message sent
delivery_modeIntegerStandard RabbitMQ property for the delivery mode (persistent or not)

Headers​

ParameterTypeDescription
regards.tenantStringTenant name depends on REGARDS instance project configuration.
regards.typeStringType of content of the message
Example of the properties and headers of an Ingest request event message
{
"app_id": "{ID of app}",
"priority": 1,
"delivery_mode": 2,
"content_encoding": "UTF-8",
"content_type": "application/json",
"headers": [
{
"regards.tenant": "REGARDS",
"regards.type": "fr.cnes.regards.modules.delivery.amqp.output.DeliveryResponseDtoEvent"
}
]
}

GRANTED body​

REGARDS publishes a granted notification when the delivery request is valid and ready to be processed.

{
"correlationId": "xxx",
"status": "GRANTED"
}
ParameterTypeOptionalDescription
correlationIdStringNoRequest identifier.
statusStringNoThe request is granted.

DONE body​

REGARDS publishes a done notification when the delivery has been processed successfully, i.e, the zip with files ordered has been uploaded to the S3 server.

{
"correlationId": "xxx",
"status": "DONE",
"url": "xxx",
"md5": "xxx"
}
ParameterTypeOptionalDescription
correlationIdStringNoRequest identifier.
statusStringNoThe delivery request has been processed successfully.
urlStringNoS3 formatted zip location (s3://bucket/correlationId/zipName.zip). The naming conventions for the zip file and its contents are described in the Manual.
md5StringNoZip checksum in MD5 format.

DENIED body​

REGARDS publishes a denied notification when the request is not valid.

{
"correlationId": "xxx",
"status": "DENIED",
"message": "xxx",
"errorType": "xxx"
}
ParameterTypeOptionalDescription
correlationIdStringNoRequest identifier.
statusStringNoThe request cannot be processed.
messageStringYesDescription of the error.
errorTypeStringNoAssociated error code.

A request can be invalid, if the delivery request is not well-formed.

How to handle it?

See the request format, fix your payload and submit a new request.

ERROR body​

After request has been granted by REGARDS, internal errors may occur. In such case, an error response will be published on the response exchange.

{
"correlationId": "xxx",
"status": "ERROR",
"message": "xxx",
"errorType": "xxx"
}
ParameterTypeOptionalDescription
correlationIdStringNoRequest identifier.
statusStringNoThe request cannot be processed.
messageStringYesDescription of the error.
errorTypeStringNoAssociated error code.

There are several error types:

Error TypeDescription
INVALID_CONTENTThe delivery request is malformed.
FORBIDDENThe provided user is not allowed to access delivery features.
ORDER_LIMIT_REACHEDThe order requested is too big and cannot be performed.
TOO_MANY_SUBORDERSThe order returns more than one sub-order for a given delivery request. Only one sub-order is allowed for now.
EMPTY_ORDERThe order requested contains no data to order.
EXPIREDThe delivery request has expired.
INTERNAL_ERRORAn internal error occurred during the processing of the order.
How to handle it?

Retry later with a new request or contact REGARDS administrators.