Skip to main content
Version: 1.14

Create Order AMQP

This guide describes how to order one or many products from the order service through AMQP interface.

Introduction

The diagram below explains the global processing of an order request by REGARDS system. For a REGARDS client using message queuing, the main steps are :

  1. Publish your product order request to REGARDS Rabbitmq server.
  2. Wait for notifications from REGARDS on its Rabbitmq server. Request status lifecycles can be :
    • DENIED
    • GRANTED -> SUBORDER_DONE (occurs 0 to many times) -> FAILED
    • GRANTED -> SUBORDER_DONE (occurs 1 to many times) -> DONE
  3. Download order archive everytime you receive a SUBORDER_DONE or DONE message. SUBORDER_DONE and DONE contains the URL to the Download ordered files REST API to download all available files related to an order.

sequence

Submit Order request

Exchange

Exchange to submit Order requests:
regards.broadcast.fr.cnes.regards.modules.order.amqp.input.OrderRequestDtoEvent

Order request format

Message headers

"regards.tenant": "tenant"
ParameterTypeOptionalDescription
regards.tenantStringNoTenant name depends on REGARDS instance project configuration

Message body content

{
"correlationId": "xxx",
"queries": [],
"user" : "",
"sizeLimitInBytes": "xx",
"filters": {
"dataTypes": [],
"filenameRegExp" : "",
}
}
ParameterTypeOptionalDescription
correlationIdStringNoThe request correlation id.
queriesLucene stringsNoList of lucene formatted queries to find products to order.
userStringNoEmail of your REGARDS user.
sizeLimitInBytesLongYesNumber to limit the size of the files ordered at once, in bytes.
filters.datatypesStringYesList of REGARDS datatypes to filter files from orderd products. Datatypes can be RAWDATA or QUICKLOOK
filters.filenameRegExpStringYesRegular expression to filter files by their names from orderd products.

NOTE: Here is the link to the REGARDS Lucene format

NOTE: A REGARDS user is mandatory to order products. Your user must be activated and remaining download quota must allow you to order.

Order request examples

If you want to retrieve a product by its identifier, the order request is :

{
"queries": [
"productId:my_product_identifier"
],
"user" : "myself@cnes.fr"
}

If you want to retrieve many products using their identifiers, the order request is :

{
"queries": [
"productId:(my_product_id_1 OR my_product_id_2 OR my_product_id_3 OR my_product_id_4)"
],
"user" : "myself@cnes.fr"
}

If you want to retrieve all products from a specific metadata like datatype (depends on configured REGARDS data models), the restoration request is:

{
"queries": [
"datatype:type1"
],
"user" : "myself@cnes.fr"
}

If you want to retrieve all products from a specific metadata like datatype (depends on configured REGARDS data models) and retrieve only image files, the restoration request is:

{
"queries": [
"datatype:type1"
],
"user" : "myself@cnes.fr",
"filters": {
"dataTypes": [
"QUICKLOOK"
],
}
}

Click on the link Get Order progress AMQP just below, you will discover responses RS-ORDER will send you for your order.