Skip to main content
Version: 2.4.0

Subscribe to responses

Introduction​

This section describes how to subscribe to submission events responses sent by the rs-worker-manager microservice as described in the publish guide.

Requests and responses are linked with a correlation identifier : requestId that is provided in submission requests and added in the service responses.

Regards AMQP api​

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

Exchange​

Responses from REGARDS are sent to exchange :

Exchange (type fanout)Virtual host
regards.broadcast.fr.cnes.regards.modules.workermanager.amqp.events.out.ResponseEventregards.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 sent message
delivery_modeIntegerStandard RabbitMQ property for the delivery mode (persistent or not)

Headers​

ParameterTypeDescription
regards.tenantStringTenant name depends on the REGARDS instance project configuration.
regards.request.idStringRequest identifier.
regards.request.ownerStringName of the request provider
regards.request.sessionStringName of the session
regards.request.content_typeStringContent type of the request (content type accepted by the worker)
regards.converterStringConverter type for body (GSON or JACKSON)
regards.typeStringEvent type
regards.worker_idStringWorker type
Example of the properties and headers of a request event message
{
"priority": 1,
"delivery_mode": 2,
"content_encoding": "UTF-8",
"content_type": "application/json",
"headers": [
{
"regards.tenant": "tenant"
"regards.request.id": "requestId"
"regards.request.owner": "owner"
"regards.request.session": "session"
"regards.request.content_type": "contentType"
"regards.converter": "converter"
"regards.type": "fr.cnes.regards.modules.workermanager.amqp.events.out.ResponseEvent"
"regards.worker_id": "workerType"
}
}

Body​

{
"state": "...",
"messages": [
"xxx",
"yyy"
],
"requestId": "...",
"content": "...",
"type": "...",
"requestOwner": "..."
}
ParameterTypeDescription
stateStringResponse status (SKIPPED, GRANTED, DELAYED, INVALID_CONTENT, ERROR, SUCCESS)
messagesList of StringMessages provided by the worker
requestIdStringRequest identifier
contentbyteContent provided by the worker
typeString
requestOwnerStringRequest owner