(Glue-2108) v3.1 Synchronous data consumption

GET /queues/consume endpoint allows the client to consume data from a Glue queue thus enabling synchronous data consumption. Consume queue can be executed in parallel to enable mass replication. It supports the following input parameters:

Parameter name

Description

Usage

Type

Parameter name

Description

Usage

Type

queueID

Glue Queue ID (FIFO consumer name)

Mandatory

JSON array object

format

Data output format

Mandatory

“CSV” or “JSON”

All input parameters are case insensitive. 

Example of REST API call: 

GET

http://servername:portnumber/dvd/glue/api/v3_1/queues/consume?sap-client=clientnumber

GET

http://servername:portnumber/dvd/glue/api/v3_1/queues/consume?sap-client=clientnumber

JSON body: 

{ "queueID": "ZTR_CUSTOMER_FIFO_C", "format": "JSON" }

Responses

204 

No data to fetch in Queue.

200 

Data package successfully fetched

400

Every error message is raised via code 400. The reason for the error is also provided; however further investigation might be needed on the SAP side.

Functionality is implemented in the SAP class /DVD/GL_EXT2_API_QUE_CON_V3_1

Consume replicated data

Consuming Queue data is part of a 2 steps replication where:

  • the first is a process used to populate the Glue Queue

  • the second are the consume requests executed via API.

The consume API can be executed in parallel and while the first process to populate the queue is still running. This means that it is possible that data will be consumed faster than is ingested in the queue. To make sure that no more data will be populating the queue is recommended to use the monitor API to monitor the replication request of step 1 Execute and monitor processes.

GET

http://servername:portnumber/dvd/glue/api/v3_1/processes/request?sap-client=clientnumber

GET

http://servername:portnumber/dvd/glue/api/v3_1/processes/request?sap-client=clientnumber

Once the replication is completed, data will still be present in the queue with the status 'Processed'. It is recommended to clean up the queue API Clean up Queue

POST

http://servername:portnumber/dvd/glue/api/v3_1/queues/cleanup?sap-client=clientnumber

POST

http://servername:portnumber/dvd/glue/api/v3_1/queues/cleanup?sap-client=clientnumber