(Glue-2305) Synchronous data consumption

GET /queues/consume endpoint allows the client to consume data from SNP 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

SNP 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/queues/consume?sap-client=800 

GET

http://servername:portnumber/dvd/glue/api/v3/queues/consume?sap-client=800 

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_QUEUE_CONSUME

Consume replicated data

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

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

  • the second is the consume request executed via API.

The consume API can be executed in parallel 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.

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/queues/cleanup?sap-client=800 

POST

http://servername:portnumber/dvd/glue/api/v3/queues/cleanup?sap-client=800