Skip to main content

Queue API

Queues are part of the ZStorage Api, and are deeply integrated with tables allowing writes to be transactionally propagated to Queues and allowing for a robust development framework for distributed applications, consumers, publishers and finalizers.

In the Building Integration Services tutorial, we saw how tables can be synced with Queues to allow for durable writes and propagated queue message publishing on one single transaction.

Publishing Messages

By Queue Id

const api = new APIService("zstorage", token);
const queueId='...';
const msgPayload = {
handler: '_worker_handler_name',
// ...
// other attributes
}

api.post("queue/"+queueId+"/publish", msgPayload)
.then(function (Resp) {
// message-id
// queue-id
})

By Queue Name

const api = new APIService("zstorage", token);
const queueName='...';
const msgPayload = {
handler: '_worker_handler_name',
// ...
// other attributes
}

api.post("queue/a/"+queueName+"/publish", msgPayload)
.then(function (Resp) {
// message-id
// queue-id
})