-
Notifications
You must be signed in to change notification settings - Fork 0
REST API
ivan770 edited this page Dec 21, 2020
·
4 revisions
-
id
- ID in UUID format. -
body
- Message body (UTF-8 string). -
state.status
- Message status (Available
orTransit
). -
state.tries
- Reservation tries. -
state.max_tries
- Max reservation tries. If current count is equal to max count, then GC will collect the message. -
time.offset
- Timezone offset in seconds. For example, offset of timezone UTC+3 is10800
. -
time.timestamp
- RFC 3339 datetime of message push. -
time.delay
- RFC 3339 datetime of message delay. -
time.timeout.max
- Max execution time of message in seconds. -
time.timeout.obtained_at
- RFC 3339 datetime of message reservation.
HTTP status code: 404
Queue not found
GET /<queue>
{
"message": {
"id": "123e4567-e89b-12d3-a456-426655440000",
"body": "Test",
"state": {
"status": "Transit",
"tries": 1,
"max_tries": 3
},
"time": {
"dispatched_at": "2020-12-21T14:33:25+01:00",
"delay": "2020-12-21T14:33:30+01:00",
"timeout": {
"max": 60,
"obtained_at": "2020-12-21T14:33:35+01:00"
}
}
}
}
HTTP status code: 404
No message available
Pop first available message.
Messages without delay are returned in order that they are sent.
POST /<queue>
{
"body": "Test",
"max_tries": 3,
"timeout": 60,
"offset": 3600,
"delay": 10
}
null
Send message to queue.
Only body
key is required, as every other key has a default value:
{
"max_tries": 1,
"timeout": 30,
"offset": 0,
"delay": null
}
DELETE /<queue>
{
"id": "123e4567-e89b-12d3-a456-426655440000"
}
{
"message": {
"id": "123e4567-e89b-12d3-a456-426655440000",
"body": "Test",
"state": {
"status": "Transit",
"tries": 1,
"max_tries": 3
},
"time": {
"dispatched_at": "2020-12-21T14:33:25+01:00",
"delay": "2020-12-21T14:33:30+01:00",
"timeout": {
"max": 60,
"obtained_at": "2020-12-21T14:33:35+01:00"
}
}
}
}
HTTP status code: 404
Message not found
Delete message from queue.
POST /<queue>/requeue
{
"id": "123e4567-e89b-12d3-a456-426655440000"
}
null
HTTP status code: 404
Message not found
Return message to queue, incrementing its try count.
Message will be collected by GC if there are no more tries left.
GET /<queue>/size
{
"size": 1
}
Get queue message count.
POST /<queue>/clear
null
Delete all messages in queue.