Skip to main content
Version: 2.0

Subscribe to products events

Introduction

This section describes how to subscribe to events sent by rs-lta-manager microservice about submitted products requests as described in Create Product guide.

After your Submission request is sent, you will receive :

  1. A GRANTED or a DENIED response to inform you if your request has been accepted or not.
  2. A SUCCESS or an ERROR response to inform you that your request has been processed.

Requests and responses are linked with a correlation identifier correlationId that is provided into submission requests and added in service responses.

Regards AMQP api

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

Exchange

Product submission responses from REGARDS are sent to exchange :

ExchangeVirtual host
regards.broadcast.fr.cnes.regards.modules.ltamanager.amqp.output.SubmissionResponseDtoEventregards.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

Headers are the same for all kind of responses.

ParameterTypeDescription
regards.tenantStringTenant name depends on REGARDS instance project configuration.

Granted response

REGARDS will publish a granted notification on the response exchange when the request is validated.

{
"correlationId": "xxx",
"productId": "xxx",
"responseStatus": "GRANTED"
}
ParameterTypeOptionalDescription
correlationIdStringNoRequest identifier
productIdStringNoId of the product to create
responseStatusStringNoStatus of the request. More details below.

Success response

REGARDS will publish a success notification on the response exchange when the request is terminated in success.

{
"correlationId": "xxx",
"productId": "xxx",
"responseStatus": "SUCCESS",
"expires": "2022-12-22T10:25:52.243Z",
"session": "xxx",
"message": ""
}
ParameterTypeOptionalDescription
correlationIdStringNoRequest identifier
productIdStringNoId of the product to create
responseStatusStringNoStatus of the request. More details below.
expiresString Date ISO 8601NoRequest expiration date. Format yyyy-MM-dd'T'HH:mm:ss.SSSZ
sessionStringNoRequest session name
messageStringYesInformation message about your request

Invalid request responses

REGARDS will publish a denied notification on the response exchange when the request is not valid.

{
"correlationId": "xxx",
"productId": "xxx",
"responseStatus": "DENIED",
"message": ""
}
ParameterTypeOptionalDescription
correlationIdStringNoRequest identifier
productIdStringNoId of the product to create
responseStatusStringNoStatus of the request. More details below.
messageStringYesInformation message about your request

A request can be invalid, if :

  • Request is not well formed
  • Provided datatype is unknown or not configured.
How to handle it?

Look at your request, fix it and submit a new one.

Internal error responses

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",
"productId": "xxx",
"responseStatus": "ERROR",
"expires": "2022-12-22T10:25:52.243Z",
"session": "xxx",
"message": "Cause of the internal error"
}
ParameterTypeOptionalDescription
correlationIdStringNoRequest identifier
productIdStringNoId of the product to create
responseStatusStringNoStatus of the request. More details below.
expiresString Date ISO 8601NoRequest expiration date. Format yyyy-MM-dd'T'HH:mm:ss.SSSZ
sessionStringNoRequest session name
messageStringYesInformation message about your request
How to handle it?

Retry later with new request or contact REGARDS administrators.