-
Notifications
You must be signed in to change notification settings - Fork 0
API_QS
mfbus module contains a "queue server".
With this service, you can push and pull queues through a REST api. It's not a storage service because all objects have a lifetime and could be automatically cleaned.
A namespace
is just a kind of bucket for yours queues. It's a plain string (length < 64 characters).
Allowed characters are alphanumeric ones [0-9a-zA-Z]
, .
(dot), _
(underscore) and '-' (hyphen).
A queue
is just a queue name for your elements. It's a plain string (length < 64 characters).
Allowed characters are alphanumeric ones [0-9a-zA-Z]
, .
(dot), _
(underscore) and '-' (hyphen).
You can see element
as a little (< 100 KB) binary file. It can be a text file, an image, a JSON or anything else. The service does not make any assumptions about the content of your elements. They are never altered.
All elements have a lifetime (in seconds). The lifetime can be specific to each element even there is a default and a maximum value in global configuration.
This service push a new element at the end of given queue
in the given namespace
.
The element is the (raw) body of your POST request.
Note: namespace
and queue
are created automatically.
If the operation is successful, the service will respond with a HTTP/202 Accepted
status code.
You can also set:
- a specific lifetime for your blob by adding (for example) a
X-QueueServer-Lifetime: 60
header to your request - a specific indicative
Content-Type
for your blob by adding (for example) aX-QueueServer-ContentType: image/png
header
This service pulls an existing element at the head of the given queue
in the given namespace
.
The element is the (raw) body of the POST request used to add it.
The element is served with the Content-Type
header you set during the POST request.
If the queue is empty:
- if
timeout=0
(default), the service reply withHTTP/204 No Content
- if
timeout>0
, the service blocks until an element is available on the queueHTTP/200 OK
or until the timeoutHTTP/204 No Content